diff options
Diffstat (limited to 'llvm/test')
-rw-r--r-- | llvm/test/DebugInfo/pr34186.ll | 10 | ||||
-rw-r--r-- | llvm/test/DebugInfo/pr34672.ll | 16 |
2 files changed, 24 insertions, 2 deletions
diff --git a/llvm/test/DebugInfo/pr34186.ll b/llvm/test/DebugInfo/pr34186.ll index 2d9c4f27877..4432a278e51 100644 --- a/llvm/test/DebugInfo/pr34186.ll +++ b/llvm/test/DebugInfo/pr34186.ll @@ -1,7 +1,13 @@ -; Make sure we reject GVs without a type and we verify each exactly once. +; Make sure we reject GVs without a type. +; Currently the verifier when traversing the graph induced by the debug info +; metadata can reach the GV both from a DICompileUnit and a DIGlobalVariable +; expression, so we emit a diagnostic twice. This is, not ideal, but the +; alternative is that of keeping a map of visited GVs, which has non trivial +; memory usage consequences on large testcases, or when LTO is the mode of +; operation. ; RUN: not llc %s 2>&1 | FileCheck %s ; CHECK: missing global variable type -; CHECK-NOT: missing global variable type +; CHECK: missing global variable type !llvm.dbg.cu = !{!2} !llvm.module.flags = !{!63, !64} diff --git a/llvm/test/DebugInfo/pr34672.ll b/llvm/test/DebugInfo/pr34672.ll new file mode 100644 index 00000000000..49be0e3351c --- /dev/null +++ b/llvm/test/DebugInfo/pr34672.ll @@ -0,0 +1,16 @@ +; RUN: not opt -verify %s 2>&1 | FileCheck %s +; CHECK: invalid type ref +; CHECK-NOT: invalid type ref + +@global = common global i32 0, align 4, !dbg !2 + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!5, !6} + +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "adrian", emissionKind: FullDebug) +!1 = !DIFile(filename: "broken.c", directory: "/") +!2 = !DIGlobalVariableExpression(var: !3, expr: !DIExpression()) +!3 = !DIGlobalVariable(name: "g", scope: !0, file: !1, line: 1, type: !1, isLocal: false, isDefinition: true) +!5 = !{i32 2, !"Dwarf Version", i32 4} +!6 = !{i32 1, !"Debug Info Version", i32 3} + |