Filipe Cabecinhas | 090a237 | 2014-10-18 23:47:59 +0000 | [diff] [blame] | 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 |
Eric Christopher | 2ccf3a2 | 2013-01-16 01:22:09 +0000 | [diff] [blame] | 3 | // RUN: %test_debuginfo %s %t.out |
| 4 | |
| 5 | // DEBUGGER: delete breakpoints |
Eric Christopher | 5724ee9 | 2013-01-17 20:09:50 +0000 | [diff] [blame] | 6 | // DEBUGGER: break static-member.cpp:33 |
Eric Christopher | 2ccf3a2 | 2013-01-16 01:22:09 +0000 | [diff] [blame] | 7 | // DEBUGGER: r |
Adrian Prantl | 3234775 | 2014-03-08 01:03:55 +0000 | [diff] [blame] | 8 | // DEBUGGER: ptype MyClass |
| 9 | // CHECK: {{struct|class}} MyClass { |
Eric Christopher | 5724ee9 | 2013-01-17 20:09:50 +0000 | [diff] [blame] | 10 | // CHECK: static const int a; |
Eric Christopher | 2ccf3a2 | 2013-01-16 01:22:09 +0000 | [diff] [blame] | 11 | // CHECK-NEXT: static int b; |
| 12 | // CHECK-NEXT: static int c; |
| 13 | // CHECK-NEXT: int d; |
| 14 | // CHECK-NEXT: } |
Adrian Prantl | 3234775 | 2014-03-08 01:03:55 +0000 | [diff] [blame] | 15 | // DEBUGGER: p MyClass::a |
| 16 | // CHECK: ${{[0-9]}} = 4 |
| 17 | // DEBUGGER: p MyClass::c |
| 18 | // CHECK: ${{[0-9]}} = 15 |
Eric Christopher | 2ccf3a2 | 2013-01-16 01:22:09 +0000 | [diff] [blame] | 19 | |
| 20 | // PR14471, PR14734 |
| 21 | |
Adrian Prantl | 3234775 | 2014-03-08 01:03:55 +0000 | [diff] [blame] | 22 | class MyClass { |
Eric Christopher | 2ccf3a2 | 2013-01-16 01:22:09 +0000 | [diff] [blame] | 23 | public: |
| 24 | const static int a = 4; |
| 25 | static int b; |
| 26 | static int c; |
| 27 | int d; |
| 28 | }; |
| 29 | |
Adrian Prantl | 3234775 | 2014-03-08 01:03:55 +0000 | [diff] [blame] | 30 | int MyClass::c = 15; |
| 31 | const int MyClass::a; |
Eric Christopher | 2ccf3a2 | 2013-01-16 01:22:09 +0000 | [diff] [blame] | 32 | |
| 33 | int main() { |
Adrian Prantl | 3234775 | 2014-03-08 01:03:55 +0000 | [diff] [blame] | 34 | MyClass instance_MyClass; |
| 35 | return MyClass::a; |
Eric Christopher | 2ccf3a2 | 2013-01-16 01:22:09 +0000 | [diff] [blame] | 36 | } |