1// RUN: %clangxx %target_itanium_abi_host_triple -O0 -g %s -o %t -c
2// RUN: %clangxx %target_itanium_abi_host_triple %t -o %t.out
3// RUN: %test_debuginfo %s %t.out
4// XFAIL: !system-darwin && gdb-clang-incompatibility
5// DEBUGGER: delete breakpoints
6// DEBUGGER: break static-member.cpp:35
7// DEBUGGER: r
8// DEBUGGER: ptype MyClass
9// CHECK: {{struct|class}} MyClass {
10// CHECK: static const int a
11// CHECK-NEXT: static int b;
12// CHECK-NEXT: static int c;
13// CHECK: int d;
14// CHECK-NEXT: }
15// DEBUGGER: p MyClass::a
16// CHECK: ${{[0-9]}} = 4
17// DEBUGGER: p MyClass::c
18// CHECK: ${{[0-9]}} = 15
19
20// PR14471, PR14734
21
22class MyClass {
23public:
24 const static int a = 4;
25 static int b;
26 static int c;
27 int d;
28};
29
30int MyClass::c = 15;
31const int MyClass::a;
32
33int main() {
34 MyClass instance_MyClass;
35 return MyClass::a;
36}
37

source code of cross-project-tests/debuginfo-tests/llgdb-tests/static-member.cpp