| 1 |
// RUN: %clang_cc1 -triple arm64-apple-macosx14.0.0 -O0 -debug-info-kind=standalone -dwarf-version=5 \ |
| 2 |
// RUN: -fsanitize=bool -fsanitize-trap=bool -emit-llvm %s -o - | FileCheck %s |
| 3 |
|
| 4 |
#include <stdbool.h> |
| 5 |
|
| 6 |
unsigned char bad_byte; |
| 7 |
|
| 8 |
bool load_invalid_value(void) { return *((bool *)&bad_byte); } |
| 9 |
|
| 10 |
// CHECK-LABEL: @load_invalid_value |
| 11 |
// CHECK: call void @llvm.ubsantrap(i8 10) {{.*}}!dbg [[LOC:![0-9]+]] |
| 12 |
// CHECK: [[LOC]] = !DILocation(line: 0, scope: [[MSG:![0-9]+]], {{.+}}) |
| 13 |
// CHECK: [[MSG]] = distinct !DISubprogram(name: "__clang_trap_msg$Undefined Behavior Sanitizer$Loaded an invalid or uninitialized value for the type" |