alanzhao1 wrote:

> This got reverted in #166197. (The revert message doesn't say why, but we've 
> seen the new test failing e.g. on macOS, so maybe due to that?)

To clarify, Chrome ran into the following test failures:

```
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.
 FAIL: UBSan-AddressSanitizer-arm64 :: 
TestCases/TypeCheck/minimum-alignment.cpp (86363 of 89882)
 ******************** TEST 'UBSan-AddressSanitizer-arm64 :: 
TestCases/TypeCheck/minimum-alignment.cpp' FAILED ********************
 Exit Code: 1
 
 Command Output (stderr):
 --
 
/Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm-build/Release+Asserts/./bin/clang
  --driver-mode=g++ -fsanitize=address  -arch arm64 -stdlib=libc++ 
-mmacosx-version-min=10.12 -isysroot 
/Volumes/Work/s/w/ir/cache/osx_sdk/XCode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk
 -mlinker-version=1115.7.3  -gline-tables-only -fsanitize=alignment 
/Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm/compiler-rt/test/ubsan/TestCases/TypeCheck/minimum-alignment.cpp
 -o 
/Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm-build/Release+Asserts/runtimes/runtimes-bins/compiler-rt/test/ubsan/AddressSanitizer-arm64/TestCases/TypeCheck/Output/minimum-alignment.cpp.tmp
 # RUN: at line 1
 + 
/Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm-build/Release+Asserts/./bin/clang
 --driver-mode=g++ -fsanitize=address -arch arm64 -stdlib=libc++ 
-mmacosx-version-min=10.12 -isysroot 
/Volumes/Work/s/w/ir/cache/osx_sdk/XCode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk
 -mlinker-version=1115.7.3 -gline-tables-only -fsanitize=alignment 
/Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm/compiler-rt/test/ubsan/TestCases/TypeCheck/minimum-alignment.cpp
 -o 
/Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm-build/Release+Asserts/runtimes/runtimes-bins/compiler-rt/test/ubsan/AddressSanitizer-arm64/TestCases/TypeCheck/Output/minimum-alignment.cpp.tmp
 
/Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm/compiler-rt/test/ubsan/TestCases/TypeCheck/minimum-alignment.cpp:22:17:
 error: no member named 'ptrdiff_t' in namespace 'std'
    22 |   assert(((std::ptrdiff_t)ptr & (__STDCPP_DEFAULT_NEW_ALIGNMENT__ - 
1)) == 0);
       |                 ^~~~~~~~~
 1 error generated.
 
 --
 
 ********************
 
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.
 FAIL: UBSan-Standalone-arm64 :: TestCases/TypeCheck/minimum-alignment.cpp 
(86437 of 89882)
 ******************** TEST 'UBSan-Standalone-arm64 :: 
TestCases/TypeCheck/minimum-alignment.cpp' FAILED ********************
 Exit Code: 1
 
 Command Output (stderr):
 --
 
/Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm-build/Release+Asserts/./bin/clang
  --driver-mode=g++  -arch arm64 -stdlib=libc++ -mmacosx-version-min=10.12 
-isysroot 
/Volumes/Work/s/w/ir/cache/osx_sdk/XCode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk
 -mlinker-version=1115.7.3  -gline-tables-only -fsanitize=alignment 
/Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm/compiler-rt/test/ubsan/TestCases/TypeCheck/minimum-alignment.cpp
 -o 
/Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm-build/Release+Asserts/runtimes/runtimes-bins/compiler-rt/test/ubsan/Standalone-arm64/TestCases/TypeCheck/Output/minimum-alignment.cpp.tmp
 # RUN: at line 1
 + 
/Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm-build/Release+Asserts/./bin/clang
 --driver-mode=g++ -arch arm64 -stdlib=libc++ -mmacosx-version-min=10.12 
-isysroot 
/Volumes/Work/s/w/ir/cache/osx_sdk/XCode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk
 -mlinker-version=1115.7.3 -gline-tables-only -fsanitize=alignment 
/Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm/compiler-rt/test/ubsan/TestCases/TypeCheck/minimum-alignment.cpp
 -o 
/Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm-build/Release+Asserts/runtimes/runtimes-bins/compiler-rt/test/ubsan/Standalone-arm64/TestCases/TypeCheck/Output/minimum-alignment.cpp.tmp
 
/Volumes/Work/s/w/ir/cache/builder/src/third_party/llvm/compiler-rt/test/ubsan/TestCases/TypeCheck/minimum-alignment.cpp:22:17:
 error: no member named 'ptrdiff_t' in namespace 'std'
    22 |   assert(((std::ptrdiff_t)ptr & (__STDCPP_DEFAULT_NEW_ALIGNMENT__ - 
1)) == 0);
       |                 ^~~~~~~~~
 1 error generated.
 
 --
```

upstream bug: https://crbug.com/457455651

I guess the fix is to just add `#include <cstddef>` to both tests?

https://github.com/llvm/llvm-project/pull/152532
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to