| 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: %szdiff --llvm2ice=%llvm2ice %s | FileCheck --check-prefix=DUMP %s | 9 ; RUN: %szdiff --llvm2ice=%llvm2ice %s | FileCheck --check-prefix=DUMP %s |
| 4 | 10 |
| 5 define void @testSelect(i32 %a, i32 %b) { | 11 define void @testSelect(i32 %a, i32 %b) { |
| 6 entry: | 12 entry: |
| 7 %cmp = icmp slt i32 %a, %b | 13 %cmp = icmp slt i32 %a, %b |
| 8 %cond = select i1 %cmp, i32 %a, i32 %b | 14 %cond = select i1 %cmp, i32 %a, i32 %b |
| 9 tail call void @useInt(i32 %cond) | 15 tail call void @useInt(i32 %cond) |
| 10 %cmp1 = icmp sgt i32 %a, %b | 16 %cmp1 = icmp sgt i32 %a, %b |
| 11 %cond2 = select i1 %cmp1, i32 10, i32 20 | 17 %cond2 = select i1 %cmp1, i32 10, i32 20 |
| 12 tail call void @useInt(i32 %cond2) | 18 tail call void @useInt(i32 %cond2) |
| 13 ret void | 19 ret void |
| 14 } | 20 } |
| 15 | 21 |
| 16 declare void @useInt(i32) | 22 declare void @useInt(i32) |
| 17 | 23 |
| 18 ; CHECK: .globl testSelect | 24 ; CHECK: .globl testSelect |
| 19 ; CHECK: cmp | 25 ; CHECK: cmp |
| 20 ; CHECK: cmp | 26 ; CHECK: cmp |
| 21 ; CHECK: call useInt | 27 ; CHECK: call useInt |
| 22 ; CHECK: cmp | 28 ; CHECK: cmp |
| 23 ; CHECK: cmp | 29 ; CHECK: cmp |
| 24 ; CHECK: call useInt | 30 ; CHECK: call useInt |
| 25 ; CHECK: ret | 31 ; CHECK: ret |
| 26 | 32 |
| 27 ; ERRORS-NOT: ICE translation error | 33 ; ERRORS-NOT: ICE translation error |
| 28 ; DUMP-NOT: SZ | 34 ; DUMP-NOT: SZ |
| OLD | NEW |