From: David Blaikie Date: Mon, 24 Jun 2013 06:47:30 +0000 (+0000) Subject: DebugInfo: Merge a bad debug info enum test into a good one X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a32165c74c005a229bf2493040cb5c1ff7139f23;p=clang DebugInfo: Merge a bad debug info enum test into a good one The assembly generation testing has been moved to an LLVM test case. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184693 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/CodeGen/debug-info-enum.c b/test/CodeGen/debug-info-enum.c deleted file mode 100644 index b4a1ce0d3a..0000000000 --- a/test/CodeGen/debug-info-enum.c +++ /dev/null @@ -1,11 +0,0 @@ -// RUN: %clang_cc1 -emit-llvm -g %s -o %t -// RUN: grep DW_TAG_enumeration_type %t -// Radar 8195980 - -enum vtag { - VT_ONE -}; - -int foo(int i) { - return i == VT_ONE; -} diff --git a/test/CodeGenCXX/debug-info-enum.cpp b/test/CodeGenCXX/debug-info-enum.cpp index c08fc35af5..2273580158 100644 --- a/test/CodeGenCXX/debug-info-enum.cpp +++ b/test/CodeGenCXX/debug-info-enum.cpp @@ -1,8 +1,25 @@ -// 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]*]]} + +namespace test1 { +// CHECK: [[E1]] = metadata !{i32 {{[^,]*}}, {{[^,]*}}, metadata [[TEST1:![0-9]*]], {{.*}}, metadata [[TEST1_ENUMS:![0-9]*]], {{[^,]*}}, {{[^,]*}}} ; [ 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]], {{[^,]*}}, {{[^,]*}}} ; [ DW_TAG_enumeration_type ] [e] +// CHECK: [[TEST2]] = {{.*}} ; [ DW_TAG_namespace ] [test2] +enum e { E }; +bool func(int i) { + return i == E; +} }