aboutsummaryrefslogtreecommitdiff
path: root/clang/test/CodeGenCXX/debug-info-nodebug.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/CodeGenCXX/debug-info-nodebug.cpp')
-rw-r--r--clang/test/CodeGenCXX/debug-info-nodebug.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/clang/test/CodeGenCXX/debug-info-nodebug.cpp b/clang/test/CodeGenCXX/debug-info-nodebug.cpp
index f4cab63..7a10e67 100644
--- a/clang/test/CodeGenCXX/debug-info-nodebug.cpp
+++ b/clang/test/CodeGenCXX/debug-info-nodebug.cpp
@@ -27,12 +27,18 @@ NODEBUG S1 global_struct = { 2, 3 };
// NOINFO-NOT: !DIGlobalVariable(name: "global_struct"
// Static data members. Const member needs a use.
+// Also the class as a whole needs a use, so that we produce debug info for
+// the entire class (iterating over the members, demonstrably skipping those
+// with 'nodebug').
struct S2 {
NODEBUG static int static_member;
NODEBUG static const int static_const_member = 4;
};
int S2::static_member = 5;
-void func3() { func1(S2::static_const_member); }
+void func3() {
+ S2 junk;
+ func1(S2::static_const_member);
+}
// YESINFO-DAG: !DIGlobalVariable(name: "static_member"
// NOINFO-NOT: !DIGlobalVariable(name: "static_member"
// YESINFO-DAG: !DIDerivedType({{.*}} name: "static_const_member"