summaryrefslogtreecommitdiffstats
path: root/test/CodeGenCXX/debug-info-enum.cpp
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2013-12-22 00:07:40 +0000
committerdim <dim@FreeBSD.org>2013-12-22 00:07:40 +0000
commit952eddef9aff85b1e92626e89baaf7a360e2ac85 (patch)
treedf8df0b0067b381eab470a3b8f28d14a552a6340 /test/CodeGenCXX/debug-info-enum.cpp
parentea266cad53e3d49771fa38103913d3ec7a166694 (diff)
downloadFreeBSD-src-952eddef9aff85b1e92626e89baaf7a360e2ac85.zip
FreeBSD-src-952eddef9aff85b1e92626e89baaf7a360e2ac85.tar.gz
Vendor import of clang release_34 branch r197841 (effectively, 3.4 RC3):
https://llvm.org/svn/llvm-project/cfe/branches/release_34@197841
Diffstat (limited to 'test/CodeGenCXX/debug-info-enum.cpp')
-rw-r--r--test/CodeGenCXX/debug-info-enum.cpp40
1 files changed, 34 insertions, 6 deletions
diff --git a/test/CodeGenCXX/debug-info-enum.cpp b/test/CodeGenCXX/debug-info-enum.cpp
index c08fc35..f0e2608 100644
--- a/test/CodeGenCXX/debug-info-enum.cpp
+++ b/test/CodeGenCXX/debug-info-enum.cpp
@@ -1,8 +1,36 @@
-// RUN: %clang -fverbose-asm -S -g %s -o - | grep DW_TAG_enumeration_type
+// RUN: %clang_cc1 -emit-llvm -g %s -o - | FileCheck %s
-int v;
-enum index { MAX };
-void foo(void)
-{
- v = MAX;
+// CHECK: [[ENUMS:![0-9]*]], {{[^,]*}}, {{[^,]*}}, {{[^,]*}}, {{[^,]*}}, {{[^,]*}}} ; [ DW_TAG_compile_unit ]
+// CHECK: [[ENUMS]] = metadata !{metadata [[E1:![0-9]*]], metadata [[E2:![0-9]*]], metadata [[E3:![0-9]*]]}
+
+namespace test1 {
+// CHECK: [[E1]] = metadata !{i32 {{[^,]*}}, {{[^,]*}}, metadata [[TEST1:![0-9]*]], {{.*}}, metadata [[TEST1_ENUMS:![0-9]*]], {{[^,]*}}, null, null, metadata !"_ZTSN5test11eE"} ; [ DW_TAG_enumeration_type ] [e]
+// CHECK: [[TEST1]] = {{.*}} ; [ DW_TAG_namespace ] [test1]
+// CHECK: [[TEST1_ENUMS]] = metadata !{metadata [[TEST1_E:![0-9]*]]}
+// CHECK: [[TEST1_E]] = {{.*}}, metadata !"E", i64 0} ; [ DW_TAG_enumerator ] [E :: 0]
+enum e { E };
+void foo() {
+ int v = E;
+}
+}
+
+namespace test2 {
+// rdar://8195980
+// CHECK: [[E2]] = metadata !{i32 {{[^,]*}}, {{[^,]*}}, metadata [[TEST2:![0-9]*]], {{.*}}, metadata [[TEST1_ENUMS]], {{[^,]*}}, null, null, metadata !"_ZTSN5test21eE"} ; [ DW_TAG_enumeration_type ] [e]
+// CHECK: [[TEST2]] = {{.*}} ; [ DW_TAG_namespace ] [test2]
+enum e { E };
+bool func(int i) {
+ return i == E;
+}
+}
+
+namespace test3 {
+// CHECK: [[E3]] = metadata !{i32 {{[^,]*}}, {{[^,]*}}, metadata [[TEST3:![0-9]*]], {{.*}}, metadata [[TEST3_ENUMS:![0-9]*]], {{[^,]*}}, null, null, metadata !"_ZTSN5test31eE"} ; [ DW_TAG_enumeration_type ] [e]
+// CHECK: [[TEST3]] = {{.*}} ; [ DW_TAG_namespace ] [test3]
+// CHECK: [[TEST3_ENUMS]] = metadata !{metadata [[TEST3_E:![0-9]*]]}
+// CHECK: [[TEST3_E]] = {{.*}}, metadata !"E", i64 -1} ; [ DW_TAG_enumerator ] [E :: -1]
+enum e { E = -1 };
+void func() {
+ e x;
+}
}
OpenPOWER on IntegriCloud