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. 8!typerefs = !{!1, !2, !3, !4} 9!1 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 32, align: 32, baseType: !8) 10!2 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 32, align: 32, baseType: !"2.bad") 11!3 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 32, align: 32, baseType: !9) 12!4 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 32, align: 32, baseType: !"4.bad") 13 14; Add a minimal compile unit to resolve some of the type references. 15!llvm.dbg.cu = !{!5} 16!5 = distinct !DICompileUnit(file: !6, language: DW_LANG_C99, retainedTypes: !7) 17!6 = !DIFile(filename: "file.c", directory: "/path/to/dir") 18!7 = !{!8, !9} 19!8 = !DICompositeType(tag: DW_TAG_structure_type, identifier: "1.good") 20!9 = !DICompositeType(tag: DW_TAG_structure_type, identifier: "3.good") 21 22; CHECK: assembly parsed, but does not verify 23; CHECK-NEXT: invalid base type 24; CHECK-NEXT: !DIDerivedType(tag: DW_TAG_pointer_type 25; CHECK-SAME: baseType: !"2.bad" 26; CHECK-NEXT: !"2.bad" 27; CHECK-NEXT: invalid base type 28; CHECK-NEXT: !DIDerivedType(tag: DW_TAG_pointer_type 29; CHECK-SAME: baseType: !"4.bad" 30; CHECK-NEXT: !"4.bad" 31; CHECK-NOT: invalid 32