Home | History | Annotate | Download | only in CodeGenCXX
      1 // RUN: %clang_cc1 -emit-llvm -g -triple %itanium_abi_triple %s -o - | FileCheck %s
      2 // Test the various accessibility flags in the debug info.
      3 struct A {
      4   // CHECK-DAG: !MDSubprogram(name: "pub_default",{{.*}} line: [[@LINE+1]],{{.*}} flags: DIFlagPrototyped,
      5   void pub_default();
      6   // CHECK-DAG: !MDDerivedType(tag: DW_TAG_member, name: "pub_default_static",{{.*}} line: [[@LINE+1]],{{.*}} flags: DIFlagStaticMember)
      7   static int pub_default_static;
      8 };
      9 
     10 // CHECK: !MDDerivedType(tag: DW_TAG_inheritance,{{.*}} baseType: !"_ZTS1A",{{.*}} flags: DIFlagPublic)
     11 class B : public A {
     12 public:
     13   // CHECK-DAG: !MDSubprogram(name: "pub",{{.*}} line: [[@LINE+1]],{{.*}} flags: DIFlagPublic | DIFlagPrototyped,
     14   void pub();
     15   // CHECK-DAG: !MDDerivedType(tag: DW_TAG_member, name: "public_static",{{.*}} line: [[@LINE+1]],{{.*}} flags: DIFlagPublic | DIFlagStaticMember)
     16   static int public_static;
     17 protected:
     18   // CHECK: !MDSubprogram(name: "prot",{{.*}} line: [[@LINE+1]],{{.*}} flags: DIFlagProtected | DIFlagPrototyped,
     19   void prot();
     20 private:
     21   // CHECK: !MDSubprogram(name: "priv_default",{{.*}} line: [[@LINE+1]],{{.*}} flags: DIFlagPrototyped,
     22   void priv_default();
     23 };
     24 
     25 union U {
     26   // CHECK-DAG: !MDSubprogram(name: "union_pub_default",{{.*}} line: [[@LINE+1]],{{.*}} flags: DIFlagPrototyped,
     27   void union_pub_default();
     28 private:
     29   // CHECK-DAG: !MDDerivedType(tag: DW_TAG_member, name: "union_priv",{{.*}} line: [[@LINE+1]],{{.*}} flags: DIFlagPrivate)
     30   int union_priv;
     31 };
     32 
     33 
     34 // CHECK: !MDSubprogram(name: "free",
     35 // CHECK-SAME:          isDefinition: true
     36 // CHECK-SAME:          flags: DIFlagPrototyped,
     37 void free() {}
     38 
     39 A a;
     40 B b;
     41 U u;
     42