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>

llvm-svn: 264366
This commit is contained in:
Adrian Prantl 2016-03-25 00:20:35 +00:00
parent 9f7e2d7657
commit 53058380bb
1 changed files with 6 additions and 0 deletions

View File

@ -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 class B: unsigned long { B1=1 }; // underlying type is unsigned long
enum C { C1 = 1 }; enum C { C1 = 1 };
enum D : short; // enum forward declaration enum D : short; // enum forward declaration
enum Z : int;
A a; A a;
B b; B b;
C c; C c;
@ -94,6 +95,11 @@ void f2(E) {
// CHECK-NOT: offset: // CHECK-NOT: offset:
// CHECK-SAME: flags: DIFlagFwdDecl // 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 { namespace test5 {
// CHECK: !DICompositeType(tag: DW_TAG_enumeration_type, name: "E" // CHECK: !DICompositeType(tag: DW_TAG_enumeration_type, name: "E"
// CHECK-SAME: scope: [[TEST5:![0-9]+]] // CHECK-SAME: scope: [[TEST5:![0-9]+]]