Eric Christopher | cee313d | 2019-04-17 04:52:47 +0000 | [diff] [blame] | 1 | ; RUN: opt -S -strip-nonlinetable-debuginfo %s -o - | FileCheck %s |
| 2 | ; CHECK: define void @f() !dbg ![[F:[0-9]+]] |
| 3 | define void @f() !dbg !4 { |
| 4 | entry: |
| 5 | %i = alloca i32, align 4 |
| 6 | ; CHECK-NOT: llvm.dbg.declare |
| 7 | call void @llvm.dbg.declare(metadata i32* %i, metadata !11, metadata !13), !dbg !14 |
| 8 | store i32 42, i32* %i, align 4, !dbg !14 |
| 9 | ret void, !dbg !15 |
| 10 | } |
| 11 | |
| 12 | ; Function Attrs: nounwind readnone |
| 13 | declare void @llvm.dbg.declare(metadata, metadata, metadata) |
| 14 | |
| 15 | !llvm.dbg.cu = !{!0} |
| 16 | !llvm.module.flags = !{!7, !8, !9} |
| 17 | !llvm.ident = !{!10} |
| 18 | |
| 19 | !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "LLVM", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2) |
| 20 | !1 = !DIFile(filename: "f.c", directory: "/") |
| 21 | !2 = !{} |
| 22 | ; CHECK: ![[F]] = distinct !DISubprogram(name: "f" |
| 23 | ; CHECK-NOT: retainedNodes: |
| 24 | ; CHECK-NOT: distinct !DISubprogram(name: "f" |
| 25 | !4 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, scopeLine: 1, isOptimized: false, unit: !0, retainedNodes: !2) |
| 26 | !5 = !DISubroutineType(types: !6) |
| 27 | !6 = !{null} |
| 28 | !7 = !{i32 2, !"Dwarf Version", i32 2} |
| 29 | !8 = !{i32 2, !"Debug Info Version", i32 3} |
| 30 | !9 = !{i32 1, !"PIC Level", i32 2} |
| 31 | !10 = !{!"LLVM"} |
| 32 | !11 = !DILocalVariable(name: "i", scope: !4, file: !1, line: 1, type: !12) |
| 33 | !12 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) |
| 34 | !13 = !DIExpression() |
| 35 | !14 = !DILocation(line: 1, column: 16, scope: !4) |
| 36 | !15 = !DILocation(line: 1, column: 24, scope: !4) |