1 // RUN: %clangxx %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o
2 // RUN: %test_debuginfo %s %t.o
3 // Radar 9440721
4 // If debug info for my_number() is emitted outside function foo's scope
5 // then a debugger may not be able to handle it. At least one version of
6 // gdb crashes in such cases.
7
8 // DEBUGGER: ptype foo
9 // CHECK: int (void)
10
foo()11 int foo() {
12 struct Local {
13 static int my_number() {
14 return 42;
15 }
16 };
17
18 int i = 0;
19 i = Local::my_number();
20 return i + 1;
21 }
22