David Blaikie | 2f04011 | 2014-07-25 16:10:16 +0000 | [diff] [blame] | 1 | ; REQUIRES: object-emission |
| 2 | |
| 3 | ; RUN: %llc_dwarf < %s -filetype=obj | llvm-dwarfdump -debug-dump=info - | FileCheck %s |
| 4 | |
| 5 | ; Test that a nodebug function (a function not appearing in the debug info IR |
| 6 | ; metadata subprogram list) with DebugLocs on its IR doesn't cause crashes/does |
| 7 | ; the right thing. |
| 8 | |
| 9 | ; Build with clang from the following: |
| 10 | ; extern int i; |
| 11 | ; inline __attribute__((always_inline)) void f1() { |
| 12 | ; i = 3; |
| 13 | ; } |
| 14 | ; |
| 15 | ; __attribute__((nodebug)) void f2() { |
| 16 | ; f1(); |
| 17 | ; } |
| 18 | |
| 19 | ; Check that there's only one DW_TAG_subprogram, nothing for the 'f2' function. |
| 20 | ; CHECK: DW_TAG_subprogram |
| 21 | ; CHECK-NOT: DW_TAG |
| 22 | ; CHECK: DW_AT_name {{.*}} "f1" |
| 23 | ; CHECK-NOT: DW_TAG_subprogram |
| 24 | |
| 25 | @i = external global i32 |
| 26 | |
| 27 | ; Function Attrs: uwtable |
| 28 | define void @_Z2f2v() #0 { |
| 29 | entry: |
| 30 | store i32 3, i32* @i, align 4, !dbg !11 |
| 31 | ret void |
| 32 | } |
| 33 | |
| 34 | attributes #0 = { 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" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } |
| 35 | |
| 36 | !llvm.dbg.cu = !{!0} |
| 37 | !llvm.module.flags = !{!8, !9} |
| 38 | !llvm.ident = !{!10} |
| 39 | |
Duncan P. N. Exon Smith | 55ca964 | 2015-08-03 17:26:41 +0000 | [diff] [blame] | 40 | !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 41 | !1 = !DIFile(filename: "nodebug.cpp", directory: "/tmp/dbginfo") |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 42 | !2 = !{} |
| 43 | !3 = !{!4} |
Duncan P. N. Exon Smith | 814b8e9 | 2015-08-28 20:26:49 +0000 | [diff] [blame] | 44 | !4 = distinct !DISubprogram(name: "f1", linkageName: "_Z2f1v", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !1, scope: !5, type: !6, variables: !2) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 45 | !5 = !DIFile(filename: "nodebug.cpp", directory: "/tmp/dbginfo") |
| 46 | !6 = !DISubroutineType(types: !7) |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 47 | !7 = !{null} |
| 48 | !8 = !{i32 2, !"Dwarf Version", i32 4} |
Duncan P. N. Exon Smith | e274180 | 2015-03-03 17:24:31 +0000 | [diff] [blame] | 49 | !9 = !{i32 2, !"Debug Info Version", i32 3} |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 50 | !10 = !{!"clang version 3.5.0 "} |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 51 | !11 = !DILocation(line: 3, scope: !4) |