Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / ubsan / TestCases / Misc / bool.cpp
blobf6dc24e4bc7834c30edbeab241212413cd74b998
1 // RUN: %clangxx -fsanitize=bool %s -O3 -o %t
2 // RUN: not %run %t 2>&1 | FileCheck %s
3 // RUN: %env_ubsan_opts=print_summary=1:report_error_type=1 not %run %t 2>&1 | FileCheck %s --check-prefix=SUMMARY
5 unsigned char NotABool = 123;
7 int main(int argc, char **argv) {
8 bool *p = (bool*)&NotABool;
10 // CHECK: bool.cpp:[[@LINE+1]]:10: runtime error: load of value 123, which is not a valid value for type 'bool'
11 return *p;
12 // SUMMARY: SUMMARY: {{.*}}Sanitizer: invalid-bool-load {{.*}}bool.cpp:[[@LINE-1]]