1; RUN: llc -mcpu=pwr7 < %s | FileCheck %s
2target datalayout = "E-m:e-i64:64-n32:64"
3target triple = "powerpc64-unknown-linux-gnu"
4
5@.str1 = external unnamed_addr constant [1 x i8], align 1
6@.str2 = external unnamed_addr constant [39 x i8], align 1
7
8declare void @_ZN13CStdOutStreamlsEPKc()
9
10declare void @_ZN13CStdOutStream5FlushEv()
11
12declare i32 @__gxx_personality_v0(...)
13
14define void @_Z11GetPasswordP13CStdOutStreamb() {
15entry:
16  br label %for.cond.i.i
17
18for.cond.i.i:                                     ; preds = %for.cond.i.i, %entry
19  br i1 undef, label %_ZN11CStringBaseIcEC2EPKc.exit.critedge, label %for.cond.i.i
20
21_ZN11CStringBaseIcEC2EPKc.exit.critedge:          ; preds = %for.cond.i.i
22  invoke void @_ZN13CStdOutStreamlsEPKc()
23          to label %invoke.cont unwind label %lpad
24
25invoke.cont:                                      ; preds = %_ZN11CStringBaseIcEC2EPKc.exit.critedge
26  invoke void @_ZN13CStdOutStream5FlushEv()
27          to label %invoke.cont4 unwind label %lpad
28
29invoke.cont4:                                     ; preds = %invoke.cont
30  %call7 = invoke i8* @getpass()
31          to label %for.cond.i.i30 unwind label %lpad
32
33; CHECK-LABEL: @_Z11GetPasswordP13CStdOutStreamb
34; CHECK: addi {{[0-9]+}}, 3, -1
35
36for.cond.i.i30:                                   ; preds = %for.cond.i.i30, %invoke.cont4
37  %indvars.iv.i.i26 = phi i64 [ %indvars.iv.next.i.i29, %for.cond.i.i30 ], [ 0, %invoke.cont4 ]
38  %arrayidx.i.i27 = getelementptr inbounds i8, i8* %call7, i64 %indvars.iv.i.i26
39  %0 = load i8, i8* %arrayidx.i.i27, align 1
40  %indvars.iv.next.i.i29 = add nuw nsw i64 %indvars.iv.i.i26, 1
41  br label %for.cond.i.i30
42
43lpad:                                             ; preds = %invoke.cont4, %invoke.cont, %_ZN11CStringBaseIcEC2EPKc.exit.critedge
44  %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
45          cleanup
46  resume { i8*, i32 } undef
47}
48
49declare i8* @getpass()
50
51