1 ; RUN: opt < %s -mem2reg -S | FileCheck %s
2 source_filename = "bugpoint-output.bc"
3 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
4 target triple = "x86_64-apple-macosx10.12.0"
6 define void @scan() #0 !dbg !12 {
8 %entry1 = alloca i1, align 8
9 call void @llvm.dbg.declare(metadata i1* %entry1, metadata !18, metadata !19), !dbg !20
10 store i1 0, i1* %entry1, align 8, !dbg !20
11 br label %for.cond, !dbg !20
14 ; CHECK: %[[PHI:.*]] = phi i1 [ false, %entry ], [ %0, %for.cond ]
15 %entryN = load i1, i1* %entry1, align 8, !dbg !20
16 ; CHECK: call void @llvm.dbg.value(metadata i1 %[[PHI]],
17 ; CHECK-SAME: metadata !DIExpression())
18 %0 = add i1 %entryN, 1
19 ; CHECK: %0 = add i1 %[[PHI]], true
20 ; CHECK: call void @llvm.dbg.value(metadata i1 %0,
21 ; CHECK-SAME: metadata !DIExpression())
22 store i1 %0, i1* %entry1, align 8, !dbg !20
23 br label %for.cond, !dbg !20
26 declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
28 attributes #0 = { nounwind ssp uwtable }
29 attributes #1 = { nounwind readnone }
32 !llvm.module.flags = !{!10, !11}
34 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "adrian", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug)
35 !1 = !DIFile(filename: "<stdin>", directory: "/")
37 !4 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char)
38 !10 = !{i32 2, !"Debug Info Version", i32 3}
39 !11 = !{i32 1, !"PIC Level", i32 2}
40 !12 = distinct !DISubprogram(name: "scan", scope: !1, file: !1, line: 4, type: !13, isLocal: false, isDefinition: true, scopeLine: 5, flags: DIFlagPrototyped, isOptimized: true, unit: !0, retainedNodes: !15)
41 !13 = !DISubroutineType(types: !14)
44 !18 = !DILocalVariable(name: "entry", scope: !12, file: !1, line: 6, type: !4)
46 !20 = !DILocation(line: 6, scope: !12)