1 ; RUN: opt -passes=check-debugify < %s -S 2>&1 | FileCheck %s
2 ; RUN: opt --experimental-debuginfo-iterators=false -passes=check-debugify < %s -S 2>&1 | FileCheck %s
4 define void @test_phi(i1 %cond) !dbg !6 {
5 br i1 %cond, label %1, label %2, !dbg !11
11 %v = phi i32 [ 0, %0 ], [ 1, %1 ], !dbg !13
12 call void @llvm.dbg.value(metadata i32 %v, metadata !9, metadata !DIExpression()), !dbg !13
16 declare void @llvm.dbg.value(metadata, metadata, metadata)
19 !llvm.debugify = !{!3, !4}
20 !llvm.module.flags = !{!5}
22 !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "debugify", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
23 !1 = !DIFile(filename: "<stdin>", directory: "/")
27 !5 = !{i32 2, !"Debug Info Version", i32 3}
28 !6 = distinct !DISubprogram(name: "test_phi", linkageName: "test_phi", scope: null, file: !1, line: 1, type: !7, scopeLine: 1, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !8)
29 !7 = !DISubroutineType(types: !2)
31 !9 = !DILocalVariable(name: "1", scope: !6, file: !1, line: 3, type: !10)
32 !10 = !DIBasicType(name: "ty32", size: 32, encoding: DW_ATE_unsigned)
33 !11 = !DILocation(line: 1, column: 1, scope: !6)
34 !12 = !DILocation(line: 2, column: 1, scope: !6)
35 !13 = !DILocation(line: 3, column: 1, scope: !6)
36 !14 = !DILocation(line: 4, column: 1, scope: !6)
38 ; CHECK-NOT: WARNING: Missing line 3
39 ; CHECK: CheckModuleDebugify: PASS