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