Mercurial > hg > CbC > CbC_llvm
comparison clang/test/CodeGen/annotations-var.c @ 252:1f2b6ac9f198 llvm-original
LLVM16-1
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 18 Aug 2023 09:04:13 +0900 |
parents | c4bab56944e8 |
children |
comparison
equal
deleted
inserted
replaced
237:c80f45b162ad | 252:1f2b6ac9f198 |
---|---|
1 // RUN: %clang_cc1 -no-opaque-pointers -triple x86_64-apple-darwin10 -emit-llvm -o %t1 %s | 1 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o %t1 %s |
2 // RUN: FileCheck --check-prefix=LOCAL %s < %t1 | 2 // RUN: FileCheck --check-prefix=LOCAL %s < %t1 |
3 // RUN: FileCheck --check-prefix=UNDEF %s < %t1 | 3 // RUN: FileCheck --check-prefix=UNDEF %s < %t1 |
4 // RUN: FileCheck --check-prefix=PARAM %s < %t1 | 4 // RUN: FileCheck --check-prefix=PARAM %s < %t1 |
5 // END. | 5 // END. |
6 | 6 |
17 int foo(int v __attribute__((annotate("param_ann_2"))) __attribute__((annotate("param_ann_3")))); | 17 int foo(int v __attribute__((annotate("param_ann_2"))) __attribute__((annotate("param_ann_3")))); |
18 int foo(int v __attribute__((annotate("param_ann_0"))) __attribute__((annotate("param_ann_1")))) { | 18 int foo(int v __attribute__((annotate("param_ann_0"))) __attribute__((annotate("param_ann_1")))) { |
19 return v + 1; | 19 return v + 1; |
20 // PARAM: define {{.*}}@foo | 20 // PARAM: define {{.*}}@foo |
21 // PARAM: [[V:%.*]] = alloca i32 | 21 // PARAM: [[V:%.*]] = alloca i32 |
22 // PARAM: bitcast i32* [[V]] to i8* | 22 // PARAM: call void @llvm.var.annotation.p0.p0( |
23 // PARAM-NEXT: call void @llvm.var.annotation( | 23 // PARAM-NEXT: call void @llvm.var.annotation.p0.p0( |
24 // PARAM-NEXT: bitcast i32* [[V]] to i8* | 24 // PARAM-NEXT: call void @llvm.var.annotation.p0.p0( |
25 // PARAM-NEXT: call void @llvm.var.annotation( | 25 // PARAM-NEXT: call void @llvm.var.annotation.p0.p0( |
26 // PARAM-NEXT: bitcast i32* [[V]] to i8* | |
27 // PARAM-NEXT: call void @llvm.var.annotation( | |
28 // PARAM-NEXT: bitcast i32* [[V]] to i8* | |
29 // PARAM-NEXT: call void @llvm.var.annotation( | |
30 } | 26 } |
31 | 27 |
32 void local(void) { | 28 void local(void) { |
33 int localvar __attribute__((annotate("localvar_ann_0"))) __attribute__((annotate("localvar_ann_1"))) = 3; | 29 int localvar __attribute__((annotate("localvar_ann_0"))) __attribute__((annotate("localvar_ann_1"))) = 3; |
34 // LOCAL-LABEL: define{{.*}} void @local() | 30 // LOCAL-LABEL: define{{.*}} void @local() |
35 // LOCAL: [[LOCALVAR:%.*]] = alloca i32, | 31 // LOCAL: [[LOCALVAR:%.*]] = alloca i32, |
36 // LOCAL-NEXT: [[T0:%.*]] = bitcast i32* [[LOCALVAR]] to i8* | 32 // LOCAL-NEXT: call void @llvm.var.annotation.p0.p0(ptr [[LOCALVAR]], ptr @{{.*}}, ptr @{{.*}}, i32 29, ptr null) |
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) | 33 // LOCAL-NEXT: call void @llvm.var.annotation.p0.p0(ptr [[LOCALVAR]], ptr @{{.*}}, ptr @{{.*}}, i32 29, ptr null) |
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, i8* null) | |
40 } | 34 } |
41 | 35 |
42 void local_after_return(void) { | 36 void local_after_return(void) { |
43 return; | 37 return; |
44 int localvar __attribute__((annotate("localvar_after_return"))) = 3; | 38 int localvar __attribute__((annotate("localvar_after_return"))) = 3; |
50 | 44 |
51 void undef(void) { | 45 void undef(void) { |
52 int undefvar __attribute__((annotate("undefvar_ann_0"))); | 46 int undefvar __attribute__((annotate("undefvar_ann_0"))); |
53 // UNDEF-LABEL: define{{.*}} void @undef() | 47 // UNDEF-LABEL: define{{.*}} void @undef() |
54 // UNDEF: [[UNDEFVAR:%.*]] = alloca i32, | 48 // UNDEF: [[UNDEFVAR:%.*]] = alloca i32, |
55 // UNDEF-NEXT: [[T0:%.*]] = bitcast i32* [[UNDEFVAR]] to i8* | 49 // UNDEF-NEXT: call void @llvm.var.annotation.p0.p0(ptr [[UNDEFVAR]], ptr @{{.*}}, ptr @{{.*}}, i32 46, ptr null) |
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 } | 50 } |