[debuginfo-tests] r303903 - Add a test for PR33166.

Adrian Prantl via llvm-commits llvm-commits at lists.llvm.org
Thu May 25 12:33:17 PDT 2017


Author: adrian
Date: Thu May 25 14:33:16 2017
New Revision: 303903

URL: http://llvm.org/viewvc/llvm-project?rev=303903&view=rev
Log:
Add a test for PR33166.

This tests optimized code where a variable is allocated on the
stack for some part of the function.

Added:
    debuginfo-tests/trunk/stack-var.c

Added: debuginfo-tests/trunk/stack-var.c
URL: http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/stack-var.c?rev=303903&view=auto
==============================================================================
--- debuginfo-tests/trunk/stack-var.c (added)
+++ debuginfo-tests/trunk/stack-var.c Thu May 25 14:33:16 2017
@@ -0,0 +1,18 @@
+// RUN: %clang %target_itanium_abi_host_triple %s -O -o %t.out -g
+// RUN: %test_debuginfo %s %t.out
+
+void __attribute__((noinline)) bar(int *test) {}
+int main() {
+  int test;
+  test = 23;
+  // DEBUGGER: break 12
+  // DEBUGGER: r
+  // DEBUGGER: p test
+  // CHECK: 23
+  bar(&test);
+  // DEBUGGER: break 17
+  // DEBUGGER: c
+  // DEBUGGER: p test
+  // CHECK: 23
+  return test;
+}




More information about the llvm-commits mailing list