aboutsummaryrefslogtreecommitdiffstats
path: root/test/ExecutionEngine/2003-10-18-PHINode-ConstantExpr-CondCode-Failure.ll
blob: b2700e1f3955753b8fecd6fff58c370ccfa638ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
; RUN: llvm-upgrade %s | llvm-as -f -o %t.bc
; RUN: lli %t.bc > /dev/null

%A = global int 0

int %main() {
	%Ret = call int %test(bool true, int 0)	
	ret int %Ret
}

int %test(bool %c, int %A) {
	br bool %c, label %Taken1, label %NotTaken

Cont:
	%V = phi int [0, %NotTaken], 
	              [ sub (int cast (int* %A to int), int 1234), %Taken1]
	ret int 0

NotTaken:
	br label %Cont	

Taken1:
	%B = seteq int %A, 0
	; Code got inserted here, breaking the condition code.
	br bool %B, label %Cont, label %ExitError

ExitError:
	ret int 12

}