1 ; RUN: llvm-as -f %s -o - | llc
4 ;; From: test/Programs/MultiSource/Olden-perimeter
5 ;; Function: int %adj(uint %d.1, uint %ct.1)
7 ;; Errors: (1) cast-int-to-bool was being treated as a NOP (i.e., the int
8 ;; register was treated as effectively true if non-zero).
9 ;; This cannot be used for later boolean operations.
10 ;; (2) (A or NOT(B)) was being folded into A orn B, which is ok
11 ;; for bitwise operations but not booleans! For booleans,
12 ;; the result has to be compared with 0.
14 %.str_1 = internal constant [30 x sbyte] c"d = %d, ct = %d, d ^ ct = %d\0A\00"
17 implementation ; Functions:
19 declare int %printf(sbyte*, ...)
21 int %adj(uint %d.1, uint %ct.1) {
23 %tmp.19 = seteq uint %ct.1, 2
24 %tmp.22.not = cast uint %ct.1 to bool
25 %tmp.221 = xor bool %tmp.22.not, true
26 %tmp.26 = or bool %tmp.19, %tmp.221
27 %tmp.27 = cast bool %tmp.26 to int
33 %result = call int %adj(uint 3, uint 2)
34 %tmp.0 = call int (sbyte*, ...)* %printf( sbyte* getelementptr ([30 x sbyte]* %.str_1, long 0, long 0), uint 3, uint 2, int %result)