r213211 - DebugInfo: Ensure the ASTConsumer "HandleTagDeclRequireDefinition" callback path is tested.
David Blaikie
dblaikie at gmail.com
Wed Jul 16 16:25:44 PDT 2014
Author: dblaikie
Date: Wed Jul 16 18:25:44 2014
New Revision: 213211
URL: http://llvm.org/viewvc/llvm-project?rev=213211&view=rev
Log:
DebugInfo: Ensure the ASTConsumer "HandleTagDeclRequireDefinition" callback path is tested.
By having the two variables 'a' and 'b' in this test in a namespace, the
type was required to be complete before any debug info was ever emitted
(the entire namespace is parsed before the variables were emitted), this
meant that the codepath in which a declaration is emitted, then later on
the type is required to be complete and the debug info must be upgraded
to a definition was not used.
Moving the variables outside a namespace fixes this test coverage bug.
(interestingly, code coverage didn't help here -
HandleTagDeclRequireDefinition is fully covered because it's called even
in cases where the type hasn't been emitted for debug info at all
(further down in CGDebugInfo this no-ops) - so CC wouldn't've helped
catch this test coverage problem)
Modified:
cfe/trunk/test/CodeGenCXX/debug-info-class-limited.cpp
Modified: cfe/trunk/test/CodeGenCXX/debug-info-class-limited.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-class-limited.cpp?rev=213211&r1=213210&r2=213211&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/debug-info-class-limited.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/debug-info-class-limited.cpp Wed Jul 16 18:25:44 2014
@@ -1,17 +1,15 @@
// RUN: %clang_cc1 -emit-llvm -fno-standalone-debug -g -o - %s | FileCheck %s
// RUN: %clang_cc1 -emit-llvm -fno-standalone-debug -g -o - -load %llvmshlibdir/PrintFunctionNames%pluginext %s 2>&1 | FileCheck %s
-namespace PR16214_1 {
-// CHECK-DAG: [ DW_TAG_structure_type ] [foo] [line [[@LINE+1]], {{.*}} [def]
-struct foo {
+// CHECK-DAG: [ DW_TAG_structure_type ] [PR16214] [line [[@LINE+1]], {{.*}} [def]
+struct PR16214 {
int i;
};
-typedef foo bar;
+typedef PR16214 bar;
bar *a;
bar b;
-}
namespace PR14467 {
// CHECK-DAG: [ DW_TAG_structure_type ] [foo] [line [[@LINE+1]], {{.*}} [def]
More information about the cfe-commits
mailing list