annotate clang/test/CodeGen/ubsan-function.cpp @ 207:2e18cbf3894f

LLVM12
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 08 Jun 2021 06:07:14 +0900
parents 1d019706d866
children c4bab56944e8
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
207
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
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) }> {
150
anatofuz
parents:
diff changeset
4 void fun() {}
anatofuz
parents:
diff changeset
5
207
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
6 // CHECK-LABEL: define{{.*}} void @_Z6callerPFvvE(void ()* %f)
150
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(); }