2014-08-31 08:27:00 +08:00
|
|
|
// RUN: %clang_cc1 -emit-llvm -g -triple %itanium_abi_triple %s -o - | FileCheck %s
|
2014-08-30 06:44:27 +08:00
|
|
|
// Test the various accessibility flags in the debug info.
|
|
|
|
struct A {
|
2015-04-30 00:40:08 +08:00
|
|
|
// CHECK-DAG: !DISubprogram(name: "pub_default",{{.*}} line: [[@LINE+1]],{{.*}} flags: DIFlagPrototyped,
|
2014-08-30 06:44:27 +08:00
|
|
|
void pub_default();
|
2015-04-30 00:40:08 +08:00
|
|
|
// CHECK-DAG: !DIDerivedType(tag: DW_TAG_member, name: "pub_default_static",{{.*}} line: [[@LINE+1]],{{.*}} flags: DIFlagStaticMember)
|
2014-08-30 06:44:27 +08:00
|
|
|
static int pub_default_static;
|
|
|
|
};
|
|
|
|
|
2015-04-30 00:40:08 +08:00
|
|
|
// CHECK: !DIDerivedType(tag: DW_TAG_inheritance,{{.*}} baseType: !"_ZTS1A",{{.*}} flags: DIFlagPublic)
|
2014-08-30 06:44:27 +08:00
|
|
|
class B : public A {
|
|
|
|
public:
|
2015-04-30 00:40:08 +08:00
|
|
|
// CHECK-DAG: !DISubprogram(name: "pub",{{.*}} line: [[@LINE+1]],{{.*}} flags: DIFlagPublic | DIFlagPrototyped,
|
2014-08-30 06:44:27 +08:00
|
|
|
void pub();
|
2015-04-30 00:40:08 +08:00
|
|
|
// CHECK-DAG: !DIDerivedType(tag: DW_TAG_member, name: "public_static",{{.*}} line: [[@LINE+1]],{{.*}} flags: DIFlagPublic | DIFlagStaticMember)
|
2014-08-30 06:44:27 +08:00
|
|
|
static int public_static;
|
|
|
|
protected:
|
2015-04-30 00:40:08 +08:00
|
|
|
// CHECK: !DISubprogram(name: "prot",{{.*}} line: [[@LINE+1]],{{.*}} flags: DIFlagProtected | DIFlagPrototyped,
|
2014-08-30 06:44:27 +08:00
|
|
|
void prot();
|
|
|
|
private:
|
2015-04-30 00:40:08 +08:00
|
|
|
// CHECK: !DISubprogram(name: "priv_default",{{.*}} line: [[@LINE+1]],{{.*}} flags: DIFlagPrototyped,
|
2014-08-30 06:44:27 +08:00
|
|
|
void priv_default();
|
|
|
|
};
|
|
|
|
|
|
|
|
union U {
|
2015-04-30 00:40:08 +08:00
|
|
|
// CHECK-DAG: !DISubprogram(name: "union_pub_default",{{.*}} line: [[@LINE+1]],{{.*}} flags: DIFlagPrototyped,
|
2014-08-30 06:44:27 +08:00
|
|
|
void union_pub_default();
|
|
|
|
private:
|
2015-04-30 00:40:08 +08:00
|
|
|
// CHECK-DAG: !DIDerivedType(tag: DW_TAG_member, name: "union_priv",{{.*}} line: [[@LINE+1]],{{.*}} flags: DIFlagPrivate)
|
2014-08-30 06:44:27 +08:00
|
|
|
int union_priv;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2015-04-30 00:40:08 +08:00
|
|
|
// CHECK: !DISubprogram(name: "free",
|
2015-03-04 01:25:55 +08:00
|
|
|
// CHECK-SAME: isDefinition: true
|
|
|
|
// CHECK-SAME: flags: DIFlagPrototyped,
|
2014-08-30 06:44:27 +08:00
|
|
|
void free() {}
|
|
|
|
|
|
|
|
A a;
|
|
|
|
B b;
|
|
|
|
U u;
|