[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / CodeGen / attr-btf_tag-diglobalvariable.c
blob3eb8175d93c55187855d2f85fa437704c5365b3d
1 // REQUIRES: x86-registered-target
2 // RUN: %clang -target x86_64 -g -S -emit-llvm -o - %s | FileCheck %s
4 #define __tag1 __attribute__((btf_decl_tag("tag1")))
5 #define __tag2 __attribute__((btf_decl_tag("tag2")))
7 struct t1 {
8 int a;
9 };
10 struct t1 g1 __tag1 __tag2;
12 extern struct t1 g2 __tag1 __tag2;
13 struct t1 g2;
15 // CHECK: distinct !DIGlobalVariable(name: "g1", scope: ![[#]], file: ![[#]], line: [[#]], type: ![[#]], isLocal: false, isDefinition: true, annotations: ![[ANNOT:[0-9]+]])
16 // CHECK: distinct !DIGlobalVariable(name: "g2", scope: ![[#]], file: ![[#]], line: [[#]], type: ![[#]], isLocal: false, isDefinition: true, annotations: ![[ANNOT]])
17 // CHECK: ![[ANNOT]] = !{![[TAG1:[0-9]+]], ![[TAG2:[0-9]+]]}
18 // CHECK: ![[TAG1]] = !{!"btf_decl_tag", !"tag1"}
19 // CHECK: ![[TAG2]] = !{!"btf_decl_tag", !"tag2"}
21 extern struct t1 g3 __tag1;
22 struct t1 g3 __tag2;
24 // CHECK: distinct !DIGlobalVariable(name: "g3", scope: ![[#]], file: ![[#]], line: [[#]], type: ![[#]], isLocal: false, isDefinition: true, annotations: ![[ANNOT]])
26 extern struct t1 g4;
27 struct t1 g4 __tag1 __tag2;
29 // CHECK: distinct !DIGlobalVariable(name: "g4", scope: ![[#]], file: ![[#]], line: [[#]], type: ![[#]], isLocal: false, isDefinition: true, annotations: ![[ANNOT]])