blob: ba7e861600a9751fd89fc380d5dcf1311be7f25e [file] [log] [blame]
Dan Gohman5c6aea92008-08-20 00:56:07 +00001; RUN: llvm-as < %s | llc -fast-isel -march=x86
2; RUN: llvm-as < %s | llc -fast-isel -march=x86-64
Dan Gohmand3aedf42008-08-19 22:37:59 +00003
4; This tests very minimal fast-isel functionality.
5
6define i32 @foo(i32* %p, i32* %q) {
7entry:
8 %r = load i32* %p
9 %s = load i32* %q
10 br label %fast
11
12fast:
Dan Gohmanbdedd442008-08-20 00:11:48 +000013 %t0 = add i32 %r, %s
14 %t1 = mul i32 %t0, %s
15 %t2 = sub i32 %t1, %s
16 %t3 = and i32 %t2, %s
17 %t4 = or i32 %t3, %s
18 %t5 = xor i32 %t4, %s
Dan Gohmand5fe57d2008-08-21 01:41:07 +000019 %t6 = add i32 %t5, 2
Dan Gohmand3aedf42008-08-19 22:37:59 +000020 br label %exit
21
22exit:
Dan Gohmand5fe57d2008-08-21 01:41:07 +000023 ret i32 %t6
Dan Gohmand3aedf42008-08-19 22:37:59 +000024}
Dan Gohmanbdedd442008-08-20 00:11:48 +000025
Dan Gohman8014e862008-08-20 00:23:20 +000026define double @bar(double* %p, double* %q) {
27entry:
28 %r = load double* %p
29 %s = load double* %q
30 br label %fast
31
32fast:
33 %t0 = add double %r, %s
34 %t1 = mul double %t0, %s
35 %t2 = sub double %t1, %s
36 br label %exit
37
38exit:
39 ret double %t2
40}
41