• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s
2 // END.
3 
4 // CHECK: private unnamed_addr constant [8 x i8] c"v_ann_{{.}}\00", section "llvm.metadata"
5 // CHECK: private unnamed_addr constant [8 x i8] c"v_ann_{{.}}\00", section "llvm.metadata"
6 
7 struct foo {
8     int v __attribute__((annotate("v_ann_0"))) __attribute__((annotate("v_ann_1")));
9 };
10 
11 static struct foo gf;
12 
main(int argc,char ** argv)13 int main(int argc, char **argv) {
14     struct foo f;
15     f.v = argc;
16 // 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, i8* null)
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, i8* null)
22 // CHECK-NEXT: bitcast i8* {{.*}} to i32*
23     gf.v = argc;
24 // CHECK: call i8* @llvm.ptr.annotation.p0i8(i8* bitcast (%struct.foo* @gf to i8*), {{.*}}str{{.*}}str{{.*}}i32 8, i8* null)
25     return 0;
26 }
27