summaryrefslogtreecommitdiffstats
path: root/debuginfo-tests
diff options
context:
space:
mode:
authorAmy Huang <akhuang@google.com>2019-06-06 20:23:05 +0000
committerAmy Huang <akhuang@google.com>2019-06-06 20:23:05 +0000
commit980d3645df4509ad6e46737a41637427f254e501 (patch)
tree7fcecea2bbff5eba01d348c9a7ad2b85cc9594e0 /debuginfo-tests
parent6a573e3ec3ead4266e9f1092033295f9bb402955 (diff)
downloadbcm5719-llvm-980d3645df4509ad6e46737a41637427f254e501.tar.gz
bcm5719-llvm-980d3645df4509ad6e46737a41637427f254e501.zip
Add cdb test for global constants
Summary: This creates an integration test for global constants Reviewers: rnk Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62974 llvm-svn: 362745
Diffstat (limited to 'debuginfo-tests')
-rw-r--r--debuginfo-tests/win_cdb/global-constant.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/debuginfo-tests/win_cdb/global-constant.cpp b/debuginfo-tests/win_cdb/global-constant.cpp
new file mode 100644
index 00000000000..57423bc9b24
--- /dev/null
+++ b/debuginfo-tests/win_cdb/global-constant.cpp
@@ -0,0 +1,33 @@
+// RUN: %clang_cl %s -o %t.exe -fuse-ld=lld -Z7
+// RUN: grep DE[B]UGGER: %s | sed -e 's/.*DE[B]UGGER: //' > %t.script
+// RUN: %cdb -cf %t.script %t.exe | FileCheck %s --check-prefixes=DEBUGGER,CHECK
+
+// Check that global constants have debug info.
+
+const float TestPi = 3.14;
+struct S {
+ static const char TestCharA = 'a';
+};
+enum TestEnum : int {
+ ENUM_POS = 2147000000,
+ ENUM_NEG = -2147000000,
+};
+void useConst(int) {}
+int main() {
+ useConst(TestPi);
+ useConst(S::TestCharA);
+ useConst(ENUM_NEG);
+ // DEBUGGER: g
+ // DEBUGGER: ?? TestPi
+ // CHECK: float 3.140000105
+ // DEBUGGER: ?? S::TestCharA
+ // CHECK: char 0n97 'a'
+ // DEBUGGER: ?? ENUM_NEG
+ // CHECK: TestEnum ENUM_NEG (0n-2147000000)
+ // Unused constants shouldn't show up in the globals stream.
+ // DEBUGGER: ?? ENUM_POS
+ // CHECK: Couldn't resolve error at 'ENUM_POS'
+ // DEBUGGER: q
+ __debugbreak();
+ return 0;
+}
OpenPOWER on IntegriCloud