r264366 - Debug Info: Add a testcase for the bug introduced by r259975.

Adrian Prantl via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 24 17:20:35 PDT 2016


Author: adrian
Date: Thu Mar 24 19:20:35 2016
New Revision: 264366

URL: http://llvm.org/viewvc/llvm-project?rev=264366&view=rev
Log:
Debug Info: Add a testcase for the bug introduced by r259975.
In r259975 we rauw'ed the scope of enum declarations without taking into
account that DIBuilder strips out scope references that point to the
DICompileUnit to facilitate type uniquing.

This testcase guards against making the same mistake again.
<rdar://problem/25078246>

Modified:
    cfe/trunk/test/CodeGenCXX/debug-info-enum-class.cpp

Modified: cfe/trunk/test/CodeGenCXX/debug-info-enum-class.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/debug-info-enum-class.cpp?rev=264366&r1=264365&r2=264366&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/debug-info-enum-class.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/debug-info-enum-class.cpp Thu Mar 24 19:20:35 2016
@@ -4,6 +4,7 @@ enum class A { A1=1 };                 /
 enum class B: unsigned long { B1=1 };  // underlying type is unsigned long
 enum C { C1 = 1 };
 enum D : short; // enum forward declaration
+enum Z : int;
 A a;
 B b;
 C c;
@@ -94,6 +95,11 @@ void f2(E) {
 // CHECK-NOT:              offset:
 // CHECK-SAME:             flags: DIFlagFwdDecl
 
+// CHECK: !DICompositeType(tag: DW_TAG_enumeration_type, name: "Z"
+// CHECK-NOT:              scope:
+// CHECK-SAME:             flags: DIFlagFwdDecl
+void fz() { Z z; }
+
 namespace test5 {
 // CHECK: !DICompositeType(tag: DW_TAG_enumeration_type, name: "E"
 // CHECK-SAME:             scope: [[TEST5:![0-9]+]]




More information about the cfe-commits mailing list