blob: 6eeffc523f40323c79064e0f346e1c3a1ad0946b [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 Gohmand3aedf42008-08-19 22:37:59 +000019 br label %exit
20
21exit:
Dan Gohmanbdedd442008-08-20 00:11:48 +000022 ret i32 %t5
Dan Gohmand3aedf42008-08-19 22:37:59 +000023}
Dan Gohmanbdedd442008-08-20 00:11:48 +000024
Dan Gohman8014e862008-08-20 00:23:20 +000025define double @bar(double* %p, double* %q) {
26entry:
27 %r = load double* %p
28 %s = load double* %q
29 br label %fast
30
31fast:
32 %t0 = add double %r, %s
33 %t1 = mul double %t0, %s
34 %t2 = sub double %t1, %s
35 br label %exit
36
37exit:
38 ret double %t2
39}
40