ARM: yet another round of ARM test clean ups
[oota-llvm.git] / test / CodeGen / Thumb2 / thumb2-sxt_rot.ll
1 ; RUN: llc -mtriple=thumb-eabi -mcpu=arm1156t2-s -mattr=+thumb2,+t2xtpk %s -o - \
2 ; RUN:  | FileCheck %s
3
4 define i32 @test0(i8 %A) {
5 ; CHECK: test0
6 ; CHECK: sxtb r0, r0
7         %B = sext i8 %A to i32
8         ret i32 %B
9 }
10
11 define signext i8 @test1(i32 %A)  {
12 ; CHECK: test1
13 ; CHECK: sxtb.w r0, r0, ror #8
14         %B = lshr i32 %A, 8
15         %C = shl i32 %A, 24
16         %D = or i32 %B, %C
17         %E = trunc i32 %D to i8
18         ret i8 %E
19 }
20
21 define signext i32 @test2(i32 %A, i32 %X)  {
22 ; CHECK: test2
23 ; CHECK: lsrs r0, r0, #8
24 ; CHECK: sxtab  r0, r1, r0
25         %B = lshr i32 %A, 8
26         %C = shl i32 %A, 24
27         %D = or i32 %B, %C
28         %E = trunc i32 %D to i8
29         %F = sext i8 %E to i32
30         %G = add i32 %F, %X
31         ret i32 %G
32 }