David Blaikie | 9a300bd | 2013-07-04 23:15:18 +0000 | [diff] [blame] | 1 | ; REQUIRES: object-emission |
| 2 | |
Timur Iskhodzhanov | f166f6c | 2014-01-30 01:39:17 +0000 | [diff] [blame] | 3 | ; RUN: %llc_dwarf -O0 -filetype=obj < %s > %t |
David Blaikie | 9a300bd | 2013-07-04 23:15:18 +0000 | [diff] [blame] | 4 | ; RUN: llvm-dwarfdump %t | FileCheck %s |
| 5 | |
Alp Toker | 660839f | 2014-06-19 17:15:36 +0000 | [diff] [blame] | 6 | ; Also test that the null streamer doesn't crash with debug info. |
| 7 | ; RUN: %llc_dwarf -O0 -filetype=null < %s |
| 8 | |
David Blaikie | 9a300bd | 2013-07-04 23:15:18 +0000 | [diff] [blame] | 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 | |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 18 | source_filename = "test/DebugInfo/Generic/global.ll" |
| 19 | |
David Blaikie | 9a300bd | 2013-07-04 23:15:18 +0000 | [diff] [blame] | 20 | ; Function Attrs: nounwind readnone uwtable |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 21 | define i32 @main() #0 !dbg !9 { |
David Blaikie | 9a300bd | 2013-07-04 23:15:18 +0000 | [diff] [blame] | 22 | entry: |
| 23 | ret i32 0, !dbg !12 |
| 24 | } |
| 25 | |
Bill Wendling | 187d3dd | 2013-08-22 21:28:54 +0000 | [diff] [blame] | 26 | 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" } |
David Blaikie | 9a300bd | 2013-07-04 23:15:18 +0000 | [diff] [blame] | 27 | |
| 28 | !llvm.dbg.cu = !{!0} |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 29 | !llvm.module.flags = !{!7, !8} |
David Blaikie | 9a300bd | 2013-07-04 23:15:18 +0000 | [diff] [blame] | 30 | |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 31 | !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.4 ", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !2, globals: !3, imports: !2) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 32 | !1 = !DIFile(filename: "global.cpp", directory: "/tmp") |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 33 | !2 = !{} |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 34 | !3 = !{!4} |
| 35 | !4 = !DIGlobalVariableExpression(var: !5) |
| 36 | !5 = !DIGlobalVariable(name: "i", linkageName: "_ZL1i", scope: null, file: !1, line: 1, type: !6, isLocal: true, isDefinition: true) |
| 37 | !6 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) |
| 38 | !7 = !{i32 2, !"Dwarf Version", i32 3} |
| 39 | !8 = !{i32 1, !"Debug Info Version", i32 3} |
| 40 | !9 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 2, type: !10, isLocal: false, isDefinition: true, scopeLine: 2, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !2) |
| 41 | !10 = !DISubroutineType(types: !11) |
| 42 | !11 = !{!6} |
| 43 | !12 = !DILocation(line: 4, scope: !9) |
| 44 | |