From 53058380bb03394b9ee2e4f9f6ab43f5270fc6fa Mon Sep 17 00:00:00 2001 From: Adrian Prantl Date: Fri, 25 Mar 2016 00:20:35 +0000 Subject: [PATCH] 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. llvm-svn: 264366 --- clang/test/CodeGenCXX/debug-info-enum-class.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/clang/test/CodeGenCXX/debug-info-enum-class.cpp b/clang/test/CodeGenCXX/debug-info-enum-class.cpp index 71e6e2b..70c57d6 100644 --- a/clang/test/CodeGenCXX/debug-info-enum-class.cpp +++ b/clang/test/CodeGenCXX/debug-info-enum-class.cpp @@ -4,6 +4,7 @@ enum class A { A1=1 }; // underlying type is int by default 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]+]] -- 2.7.4