aboutsummaryrefslogtreecommitdiff
path: root/debuginfo-tests/nrvo-string.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2017-11-13 23:33:29 +0000
committerZachary Turner <zturner@google.com>2017-11-13 23:33:29 +0000
commitfaf04a09f69c07f66c81167f5875518102675911 (patch)
tree289bff38c8b4e334dd6007b6d99e82798e905465 /debuginfo-tests/nrvo-string.cpp
parent8c42d323c9100b234df7f7d790eccda4954884f0 (diff)
downloadllvm-faf04a09f69c07f66c81167f5875518102675911.zip
llvm-faf04a09f69c07f66c81167f5875518102675911.tar.gz
llvm-faf04a09f69c07f66c81167f5875518102675911.tar.bz2
Revert "Update test_debuginfo.pl script to point to new tree location."
This reverts the aforementioned patch and 2 subsequent follow-ups, as some buildbots are still failing 2 tests because of it. Investigation is ongoing into the cause of the failures. llvm-svn: 318112
Diffstat (limited to 'debuginfo-tests/nrvo-string.cpp')
-rw-r--r--debuginfo-tests/nrvo-string.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/debuginfo-tests/nrvo-string.cpp b/debuginfo-tests/nrvo-string.cpp
new file mode 100644
index 0000000..18acebb
--- /dev/null
+++ b/debuginfo-tests/nrvo-string.cpp
@@ -0,0 +1,27 @@
+// This ensures that DW_OP_deref is inserted when necessary, such as when NRVO
+// of a string object occurs in C++.
+//
+// RUN: %clangxx -O0 -fno-exceptions %target_itanium_abi_host_triple %s -o %t.out -g
+// RUN: %test_debuginfo %s %t.out
+// RUN: %clangxx -O1 -fno-exceptions %target_itanium_abi_host_triple %s -o %t.out -g
+// RUN: %test_debuginfo %s %t.out
+//
+// PR34513
+
+struct string {
+ string() {}
+ string(int i) : i(i) {}
+ ~string() {}
+ int i = 0;
+};
+string get_string() {
+ string unused;
+ string result = 3;
+// DEBUGGER: break 21
+ return result;
+}
+int main() { get_string(); }
+
+// DEBUGGER: r
+// DEBUGGER: print result.i
+// CHECK: = 3