summaryrefslogtreecommitdiff
path: root/debuginfo-tests/dbg-arg.c
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2017-11-17 00:41:18 +0000
committerZachary Turner <zturner@google.com>2017-11-17 00:41:18 +0000
commitf630777f5ba60277ce44c6905c0fa72d0d34c6e0 (patch)
tree01384331d5a097840ddf71f243d95635de607d51 /debuginfo-tests/dbg-arg.c
parent98f78753784a6da59ea95694e230107d16c784d5 (diff)
Re-revert "Refactor debuginfo-tests"
This is still broken because it causes certain tests to be run twice with slightly different configurations, which is wrong in some cases. You can observe this by running: ninja -nv check-all | grep debuginfo-tests And seeing that it passes clang/test and clang/test/debuginfo-tests to lit, which causes it to run debuginfo-tests twice. The fix is going to involve either: a) figuring out that we're running in this "deprecated" configuration, and then deleting the clang/test/debuginfo-tests path, which should cause it to behave identically to before, or: b) make lit smart enough that it doesn't descend into a sub-suite if that sub-suite already has a lit.cfg file.
Diffstat (limited to 'debuginfo-tests/dbg-arg.c')
-rw-r--r--debuginfo-tests/dbg-arg.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/debuginfo-tests/dbg-arg.c b/debuginfo-tests/dbg-arg.c
new file mode 100644
index 00000000000..a65dc910b8b
--- /dev/null
+++ b/debuginfo-tests/dbg-arg.c
@@ -0,0 +1,46 @@
+// This test case checks debug info during register moves for an argument.
+// RUN: %clang %target_itanium_abi_host_triple -m64 -mllvm -fast-isel=false %s -c -o %t.o -g
+// RUN: %clang %target_itanium_abi_host_triple -m64 %t.o -o %t.out
+// RUN: %test_debuginfo %s %t.out
+//
+// DEBUGGER: break 26
+// DEBUGGER: r
+// DEBUGGER: print mutex
+// CHECK: ={{.* 0x[0-9A-Fa-f]+}}
+//
+// Radar 8412415
+
+struct _mtx
+{
+ long unsigned int ptr;
+ int waiters;
+ struct {
+ int tag;
+ int pad;
+ } mtxi;
+};
+
+
+int foobar(struct _mtx *mutex) {
+ int r = 1;
+ int l = 0;
+ int j = 0;
+ do {
+ if (mutex->waiters) {
+ r = 2;
+ }
+ j = bar(r, l);
+ ++l;
+ } while (l < j);
+ return r + j;
+}
+
+int bar(int i, int j) {
+ return i + j;
+}
+
+int main() {
+ struct _mtx m;
+ m.waiters = 0;
+ return foobar(&m);
+}