Skip to content

Commit 2ccf3a2

Browse files
committed
Add a test for static member debug information.
Part of PR14471. Patch by Paul Robinson. llvm-svn: 172589
1 parent fb5b224 commit 2ccf3a2

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

debuginfo-tests/static-member.cpp

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// RUN: %clangxx -O0 -g %s -o %t.out
2+
// RUN: %test_debuginfo %s %t.out
3+
4+
// DEBUGGER: delete breakpoints
5+
// DEBUGGER: break main
6+
// DEBUGGER: r
7+
// DEBUGGER: n
8+
// DEBUGGER: ptype C
9+
// CHECK: type = class C {
10+
// CHECK-NEXT: public:
11+
// CHECK-NEXT: static const int a;
12+
// CHECK-NEXT: static int b;
13+
// CHECK-NEXT: static int c;
14+
// CHECK-NEXT: int d;
15+
// CHECK-NEXT: }
16+
// DEBUGGER: p instance_C
17+
// CHECK: $1 = {static a = 4, static b = {{.*}}, static c = 15, d = {{.*}}}
18+
19+
// PR14471, PR14734
20+
21+
class C {
22+
public:
23+
const static int a = 4;
24+
static int b;
25+
static int c;
26+
int d;
27+
};
28+
29+
int C::c = 15;
30+
const int C::a;
31+
32+
int main() {
33+
C instance_C;
34+
return C::a;
35+
}

0 commit comments

Comments
 (0)