| OLD | NEW |
| 1 ; Tests various aspects of i1 related lowering. | 1 ; Tests various aspects of i1 related lowering. |
| 2 | 2 |
| 3 ; RUN: %p2i -i %s -a -O2 --verbose none \ | 3 ; RUN: %p2i -i %s -a -O2 --verbose none \ |
| 4 ; RUN: | llvm-mc -triple=i686-none-nacl -x86-asm-syntax=intel -filetype=obj \ | 4 ; RUN: | llvm-mc -triple=i686-none-nacl -x86-asm-syntax=intel -filetype=obj \ |
| 5 ; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s | 5 ; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s |
| 6 ; RUN: %p2i -i %s -a -Om1 --verbose none \ | 6 ; RUN: %p2i -i %s -a -Om1 --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: %p2i -i %s -a --verbose none | FileCheck --check-prefix=ERRORS %s | 9 ; RUN: %p2i -i %s -a --verbose none | FileCheck --check-prefix=ERRORS %s |
| 10 ; RUN: %p2i -i %s --insts | %szdiff %s | FileCheck --check-prefix=DUMP %s | 10 ; RUN: %p2i -i %s --insts | %szdiff %s | FileCheck --check-prefix=DUMP %s |
| 11 | 11 |
| 12 ; Test that and with true uses immediate 1, not -1. |
| 13 define internal i32 @testAndTrue(i32 %arg) { |
| 14 entry: |
| 15 %arg_i1 = trunc i32 %arg to i1 |
| 16 %result_i1 = and i1 %arg_i1, true |
| 17 %result = zext i1 %result_i1 to i32 |
| 18 ret i32 %result |
| 19 } |
| 20 ; CHECK-LABEL: testAndTrue |
| 21 ; CHECK: and {{.*}}, 1 |
| 22 |
| 23 ; Test that or with true uses immediate 1, not -1. |
| 24 define internal i32 @testOrTrue(i32 %arg) { |
| 25 entry: |
| 26 %arg_i1 = trunc i32 %arg to i1 |
| 27 %result_i1 = or i1 %arg_i1, true |
| 28 %result = zext i1 %result_i1 to i32 |
| 29 ret i32 %result |
| 30 } |
| 31 ; CHECK-LABEL: testOrTrue |
| 32 ; CHECK: or {{.*}}, 1 |
| 33 |
| 12 ; Test that xor with true uses immediate 1, not -1. | 34 ; Test that xor with true uses immediate 1, not -1. |
| 13 define internal i32 @testXorTrue(i32 %arg) { | 35 define internal i32 @testXorTrue(i32 %arg) { |
| 14 entry: | 36 entry: |
| 15 %arg_i1 = trunc i32 %arg to i1 | 37 %arg_i1 = trunc i32 %arg to i1 |
| 16 %result_i1 = xor i1 %arg_i1, true | 38 %result_i1 = xor i1 %arg_i1, true |
| 17 %result = zext i1 %result_i1 to i32 | 39 %result = zext i1 %result_i1 to i32 |
| 18 ret i32 %result | 40 ret i32 %result |
| 19 } | 41 } |
| 20 ; CHECK-LABEL: testXorTrue | 42 ; CHECK-LABEL: testXorTrue |
| 21 ; CHECK: xor {{.*}}, 1 | 43 ; CHECK: xor {{.*}}, 1 |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 } | 195 } |
| 174 ; CHECK-LABEL: testFptosiDouble | 196 ; CHECK-LABEL: testFptosiDouble |
| 175 ; CHECK: cvttsd2si | 197 ; CHECK: cvttsd2si |
| 176 ; CHECK: and {{.*}}, 1 | 198 ; CHECK: and {{.*}}, 1 |
| 177 ; CHECK: movzx [[REG:.*]], | 199 ; CHECK: movzx [[REG:.*]], |
| 178 ; CHECK-NEXT: shl [[REG]], 31 | 200 ; CHECK-NEXT: shl [[REG]], 31 |
| 179 ; CHECK-NEXT: sar [[REG]], 31 | 201 ; CHECK-NEXT: sar [[REG]], 31 |
| 180 | 202 |
| 181 ; ERRORS-NOT: ICE translation error | 203 ; ERRORS-NOT: ICE translation error |
| 182 ; DUMP-NOT: SZ | 204 ; DUMP-NOT: SZ |
| OLD | NEW |