3
3
4
4
// CHECK: private unnamed_addr constant [8 x i8] c"v_ann_{{.}}\00", section "llvm.metadata"
5
5
// CHECK: private unnamed_addr constant [8 x i8] c"v_ann_{{.}}\00", section "llvm.metadata"
6
+ // CHECK: private unnamed_addr constant [8 x i8] c"w_ann_{{.}}\00", section "llvm.metadata"
7
+ // CHECK: private unnamed_addr constant [8 x i8] c"w_ann_{{.}}\00", section "llvm.metadata"
8
+ // CHECK: private unnamed_addr constant [8 x i8] c"f_ann_{{.}}\00", section "llvm.metadata"
9
+ // CHECK: private unnamed_addr constant [8 x i8] c"f_ann_{{.}}\00", section "llvm.metadata"
6
10
7
11
struct foo {
8
12
int v __attribute__((annotate ("v_ann_0" ))) __attribute__((annotate ("v_ann_1" )));
13
+ char w __attribute__((annotate ("w_ann_0" ))) __attribute__((annotate ("w_ann_1" )));
14
+ float f __attribute__((annotate ("f_ann_0" ))) __attribute__((annotate ("f_ann_1" )));
9
15
};
10
16
11
17
static struct foo gf ;
@@ -14,13 +20,25 @@ int main(int argc, char **argv) {
14
20
struct foo f ;
15
21
f .v = argc ;
16
22
// CHECK: getelementptr inbounds %struct.foo, %struct.foo* %f, i32 0, i32 0
17
- // CHECK-NEXT: bitcast i32* {{.*}} to i8*
18
- // CHECK-NEXT: call i8* @llvm.ptr.annotation.p0i8({{.*}}str{{.*}}str{{.*}}i32 8)
19
- // CHECK-NEXT: bitcast i8* {{.*}} to i32*
20
- // CHECK-NEXT: bitcast i32* {{.*}} to i8*
21
- // CHECK-NEXT: call i8* @llvm.ptr.annotation.p0i8({{.*}}str{{.*}}str{{.*}}i32 8)
22
- // CHECK-NEXT: bitcast i8* {{.*}} to i32*
23
+ // CHECK-NEXT: call i32* @llvm.ptr.annotation.p0i32({{.*}}str{{.*}}str{{.*}}i32 12)
24
+ // CHECK-NEXT: call i32* @llvm.ptr.annotation.p0i32({{.*}}str{{.*}}str{{.*}}i32 12)
25
+ f .w = 42 ;
26
+ // CHECK: getelementptr inbounds %struct.foo, %struct.foo* %f, i32 0, i32 1
27
+ // CHECK-NEXT: call i8* @llvm.ptr.annotation.p0i8({{.*}}str{{.*}}str{{.*}}i32 13)
28
+ // CHECK-NEXT: call i8* @llvm.ptr.annotation.p0i8({{.*}}str{{.*}}str{{.*}}i32 13)
29
+ f .f = 0 ;
30
+ // CHECK: getelementptr inbounds %struct.foo, %struct.foo* %f, i32 0, i32 2
31
+ // CHECK-NEXT: bitcast float* {{.*}} to i8*
32
+ // CHECK-NEXT: call i8* @llvm.ptr.annotation.p0i8({{.*}}str{{.*}}str{{.*}}i32 14)
33
+ // CHECK-NEXT: bitcast i8* {{.*}} to float*
34
+ // CHECK-NEXT: bitcast float* {{.*}} to i8*
35
+ // CHECK-NEXT: call i8* @llvm.ptr.annotation.p0i8({{.*}}str{{.*}}str{{.*}}i32 14)
36
+ // CHECK-NEXT: bitcast i8* {{.*}} to float*
23
37
gf .v = argc ;
24
- // CHECK: call i8* @llvm.ptr.annotation.p0i8(i8* bitcast (%struct.foo* @gf to i8*), {{.*}}str{{.*}}str{{.*}}i32 8)
38
+ // CHECK: call i32* @llvm.ptr.annotation.p0i32(i32* getelementptr inbounds (%struct.foo, %struct.foo* @gf, i32 0, i32 0), {{.*}}str{{.*}}str{{.*}}i32 12)
39
+ gf .w = 42 ;
40
+ // CHECK: call i8* @llvm.ptr.annotation.p0i8(i8* getelementptr inbounds (%struct.foo, %struct.foo* @gf, i32 0, i32 1), {{.*}}str{{.*}}str{{.*}}i32 13)
41
+ gf .f = 0 ;
42
+ // CHECK: call i8* @llvm.ptr.annotation.p0i8(i8* bitcast (float* getelementptr inbounds (%struct.foo, %struct.foo* @gf, i32 0, i32 2) to i8*), {{.*}}str{{.*}}str{{.*}}i32 14)
25
43
return 0 ;
26
44
}
0 commit comments