annotate clang/test/CodeGen/ubsan-function.cpp @ 150:1d019706d866

LLVM10
author anatofuz
date Thu, 13 Feb 2020 15:10:13 +0900
parents
children 2e18cbf3894f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm -o - %s -fsanitize=function -fno-sanitize-recover=all | FileCheck %s
anatofuz
parents:
diff changeset
2
anatofuz
parents:
diff changeset
3 // CHECK-LABEL: define void @_Z3funv() #0 prologue <{ i32, i32 }> <{ i32 846595819, i32 trunc (i64 sub (i64 ptrtoint (i8** @0 to i64), i64 ptrtoint (void ()* @_Z3funv to i64)) to i32) }> {
anatofuz
parents:
diff changeset
4 void fun() {}
anatofuz
parents:
diff changeset
5
anatofuz
parents:
diff changeset
6 // CHECK-LABEL: define void @_Z6callerPFvvE(void ()* %f)
anatofuz
parents:
diff changeset
7 // CHECK: getelementptr <{ i32, i32 }>, <{ i32, i32 }>* {{.*}}, i32 0, i32 0, !nosanitize
anatofuz
parents:
diff changeset
8 // CHECK: load i32, i32* {{.*}}, align {{.*}}, !nosanitize
anatofuz
parents:
diff changeset
9 // CHECK: icmp eq i32 {{.*}}, 846595819, !nosanitize
anatofuz
parents:
diff changeset
10 // CHECK: br i1 {{.*}}, label %[[LABEL1:.*]], label %[[LABEL4:.*]], !nosanitize
anatofuz
parents:
diff changeset
11 // CHECK: [[LABEL1]]:
anatofuz
parents:
diff changeset
12 // CHECK: getelementptr <{ i32, i32 }>, <{ i32, i32 }>* {{.*}}, i32 0, i32 1, !nosanitize
anatofuz
parents:
diff changeset
13 // CHECK: load i32, i32* {{.*}}, align {{.*}}, !nosanitize
anatofuz
parents:
diff changeset
14 // CHECK: icmp eq i8* {{.*}}, bitcast ({ i8*, i8* }* @_ZTIFvvE to i8*), !nosanitize
anatofuz
parents:
diff changeset
15 // CHECK: br i1 {{.*}}, label %[[LABEL3:.*]], label %[[LABEL2:[^,]*]], {{.*}}!nosanitize
anatofuz
parents:
diff changeset
16 // CHECK: [[LABEL2]]:
anatofuz
parents:
diff changeset
17 // CHECK: call void @__ubsan_handle_function_type_mismatch_v1_abort(i8* {{.*}}, i64 {{.*}}, i64 {{.*}}, i64 {{.*}}) #{{.*}}, !nosanitize
anatofuz
parents:
diff changeset
18 // CHECK-NOT: unreachable
anatofuz
parents:
diff changeset
19 // CHECK: br label %[[LABEL3]], !nosanitize
anatofuz
parents:
diff changeset
20 // CHECK: [[LABEL3]]:
anatofuz
parents:
diff changeset
21 // CHECK: br label %[[LABEL4]], !nosanitize
anatofuz
parents:
diff changeset
22 void caller(void (*f)()) { f(); }