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 \ | 8 ; RUN: %llvm2ice -O2 --verbose none %s \ |
9 ; RUN: | llvm-mc -triple=i686-none-nacl -x86-asm-syntax=intel -filetype=obj | 9 ; RUN: | llvm-mc -triple=i686-none-nacl -x86-asm-syntax=intel -filetype=obj |
10 ; RUN: %llvm2ice -Om1 --verbose none %s \ | 10 ; RUN: %llvm2ice -Om1 --verbose none %s \ |
(...skipping 18 matching lines...) Expand all Loading... |
29 | 29 |
30 ; CHECK: .globl testSelect | 30 ; CHECK: .globl testSelect |
31 ; CHECK: cmp | 31 ; CHECK: cmp |
32 ; CHECK: cmp | 32 ; CHECK: cmp |
33 ; CHECK: call useInt | 33 ; CHECK: call useInt |
34 ; CHECK: cmp | 34 ; CHECK: cmp |
35 ; CHECK: cmp | 35 ; CHECK: cmp |
36 ; CHECK: call useInt | 36 ; CHECK: call useInt |
37 ; CHECK: ret | 37 ; CHECK: ret |
38 | 38 |
| 39 ; Check for valid addressing mode in the cmp instruction when the |
| 40 ; operand is an immediate. |
| 41 define i32 @testSelectImm32(i32 %a, i32 %b) { |
| 42 entry: |
| 43 %cond = select i1 0, i32 %a, i32 %b |
| 44 ret i32 %cond |
| 45 } |
| 46 ; CHECK-LABEL: testSelectImm32 |
| 47 ; CHECK-NOT: cmp {{[0-9]+}}, |
| 48 |
| 49 ; Check for valid addressing mode in the cmp instruction when the |
| 50 ; operand is an immediate. There is a different x86-32 lowering |
| 51 ; sequence for 64-bit operands. |
| 52 define i64 @testSelectImm64(i64 %a, i64 %b) { |
| 53 entry: |
| 54 %cond = select i1 1, i64 %a, i64 %b |
| 55 ret i64 %cond |
| 56 } |
| 57 ; CHECK-LABEL: testSelectImm64 |
| 58 ; CHECK-NOT: cmp {{[0-9]+}}, |
| 59 |
39 ; ERRORS-NOT: ICE translation error | 60 ; ERRORS-NOT: ICE translation error |
40 ; DUMP-NOT: SZ | 61 ; DUMP-NOT: SZ |
OLD | NEW |