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