1 ; REQUIRES: object-emission 2 3 ; RUN: %llc_dwarf -O0 -filetype=obj < %s > %t 4 ; RUN: llvm-dwarfdump %t | FileCheck %s 5 6 ; Also test that the null streamer doesn't crash with debug info. 7 ; RUN: %llc_dwarf -O0 -filetype=null < %s 8 9 ; generated from the following source compiled to bitcode with clang -g -O1 10 ; static int i; 11 ; int main() { 12 ; (void)&i; 13 ; } 14 15 ; CHECK: debug_info contents 16 ; CHECK: DW_TAG_variable 17 18 ; Function Attrs: nounwind readnone uwtable 19 define i32 @main() #0 !dbg !4 { 20 entry: 21 ret i32 0, !dbg !12 22 } 23 24 attributes #0 = { nounwind readnone uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" } 25 26 !llvm.dbg.cu = !{!0} 27 !llvm.module.flags = !{!11, !13} 28 29 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 ", isOptimized: true, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !9, imports: !2) 30 !1 = !DIFile(filename: "global.cpp", directory: "/tmp") 31 !2 = !{} 32 !4 = distinct !DISubprogram(name: "main", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 2, file: !1, scope: !5, type: !6, variables: !2) 33 !5 = !DIFile(filename: "global.cpp", directory: "/tmp") 34 !6 = !DISubroutineType(types: !7) 35 !7 = !{!8} 36 !8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) 37 !9 = !{!10} 38 !10 = !DIGlobalVariable(name: "i", linkageName: "_ZL1i", line: 1, isLocal: true, isDefinition: true, scope: null, file: !5, type: !8) 39 !11 = !{i32 2, !"Dwarf Version", i32 3} 40 !12 = !DILocation(line: 4, scope: !4) 41 !13 = !{i32 1, !"Debug Info Version", i32 3} 42