blob: 6cac9a2de05e3a74bb8370570af4f0be14d1776f [file] [log] [blame]
David Blaikie9a300bd2013-07-04 23:15:18 +00001; REQUIRES: object-emission
2
Timur Iskhodzhanovf166f6c2014-01-30 01:39:17 +00003; RUN: %llc_dwarf -O0 -filetype=obj < %s > %t
David Blaikie9a300bd2013-07-04 23:15:18 +00004; RUN: llvm-dwarfdump %t | FileCheck %s
5
Alp Toker660839f2014-06-19 17:15:36 +00006; Also test that the null streamer doesn't crash with debug info.
7; RUN: %llc_dwarf -O0 -filetype=null < %s
8
David Blaikie9a300bd2013-07-04 23:15:18 +00009; 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
Peter Collingbourned4bff302015-11-05 22:03:56 +000019define i32 @main() #0 !dbg !4 {
David Blaikie9a300bd2013-07-04 23:15:18 +000020entry:
21 ret i32 0, !dbg !12
22}
23
Bill Wendling187d3dd2013-08-22 21:28:54 +000024attributes #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" }
David Blaikie9a300bd2013-07-04 23:15:18 +000025
26!llvm.dbg.cu = !{!0}
Manman Ren409558f2013-11-22 21:49:45 +000027!llvm.module.flags = !{!11, !13}
David Blaikie9a300bd2013-07-04 23:15:18 +000028
Duncan P. N. Exon Smith55ca9642015-08-03 17:26:41 +000029!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 ", isOptimized: true, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !9, imports: !2)
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000030!1 = !DIFile(filename: "global.cpp", directory: "/tmp")
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000031!2 = !{}
32!3 = !{!4}
Peter Collingbourned4bff302015-11-05 22:03:56 +000033!4 = distinct !DISubprogram(name: "main", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 2, file: !1, scope: !5, type: !6, variables: !2)
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000034!5 = !DIFile(filename: "global.cpp", directory: "/tmp")
35!6 = !DISubroutineType(types: !7)
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000036!7 = !{!8}
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000037!8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000038!9 = !{!10}
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000039!10 = !DIGlobalVariable(name: "i", linkageName: "_ZL1i", line: 1, isLocal: true, isDefinition: true, scope: null, file: !5, type: !8)
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000040!11 = !{i32 2, !"Dwarf Version", i32 3}
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000041!12 = !DILocation(line: 4, scope: !4)
Duncan P. N. Exon Smithe2741802015-03-03 17:24:31 +000042!13 = !{i32 1, !"Debug Info Version", i32 3}