summaryrefslogtreecommitdiffstats
path: root/test/CodeGenCXX/debug-info-enum-class.cpp
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2016-03-25 00:20:35 +0000
committerAdrian Prantl <aprantl@apple.com>2016-03-25 00:20:35 +0000
commit3fc669a306285df6d5dbc0f9bd98eeb5809f84a3 (patch)
treefceb8870b6e9ec550ebaaadfa4dbf6717c2fe67f /test/CodeGenCXX/debug-info-enum-class.cpp
parent04ef11f7ddbf05932ce586ca70ff0a85990fc02d (diff)
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> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@264366 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/debug-info-enum-class.cpp')
-rw-r--r--test/CodeGenCXX/debug-info-enum-class.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/CodeGenCXX/debug-info-enum-class.cpp b/test/CodeGenCXX/debug-info-enum-class.cpp
index 71e6e2b257..70c57d6cb7 100644
--- a/test/CodeGenCXX/debug-info-enum-class.cpp
+++ b/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]+]]