summaryrefslogtreecommitdiffstats
path: root/debuginfo-tests
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2011-05-17 00:20:50 +0000
committerDevang Patel <dpatel@apple.com>2011-05-17 00:20:50 +0000
commitcef37604602c6fef934bafc79fefda3d96f9b957 (patch)
tree84abfb407ebcb1c258cd0a22910ec6375b7c85c8 /debuginfo-tests
parentf9076f3b454d06dc1ad57563ab00665a116e79d7 (diff)
downloadbcm5719-llvm-cef37604602c6fef934bafc79fefda3d96f9b957.tar.gz
bcm5719-llvm-cef37604602c6fef934bafc79fefda3d96f9b957.zip
Test case for r131441.
llvm-svn: 131442
Diffstat (limited to 'debuginfo-tests')
-rw-r--r--debuginfo-tests/nested-struct.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/debuginfo-tests/nested-struct.cpp b/debuginfo-tests/nested-struct.cpp
new file mode 100644
index 00000000000..5a626c5418f
--- /dev/null
+++ b/debuginfo-tests/nested-struct.cpp
@@ -0,0 +1,21 @@
+// RUN: %clangxx -O0 -g %s -c -o %t.o
+// RUN: %test_debuginfo %s %t.o
+// Radar 9440721
+// If debug info for my_number() is emitted outside function foo's scope
+// then a debugger may not be able to handle it. At least one version of
+// gdb crashes in such cases.
+
+// DEBUGGER: ptype foo
+// CHECK: type = int (void)
+
+int foo() {
+ struct Local {
+ static int my_number() {
+ return 42;
+ }
+ };
+
+ int i = 0;
+ i = Local::my_number();
+ return i + 1;
+}
OpenPOWER on IntegriCloud