| 1 |
// RUN: %clang_cc1 -triple arm64-apple-macosx14.0.0 -O0 -debug-info-kind=standalone -dwarf-version=5 \ |
| 2 |
// RUN: -fsanitize=function -fsanitize-trap=function -emit-llvm %s -o - | FileCheck %s |
| 3 |
|
| 4 |
void target(void) {} |
| 5 |
|
| 6 |
int function_type_mismatch(void) { |
| 7 |
int (*fp_int)(int); |
| 8 |
|
| 9 |
fp_int = (int (*)(int))(void *)target; |
| 10 |
|
| 11 |
return fp_int(42); |
| 12 |
} |
| 13 |
|
| 14 |
// CHECK-LABEL: @target |
| 15 |
// CHECK-LABEL: @function_type_mismatch |
| 16 |
// CHECK: call void @llvm.ubsantrap(i8 6) {{.*}}!dbg [[LOC:![0-9]+]] |
| 17 |
// CHECK: [[LOC]] = !DILocation(line: 0, scope: [[MSG:![0-9]+]], {{.+}}) |
| 18 |
// CHECK: [[MSG]] = distinct !DISubprogram(name: "__clang_trap_msg$Undefined Behavior Sanitizer$Function called with mismatched signature" |