blob: 936e088722332a698ea34573551704e70e1e0a03 [file] [log] [blame]
Manman Ren94119ce2013-07-03 00:16:11 +00001; REQUIRES: object-emission
2
Timur Iskhodzhanovf166f6c2014-01-30 01:39:17 +00003; RUN: %llc_dwarf -O0 -filetype=obj < %s > %t
Manman Ren94119ce2013-07-03 00:16:11 +00004; RUN: llvm-dwarfdump %t | FileCheck %s
5
Manman Renac8062b2013-07-02 23:40:10 +00006; Make sure we are generating DWARF version 3 when module flag says so.
Manman Ren94119ce2013-07-03 00:16:11 +00007; CHECK: Compile Unit: length = {{.*}} version = 0x0003
Manman Renac8062b2013-07-02 23:40:10 +00008
Peter Collingbourned4bff302015-11-05 22:03:56 +00009define i32 @main() #0 !dbg !4 {
Manman Renac8062b2013-07-02 23:40:10 +000010entry:
11 %retval = alloca i32, align 4
12 store i32 0, i32* %retval
13 ret i32 0, !dbg !10
14}
15
Bill Wendling187d3dd2013-08-22 21:28:54 +000016attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
Manman Renac8062b2013-07-02 23:40:10 +000017
18!llvm.dbg.cu = !{!0}
Manman Ren409558f2013-11-22 21:49:45 +000019!llvm.module.flags = !{!9, !11}
Manman Renac8062b2013-07-02 23:40:10 +000020
Duncan P. N. Exon Smith55ca9642015-08-03 17:26:41 +000021!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 (trunk 185475)", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2)
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000022!1 = !DIFile(filename: "CodeGen/dwarf-version.c", directory: "test")
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000023!2 = !{}
24!3 = !{!4}
Peter Collingbourned4bff302015-11-05 22:03:56 +000025!4 = distinct !DISubprogram(name: "main", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 6, file: !1, scope: !5, type: !6, variables: !2)
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000026!5 = !DIFile(filename: "CodeGen/dwarf-version.c", directory: "test")
27!6 = !DISubroutineType(types: !7)
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000028!7 = !{!8}
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000029!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 +000030!9 = !{i32 2, !"Dwarf Version", i32 3}
Duncan P. N. Exon Smitha9308c42015-04-29 16:38:44 +000031!10 = !DILocation(line: 7, scope: !4)
Duncan P. N. Exon Smithe2741802015-03-03 17:24:31 +000032!11 = !{i32 1, !"Debug Info Version", i32 3}