1; RUN: not llvm-as -disable-output <%s 2>&1 | FileCheck %s 2; Check that the debug info verifier gives nice errors for bad type refs 3; (rather than crashing). 4!llvm.module.flags = !{!0} 5!0 = !{i32 2, !"Debug Info Version", i32 3} 6 7; Make a bunch of type references. Note that !4 references !"0.bad" (instead 8; of !"4.bad") to test error ordering. 9!typerefs = !{!1, !2, !3, !4} 10!1 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 32, align: 32, baseType: !"1.good") 11!2 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 32, align: 32, baseType: !"2.bad") 12!3 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 32, align: 32, baseType: !"3.good") 13!4 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 32, align: 32, baseType: !"0.bad") 14 15; Add a minimal compile unit to resolve some of the type references. 16!llvm.dbg.cu = !{!5} 17!5 = distinct !DICompileUnit(file: !6, language: DW_LANG_C99, retainedTypes: !7) 18!6 = !DIFile(filename: "file.c", directory: "/path/to/dir") 19!7 = !{!8, !9} 20!8 = !DICompositeType(tag: DW_TAG_structure_type, identifier: "1.good") 21!9 = !DICompositeType(tag: DW_TAG_structure_type, identifier: "3.good") 22 23; CHECK: assembly parsed, but does not verify 24; CHECK-NEXT: unresolved type ref 25; CHECK-NEXT: !"0.bad" 26; CHECK-NEXT: !DIDerivedType(tag: DW_TAG_pointer_type 27; CHECK-SAME: baseType: !"0.bad" 28; CHECK-NEXT: unresolved type ref 29; CHECK-NEXT: !"2.bad" 30; CHECK-NEXT: !DIDerivedType(tag: DW_TAG_pointer_type 31; CHECK-SAME: baseType: !"2.bad" 32; CHECK-NOT: unresolved 33