blob: 1d8ad62c5b882faef52acbd6ca38f92e2d90e279 [file] [log] [blame]
Filipe Cabecinhas090a2372014-10-18 23:47:59 +00001// 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
Eric Christopher2ccf3a22013-01-16 01:22:09 +00003// RUN: %test_debuginfo %s %t.out
4
5// DEBUGGER: delete breakpoints
Eric Christopher5724ee92013-01-17 20:09:50 +00006// DEBUGGER: break static-member.cpp:33
Eric Christopher2ccf3a22013-01-16 01:22:09 +00007// DEBUGGER: r
Adrian Prantl32347752014-03-08 01:03:55 +00008// DEBUGGER: ptype MyClass
9// CHECK: {{struct|class}} MyClass {
Eric Christopher5724ee92013-01-17 20:09:50 +000010// CHECK: static const int a;
Eric Christopher2ccf3a22013-01-16 01:22:09 +000011// CHECK-NEXT: static int b;
12// CHECK-NEXT: static int c;
13// CHECK-NEXT: int d;
14// CHECK-NEXT: }
Adrian Prantl32347752014-03-08 01:03:55 +000015// DEBUGGER: p MyClass::a
16// CHECK: ${{[0-9]}} = 4
17// DEBUGGER: p MyClass::c
18// CHECK: ${{[0-9]}} = 15
Eric Christopher2ccf3a22013-01-16 01:22:09 +000019
20// PR14471, PR14734
21
Adrian Prantl32347752014-03-08 01:03:55 +000022class MyClass {
Eric Christopher2ccf3a22013-01-16 01:22:09 +000023public:
24 const static int a = 4;
25 static int b;
26 static int c;
27 int d;
28};
29
Adrian Prantl32347752014-03-08 01:03:55 +000030int MyClass::c = 15;
31const int MyClass::a;
Eric Christopher2ccf3a22013-01-16 01:22:09 +000032
33int main() {
Adrian Prantl32347752014-03-08 01:03:55 +000034 MyClass instance_MyClass;
35 return MyClass::a;
Eric Christopher2ccf3a22013-01-16 01:22:09 +000036}