[debuginfo-tests] afc44ef - [debuginfo-tests][dexter] Add two new debug experience tests

Tom Weaver via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 28 07:23:49 PDT 2020


Author: Nabeel Omer
Date: 2020-10-28T14:21:40Z
New Revision: afc44efc262b27e8d6cdcf86d40a820ecd450520

URL: https://github.com/llvm/llvm-project/commit/afc44efc262b27e8d6cdcf86d40a820ecd450520
DIFF: https://github.com/llvm/llvm-project/commit/afc44efc262b27e8d6cdcf86d40a820ecd450520.diff

LOG: [debuginfo-tests][dexter] Add two new debug experience tests

deferred_globals.cpp: Verify that debug information for a local variable does
not hide a global definition that has the same name

namespace.cpp: Ensure that the debug information for a global variable
includes namespace information.

Differential Revision: https://reviews.llvm.org/D89462

Author:    Nabeel Omer <nabeel.omer at sony.com>

Added: 
    debuginfo-tests/dexter-tests/deferred_globals.cpp
    debuginfo-tests/dexter-tests/namespace.cpp

Modified: 
    

Removed: 
    


################################################################################
diff  --git a/debuginfo-tests/dexter-tests/deferred_globals.cpp b/debuginfo-tests/dexter-tests/deferred_globals.cpp
new file mode 100644
index 000000000000..d12adfd14b09
--- /dev/null
+++ b/debuginfo-tests/dexter-tests/deferred_globals.cpp
@@ -0,0 +1,28 @@
+// Purpose:
+// Ensure that debug information for a local variable does not hide
+// a global definition that has the same name.
+
+// UNSUPPORTED: system-windows
+
+// RUN: %dexter --fail-lt 1.0 -w \
+// RUN:     --builder 'clang' --debugger 'lldb' \
+// RUN:     --cflags "-g -O0" -v -- %s
+
+const int d = 100;
+
+extern int foo();
+
+int main() {
+  const int d = 4;
+  const float e = 4; // DexLabel("main")
+  const char *f = "Woopy";
+  return d + foo();
+}
+
+int foo() {
+  return d; // DexLabel("foo")
+}
+
+// DexExpectWatchValue('d', '4', on_line='main')
+// DexExpectWatchValue('d', '100', on_line='foo')
+

diff  --git a/debuginfo-tests/dexter-tests/namespace.cpp b/debuginfo-tests/dexter-tests/namespace.cpp
new file mode 100644
index 000000000000..e614b0d283b1
--- /dev/null
+++ b/debuginfo-tests/dexter-tests/namespace.cpp
@@ -0,0 +1,23 @@
+// Purpose:
+// Ensure that the debug information for a global variable includes
+// namespace information.
+
+// UNSUPPORTED: system-windows
+
+// RUN: %dexter --fail-lt 1.0 -w \
+// RUN:     --builder 'clang' --debugger 'lldb' \
+// RUN:     --cflags "-g -O0" -v -- %s
+
+#include <stdio.h>
+
+namespace monkey {
+const int ape = 32;
+}
+
+int main() {
+  printf("hello %d\n", monkey::ape); // DexLabel('main')
+  return 0;
+}
+
+// DexExpectWatchValue('monkey::ape', 32, on_line='main')
+


        


More information about the llvm-commits mailing list