1 // RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -o - %s -fsanitize=function -fno-sanitize-recover=all | FileCheck %s
3 // CHECK: @[[PROXY:.*]] = private unnamed_addr constant ptr @_ZTIFvvE
4 // CHECK: define{{.*}} void @_Z3funv() #0 !func_sanitize ![[FUNCSAN:.*]] {
7 // CHECK-LABEL: define{{.*}} void @_Z6callerPFvvE(ptr noundef %f)
8 // CHECK: getelementptr <{ i32, i32 }>, ptr {{.*}}, i32 0, i32 0, !nosanitize
9 // CHECK: load i32, ptr {{.*}}, align {{.*}}, !nosanitize
10 // CHECK: icmp eq i32 {{.*}}, 846595819, !nosanitize
11 // CHECK: br i1 {{.*}}, label %[[LABEL1:.*]], label %[[LABEL4:.*]], !nosanitize
13 // CHECK: getelementptr <{ i32, i32 }>, ptr {{.*}}, i32 0, i32 1, !nosanitize
14 // CHECK: load i32, ptr {{.*}}, align {{.*}}, !nosanitize
15 // CHECK: icmp eq ptr {{.*}}, @_ZTIFvvE, !nosanitize
16 // CHECK: br i1 {{.*}}, label %[[LABEL3:.*]], label %[[LABEL2:[^,]*]], {{.*}}!nosanitize
18 // CHECK: call void @__ubsan_handle_function_type_mismatch_v1_abort(ptr {{.*}}, i64 {{.*}}, i64 {{.*}}, i64 {{.*}}) #{{.*}}, !nosanitize
19 // CHECK-NOT: unreachable
20 // CHECK: br label %[[LABEL3]], !nosanitize
22 // CHECK: br label %[[LABEL4]], !nosanitize
23 void caller(void (*f
)()) { f(); }
25 // CHECK: ![[FUNCSAN]] = !{i32 846595819, ptr @[[PROXY]]}