OLD | NEW |
1 ; RUIN: %llvm2ice %s | FileCheck %s | 1 ; Simple test of the select instruction. The CHECK lines are only |
2 ; RUIN: %llvm2ice --verbose none %s | FileCheck --check-prefix=ERRORS %s | 2 ; checking for basic instruction patterns that should be present |
| 3 ; regardless of the optimization level, so there are no special OPTM1 |
| 4 ; match lines. |
| 5 |
| 6 ; RUIN: %llvm2ice -O2 --verbose none %s | FileCheck %s |
| 7 ; RUN: %llvm2ice -Om1 --verbose none %s | FileCheck %s |
| 8 ; RUN: %llvm2ice --verbose none %s | FileCheck --check-prefix=ERRORS %s |
3 ; RUN: %llvm2iceinsts %s | %szdiff %s | FileCheck --check-prefix=DUMP %s | 9 ; RUN: %llvm2iceinsts %s | %szdiff %s | FileCheck --check-prefix=DUMP %s |
4 ; RUN: %llvm2iceinsts --pnacl %s | %szdiff %s \ | 10 ; RUN: %llvm2iceinsts --pnacl %s | %szdiff %s \ |
5 ; RUN: | FileCheck --check-prefix=DUMP %s | 11 ; RUN: | FileCheck --check-prefix=DUMP %s |
6 | 12 |
7 define void @testSelect(i32 %a, i32 %b) { | 13 define void @testSelect(i32 %a, i32 %b) { |
8 entry: | 14 entry: |
9 %cmp = icmp slt i32 %a, %b | 15 %cmp = icmp slt i32 %a, %b |
10 %cond = select i1 %cmp, i32 %a, i32 %b | 16 %cond = select i1 %cmp, i32 %a, i32 %b |
11 tail call void @useInt(i32 %cond) | 17 tail call void @useInt(i32 %cond) |
12 %cmp1 = icmp sgt i32 %a, %b | 18 %cmp1 = icmp sgt i32 %a, %b |
13 %cond2 = select i1 %cmp1, i32 10, i32 20 | 19 %cond2 = select i1 %cmp1, i32 10, i32 20 |
14 tail call void @useInt(i32 %cond2) | 20 tail call void @useInt(i32 %cond2) |
15 ret void | 21 ret void |
16 } | 22 } |
17 | 23 |
18 declare void @useInt(i32) | 24 declare void @useInt(i32) |
19 | 25 |
20 ; CHECK: .globl testSelect | 26 ; CHECK: .globl testSelect |
21 ; CHECK: cmp | 27 ; CHECK: cmp |
22 ; CHECK: cmp | 28 ; CHECK: cmp |
23 ; CHECK: call useInt | 29 ; CHECK: call useInt |
24 ; CHECK: cmp | 30 ; CHECK: cmp |
25 ; CHECK: cmp | 31 ; CHECK: cmp |
26 ; CHECK: call useInt | 32 ; CHECK: call useInt |
27 ; CHECK: ret | 33 ; CHECK: ret |
28 | 34 |
29 ; ERRORS-NOT: ICE translation error | 35 ; ERRORS-NOT: ICE translation error |
30 ; DUMP-NOT: SZ | 36 ; DUMP-NOT: SZ |
OLD | NEW |