[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / CodeGenCXX / debug-info-access.cpp
blob9f2c044843d0f0f4e98a885de30bad50226a7240
1 // RUN: %clang_cc1 -emit-llvm -debug-info-kind=limited -triple %itanium_abi_triple %s -o - | FileCheck %s
2 // Test the various accessibility flags in the debug info.
3 struct A {
4 // CHECK: ![[A:[0-9]+]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "A",
6 // CHECK-DAG: !DISubprogram(name: "pub_default",{{.*}} line: [[@LINE+1]],{{.*}} flags: DIFlagPrototyped,
7 void pub_default();
8 // CHECK-DAG: !DIDerivedType(tag: DW_TAG_member, name: "pub_default_static",{{.*}} line: [[@LINE+1]],{{.*}} flags: DIFlagStaticMember)
9 static int pub_default_static;
12 // CHECK: !DIDerivedType(tag: DW_TAG_inheritance,{{.*}} baseType: ![[A]],{{.*}} flags: DIFlagPublic, extraData: i32 0)
13 class B : public A {
14 public:
15 // CHECK-DAG: !DISubprogram(name: "pub",{{.*}} line: [[@LINE+1]],{{.*}} flags: DIFlagPublic | DIFlagPrototyped,
16 void pub();
17 // CHECK-DAG: !DIDerivedType(tag: DW_TAG_member, name: "public_static",{{.*}} line: [[@LINE+1]],{{.*}} flags: DIFlagPublic | DIFlagStaticMember)
18 static int public_static;
20 protected:
21 // CHECK-DAG: !DIDerivedType(tag: DW_TAG_typedef, name: "prot_typedef",{{.*}} line: [[@LINE+1]],{{.*}} flags: DIFlagProtected)
22 typedef int prot_typedef;
23 // CHECK-DAG: !DIDerivedType(tag: DW_TAG_typedef, name: "prot_using",{{.*}} line: [[@LINE+1]],{{.*}} flags: DIFlagProtected)
24 using prot_using = prot_typedef;
25 prot_using prot_member;
27 // CHECK: !DISubprogram(name: "prot",{{.*}} line: [[@LINE+1]],{{.*}} flags: DIFlagProtected | DIFlagPrototyped,
28 void prot();
30 private:
31 // CHECK: !DISubprogram(name: "priv_default",{{.*}} line: [[@LINE+1]],{{.*}} flags: DIFlagPrototyped,
32 void priv_default();
35 class C {
36 public:
37 // CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "D",{{.*}} flags: DIFlagPublic | DIFlagTypePassByValue,
38 struct D {
40 protected:
41 // CHECK: !DICompositeType(tag: DW_TAG_union_type, name: "E",{{.*}} flags: DIFlagProtected | DIFlagTypePassByValue,
42 union E {
44 private:
45 // CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "J",{{.*}} flags: DIFlagTypePassByValue,
46 struct J {
48 public:
49 D d;
50 E e;
51 J j;
54 struct F {
55 private:
56 // CHECK: !DICompositeType(tag: DW_TAG_union_type, name: "G",{{.*}} flags: DIFlagPrivate | DIFlagTypePassByValue,
57 union G {
59 public:
60 G g;
63 union H {
64 private:
65 // CHECK: !DICompositeType(tag: DW_TAG_class_type, name: "I",{{.*}} flags: DIFlagPrivate | DIFlagTypePassByValue,
66 class I {
68 public:
69 I i;
72 union U {
73 // CHECK-DAG: !DISubprogram(name: "union_pub_default",{{.*}} line: [[@LINE+1]],{{.*}} flags: DIFlagPrototyped,
74 void union_pub_default();
75 private:
76 // CHECK-DAG: !DIDerivedType(tag: DW_TAG_member, name: "union_priv",{{.*}} line: [[@LINE+1]],{{.*}} flags: DIFlagPrivate)
77 int union_priv;
80 // CHECK: !DISubprogram(name: "free",
81 // CHECK-SAME: flags: DIFlagPrototyped,
82 // CHECK-SAME: spFlags: DISPFlagDefinition
83 void free() {}
85 U u;
86 A a;
87 B b;
88 C c;
89 F f;
90 H h;