comparison clang/test/CodeGen/annotations-var.c @ 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
comparison
equal deleted inserted replaced
173:0572611fdcc8 207:2e18cbf3894f
29 // PARAM-NEXT: call void @llvm.var.annotation( 29 // PARAM-NEXT: call void @llvm.var.annotation(
30 } 30 }
31 31
32 void local(void) { 32 void local(void) {
33 int localvar __attribute__((annotate("localvar_ann_0"))) __attribute__((annotate("localvar_ann_1"))) = 3; 33 int localvar __attribute__((annotate("localvar_ann_0"))) __attribute__((annotate("localvar_ann_1"))) = 3;
34 // LOCAL-LABEL: define void @local() 34 // LOCAL-LABEL: define{{.*}} void @local()
35 // LOCAL: [[LOCALVAR:%.*]] = alloca i32, 35 // LOCAL: [[LOCALVAR:%.*]] = alloca i32,
36 // LOCAL-NEXT: [[T0:%.*]] = bitcast i32* [[LOCALVAR]] to i8* 36 // LOCAL-NEXT: [[T0:%.*]] = bitcast i32* [[LOCALVAR]] to i8*
37 // LOCAL-NEXT: call void @llvm.var.annotation(i8* [[T0]], i8* getelementptr inbounds ([15 x i8], [15 x i8]* @{{.*}}), i8* getelementptr inbounds ({{.*}}), i32 33) 37 // LOCAL-NEXT: call void @llvm.var.annotation(i8* [[T0]], i8* getelementptr inbounds ([15 x i8], [15 x i8]* @{{.*}}), i8* getelementptr inbounds ({{.*}}), i32 33, i8* null)
38 // LOCAL-NEXT: [[T0:%.*]] = bitcast i32* [[LOCALVAR]] to i8* 38 // LOCAL-NEXT: [[T0:%.*]] = bitcast i32* [[LOCALVAR]] to i8*
39 // LOCAL-NEXT: call void @llvm.var.annotation(i8* [[T0]], i8* getelementptr inbounds ([15 x i8], [15 x i8]* @{{.*}}), i8* getelementptr inbounds ({{.*}}), i32 33) 39 // LOCAL-NEXT: call void @llvm.var.annotation(i8* [[T0]], i8* getelementptr inbounds ([15 x i8], [15 x i8]* @{{.*}}), i8* getelementptr inbounds ({{.*}}), i32 33, i8* null)
40 } 40 }
41 41
42 void local_after_return(void) { 42 void local_after_return(void) {
43 return; 43 return;
44 int localvar __attribute__((annotate("localvar_after_return"))) = 3; 44 int localvar __attribute__((annotate("localvar_after_return"))) = 3;
45 // Test we are not emitting instructions like bitcast or call outside of a basic block. 45 // Test we are not emitting instructions like bitcast or call outside of a basic block.
46 // LOCAL-LABEL: define void @local_after_return() 46 // LOCAL-LABEL: define{{.*}} void @local_after_return()
47 // LOCAL: [[LOCALVAR:%.*]] = alloca i32, 47 // LOCAL: [[LOCALVAR:%.*]] = alloca i32,
48 // LOCAL-NEXT: ret void 48 // LOCAL-NEXT: ret void
49 } 49 }
50 50
51 void undef(void) { 51 void undef(void) {
52 int undefvar __attribute__((annotate("undefvar_ann_0"))); 52 int undefvar __attribute__((annotate("undefvar_ann_0")));
53 // UNDEF-LABEL: define void @undef() 53 // UNDEF-LABEL: define{{.*}} void @undef()
54 // UNDEF: [[UNDEFVAR:%.*]] = alloca i32, 54 // UNDEF: [[UNDEFVAR:%.*]] = alloca i32,
55 // UNDEF-NEXT: [[T0:%.*]] = bitcast i32* [[UNDEFVAR]] to i8* 55 // UNDEF-NEXT: [[T0:%.*]] = bitcast i32* [[UNDEFVAR]] to i8*
56 // UNDEF-NEXT: call void @llvm.var.annotation(i8* [[T0]], i8* getelementptr inbounds ([15 x i8], [15 x i8]* @{{.*}}), i8* getelementptr inbounds ({{.*}}), i32 52) 56 // UNDEF-NEXT: call void @llvm.var.annotation(i8* [[T0]], i8* getelementptr inbounds ([15 x i8], [15 x i8]* @{{.*}}), i8* getelementptr inbounds ({{.*}}), i32 52, i8* null)
57 } 57 }