2014-01-15 03:35:09 +08:00
|
|
|
// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm -g %s -o - | FileCheck %s
|
2010-08-11 04:01:51 +08:00
|
|
|
|
2014-10-04 04:01:52 +08:00
|
|
|
// CHECK: metadata !"0x11\00{{.*}}", {{[^,]*}}, metadata [[ENUMS:![0-9]*]], {{.*}}} ; [ DW_TAG_compile_unit ]
|
2013-06-24 15:13:13 +08:00
|
|
|
// CHECK: [[ENUMS]] = metadata !{metadata [[E1:![0-9]*]], metadata [[E2:![0-9]*]], metadata [[E3:![0-9]*]]}
|
2013-06-24 14:47:30 +08:00
|
|
|
|
|
|
|
namespace test1 {
|
2014-10-04 04:01:52 +08:00
|
|
|
// CHECK: [[E1]] = metadata !{metadata !"0x4\00{{.*}}", {{[^,]*}}, metadata [[TEST1:![0-9]*]], {{.*}}, metadata [[TEST1_ENUMS:![0-9]*]], null, null, metadata !"_ZTSN5test11eE"} ; [ DW_TAG_enumeration_type ] [e]
|
2013-06-24 14:47:30 +08:00
|
|
|
// CHECK: [[TEST1]] = {{.*}} ; [ DW_TAG_namespace ] [test1]
|
|
|
|
// CHECK: [[TEST1_ENUMS]] = metadata !{metadata [[TEST1_E:![0-9]*]]}
|
2014-10-04 04:01:52 +08:00
|
|
|
// CHECK: [[TEST1_E]] = metadata !{metadata !"0x28\00E\000"} ; [ DW_TAG_enumerator ] [E :: 0]
|
2013-06-24 14:47:30 +08:00
|
|
|
enum e { E };
|
|
|
|
void foo() {
|
|
|
|
int v = E;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace test2 {
|
|
|
|
// rdar://8195980
|
2014-10-04 04:01:52 +08:00
|
|
|
// CHECK: [[E2]] = metadata !{metadata !"0x4\00{{.*}}", {{[^,]*}}, metadata [[TEST2:![0-9]*]], {{.*}}, metadata [[TEST1_ENUMS]], null, null, metadata !"_ZTSN5test21eE"} ; [ DW_TAG_enumeration_type ] [e]
|
2013-06-24 14:47:30 +08:00
|
|
|
// CHECK: [[TEST2]] = {{.*}} ; [ DW_TAG_namespace ] [test2]
|
|
|
|
enum e { E };
|
|
|
|
bool func(int i) {
|
|
|
|
return i == E;
|
|
|
|
}
|
2010-08-11 04:01:51 +08:00
|
|
|
}
|
2013-06-24 15:13:13 +08:00
|
|
|
|
|
|
|
namespace test3 {
|
2014-10-04 04:01:52 +08:00
|
|
|
// CHECK: [[E3]] = metadata !{metadata !"0x4\00{{.*}}", {{[^,]*}}, metadata [[TEST3:![0-9]*]], {{.*}}, metadata [[TEST3_ENUMS:![0-9]*]], null, null, metadata !"_ZTSN5test31eE"} ; [ DW_TAG_enumeration_type ] [e]
|
2013-06-24 15:13:13 +08:00
|
|
|
// CHECK: [[TEST3]] = {{.*}} ; [ DW_TAG_namespace ] [test3]
|
|
|
|
// CHECK: [[TEST3_ENUMS]] = metadata !{metadata [[TEST3_E:![0-9]*]]}
|
2014-10-04 04:01:52 +08:00
|
|
|
// CHECK: [[TEST3_E]] = metadata !{metadata !"0x28\00E\00-1"} ; [ DW_TAG_enumerator ] [E :: -1]
|
2013-06-24 15:13:13 +08:00
|
|
|
enum e { E = -1 };
|
|
|
|
void func() {
|
|
|
|
e x;
|
|
|
|
}
|
|
|
|
}
|
2014-05-07 02:35:21 +08:00
|
|
|
|
|
|
|
namespace test4 {
|
|
|
|
// Don't try to build debug info for a dependent enum.
|
|
|
|
// CHECK-NOT: test4
|
|
|
|
template <typename T>
|
|
|
|
struct S {
|
|
|
|
enum e { E = T::v };
|
|
|
|
};
|
|
|
|
}
|