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 \ | 6 ; RUN: %p2i -i %s --args -O2 --verbose none \ |
7 ; RUN: | llvm-mc -triple=i686-none-nacl -x86-asm-syntax=intel -filetype=obj \ | 7 ; RUN: | llvm-mc -triple=i686-none-nacl -x86-asm-syntax=intel -filetype=obj \ |
8 ; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s | 8 ; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s |
9 ; RUN: %llvm2ice -Om1 --verbose none %s \ | 9 ; RUN: %p2i -i %s --args -Om1 --verbose none \ |
10 ; RUN: | llvm-mc -triple=i686-none-nacl -x86-asm-syntax=intel -filetype=obj \ | 10 ; RUN: | llvm-mc -triple=i686-none-nacl -x86-asm-syntax=intel -filetype=obj \ |
11 ; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s | 11 ; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s |
12 ; RUN: %llvm2ice --verbose none %s | FileCheck --check-prefix=ERRORS %s | 12 ; RUN: %p2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s |
13 ; RUN: %llvm2iceinsts %s | %szdiff %s | FileCheck --check-prefix=DUMP %s | 13 ; RUN: %p2i -i %s --insts | %szdiff %s | FileCheck --check-prefix=DUMP %s |
14 ; RUN: %llvm2iceinsts --pnacl %s | %szdiff %s \ | |
15 ; RUN: | FileCheck --check-prefix=DUMP %s | |
16 | 14 |
17 define void @testSelect(i32 %a, i32 %b) { | 15 define void @testSelect(i32 %a, i32 %b) { |
18 entry: | 16 entry: |
19 %cmp = icmp slt i32 %a, %b | 17 %cmp = icmp slt i32 %a, %b |
20 %cond = select i1 %cmp, i32 %a, i32 %b | 18 %cond = select i1 %cmp, i32 %a, i32 %b |
21 tail call void @useInt(i32 %cond) | 19 tail call void @useInt(i32 %cond) |
22 %cmp1 = icmp sgt i32 %a, %b | 20 %cmp1 = icmp sgt i32 %a, %b |
23 %cond2 = select i1 %cmp1, i32 10, i32 20 | 21 %cond2 = select i1 %cmp1, i32 10, i32 20 |
24 tail call void @useInt(i32 %cond2) | 22 tail call void @useInt(i32 %cond2) |
25 ret void | 23 ret void |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 define i64 @testSelectImm64(i64 %a, i64 %b) { | 56 define i64 @testSelectImm64(i64 %a, i64 %b) { |
59 entry: | 57 entry: |
60 %cond = select i1 true, i64 %a, i64 %b | 58 %cond = select i1 true, i64 %a, i64 %b |
61 ret i64 %cond | 59 ret i64 %cond |
62 } | 60 } |
63 ; CHECK-LABEL: testSelectImm64 | 61 ; CHECK-LABEL: testSelectImm64 |
64 ; CHECK-NOT: cmp {{[0-9]+}}, | 62 ; CHECK-NOT: cmp {{[0-9]+}}, |
65 | 63 |
66 ; ERRORS-NOT: ICE translation error | 64 ; ERRORS-NOT: ICE translation error |
67 ; DUMP-NOT: SZ | 65 ; DUMP-NOT: SZ |
OLD | NEW |