Files
clang-p2996/clang/test/CodeGen/debug-info-enum.c
David Blaikie 483a9da598 Reapply: DebugInfo: Emit the definition of enums when the definition preceeds the declaration and initial use.
Reverting r208106 to reapply r208065 with a fix for the regression. The
issue was that the enum tried to be built even if the declaration hadn't
been constructed for debug info - presenting problems for enum templates
and typedefs of enums with names for linkage purposes.

Original commit message:

This regressed a little further 208055 though it was already a little
broken.

While the requiresCompleteType optimization should be implemented here.
Future (possibly near future) work.

llvm-svn: 208114
2014-05-06 18:35:21 +00:00

11 lines
375 B
C

// RUN: %clang_cc1 -emit-llvm -g %s -o - | FileCheck %s
// CHECK: metadata [[TEST3_ENUMS:![0-9]*]], {{[^,]*}}, null, null, null} ; [ DW_TAG_enumeration_type ] [e]
// CHECK: [[TEST3_ENUMS]] = metadata !{metadata [[TEST3_E:![0-9]*]]}
// CHECK: [[TEST3_E]] = {{.*}}, metadata !"E", i64 -1} ; [ DW_TAG_enumerator ] [E :: -1]
enum e;
void func(enum e *p) {
}
enum e { E = -1 };