Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / ubsan / TestCases / Pointer / align-assume-ignorelist.cpp
blob3f9a1ceff9dada387ce6dc1347fd9f6a5b70f1db
1 // RUN: %clangxx -fsanitize=alignment -fno-sanitize-recover=alignment -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s --implicit-check-not=" assumption "
3 // RUN: rm -f %tmp
4 // RUN: echo "[alignment]" >> %tmp
5 // RUN: echo "fun:main" >> %tmp
6 // RUN: %clangxx -fsanitize=alignment -fno-sanitize-recover=alignment -fsanitize-ignorelist=%tmp -O0 %s -o %t && %run %t 2>&1
8 #include <stdlib.h>
10 int main(int argc, char* argv[]) {
11 char *ptr = (char *)malloc(2);
13 __builtin_assume_aligned(ptr + 1, 0x8000);
14 // CHECK: {{.*}}align-assume-ignorelist.cpp:[[@LINE-1]]:32: runtime error: assumption of 32768 byte alignment for pointer of type 'char *' failed
15 // CHECK: 0x{{.*}}: note: address is {{.*}} aligned, misalignment offset is {{.*}} byte
17 free(ptr);
19 return 0;