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 {
5 %i = alloca i32, align 4
6 ; CHECK-NOT: llvm.dbg.{{addr|declare|value}}
7 call void @llvm.dbg.declare(metadata i32* %i, metadata !11, metadata !13), !dbg !14
8 call void @llvm.dbg.addr(metadata i32* %i, metadata !16, metadata !13), !dbg !14
9 store i32 42, i32* %i, align 4, !dbg !14
10 call void @llvm.dbg.value(metadata i32 0, metadata !16, metadata !13), !dbg !15
14 ; Function Attrs: nounwind readnone
15 declare void @llvm.dbg.addr(metadata, metadata, metadata)
16 declare void @llvm.dbg.declare(metadata, metadata, metadata)
17 declare void @llvm.dbg.value(metadata, metadata, metadata)
20 !llvm.module.flags = !{!7, !8, !9}
23 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "LLVM", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2)
24 !1 = !DIFile(filename: "f.c", directory: "/")
26 ; CHECK: ![[F]] = distinct !DISubprogram(name: "f"
27 ; CHECK-NOT: retainedNodes:
28 ; CHECK-NOT: distinct !DISubprogram(name: "f"
29 ; CHECK-NOT: DILocalVariable
30 !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)
31 !5 = !DISubroutineType(types: !6)
33 !7 = !{i32 2, !"Dwarf Version", i32 2}
34 !8 = !{i32 2, !"Debug Info Version", i32 3}
35 !9 = !{i32 1, !"PIC Level", i32 2}
37 !11 = !DILocalVariable(name: "i", scope: !4, file: !1, line: 1, type: !12)
38 !12 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
40 !14 = !DILocation(line: 1, column: 16, scope: !4)
41 !15 = !DILocation(line: 1, column: 24, scope: !4)
42 !16 = !DILocalVariable(name: "j", scope: !4, file: !1, line: 1, type: !12)