blob: 5a626c5418fba7671c934fc0aadad858cd8d5944 [file] [log] [blame]
Devang Patelcef37602011-05-17 00:20:50 +00001// RUN: %clangxx -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: type = int (void)
10
11int 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}