OLD | NEW |
1 ; Assembly test for simple arithmetic operations. | 1 ; Assembly test for simple arithmetic operations. |
2 | 2 |
3 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \ | 3 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \ |
4 ; RUN: --target x8632 -i %s --args -O2 \ | 4 ; RUN: --target x8632 -i %s --args -O2 \ |
5 ; RUN: | %if --need=target_X8632 --command FileCheck %s | 5 ; RUN: | %if --need=target_X8632 --command FileCheck %s |
6 | 6 |
7 ; TODO(jvoung): Stop skipping unimplemented parts (via --skip-unimplemented) | 7 ; TODO(jvoung): Stop skipping unimplemented parts (via --skip-unimplemented) |
8 ; once enough infrastructure is in. Also, switch to --filetype=obj | 8 ; once enough infrastructure is in. Also, switch to --filetype=obj |
9 ; when possible. | 9 ; when possible. |
10 ; RUN: %if --need=target_ARM32 --need=allow_dump \ | 10 ; RUN: %if --need=target_ARM32 --need=allow_dump \ |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 ; Check for a valid ARM mul instruction where operands have to be registers. | 110 ; Check for a valid ARM mul instruction where operands have to be registers. |
111 ; On the other hand x86-32 does allow an immediate. | 111 ; On the other hand x86-32 does allow an immediate. |
112 define internal i32 @MulImm(i32 %a, i32 %b) { | 112 define internal i32 @MulImm(i32 %a, i32 %b) { |
113 entry: | 113 entry: |
114 %mul = mul i32 %a, 99 | 114 %mul = mul i32 %a, 99 |
115 ret i32 %mul | 115 ret i32 %mul |
116 } | 116 } |
117 ; CHECK-LABEL: MulImm | 117 ; CHECK-LABEL: MulImm |
118 ; CHECK: imul e{{.*}},e{{.*}},0x63 | 118 ; CHECK: imul e{{.*}},e{{.*}},0x63 |
119 ; ARM32-LABEL: MulImm | 119 ; ARM32-LABEL: MulImm |
120 ; ARM32: mov {{.*}}, #99 | 120 ; ARM32: movw {{.*}}, #99 |
121 ; ARM32: mul r{{.*}}, r{{.*}}, r{{.*}} | 121 ; ARM32: mul r{{.*}}, r{{.*}}, r{{.*}} |
122 ; MIPS32-LABEL: MulImm | 122 ; MIPS32-LABEL: MulImm |
123 ; MIPS32: mul | 123 ; MIPS32: mul |
124 | 124 |
125 ; Check for a valid addressing mode in the x86-32 mul instruction when | 125 ; Check for a valid addressing mode in the x86-32 mul instruction when |
126 ; the second source operand is an immediate. | 126 ; the second source operand is an immediate. |
127 define internal i64 @MulImm64(i64 %a) { | 127 define internal i64 @MulImm64(i64 %a) { |
128 entry: | 128 entry: |
129 %mul = mul i64 %a, 99 | 129 %mul = mul i64 %a, 99 |
130 ret i64 %mul | 130 ret i64 %mul |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 ; CHECK: shr {{.*}},cl | 270 ; CHECK: shr {{.*}},cl |
271 | 271 |
272 define internal i32 @AshrReloc(i32 %a) { | 272 define internal i32 @AshrReloc(i32 %a) { |
273 entry: | 273 entry: |
274 %opnd = ptrtoint [4 x i8]* @G to i32 | 274 %opnd = ptrtoint [4 x i8]* @G to i32 |
275 %result = ashr i32 %a, %opnd | 275 %result = ashr i32 %a, %opnd |
276 ret i32 %result | 276 ret i32 %result |
277 } | 277 } |
278 ; CHECK-LABEL: AshrReloc | 278 ; CHECK-LABEL: AshrReloc |
279 ; CHECK: sar {{.*}},cl | 279 ; CHECK: sar {{.*}},cl |
OLD | NEW |