1 ; RUN: llc -mtriple=arm-eabi -mattr=+v6 %s -o - | FileCheck %s --check-prefix=CHECK-V6
2 ; RUN: llc -mtriple=arm-eabi -mattr=+v7 %s -o - | FileCheck %s --check-prefix=CHECK-V7
4 define i32 @test0(i8 %A) {
6 ; CHECK-V6: sxtb r0, r0
7 ; CHECK-V7: sxtb r0, r0
12 define signext i8 @test1(i32 %A) {
14 ; CHECK-V6: lsr r0, r0, #8
15 ; CHECK-V6: sxtb r0, r0
17 ; CHECk-V7: sbfx r0, r0, #8, #8
21 %E = trunc i32 %D to i8
25 define signext i32 @test2(i32 %A, i32 %X) {
27 ; CHECK-V6: sxtab r0, r1, r0, ror #8
28 ; CHECK-V7: sxtab r0, r1, r0, ror #8
32 %E = trunc i32 %D to i8
33 %F = sext i8 %E to i32
38 define signext i32 @test3(i32 %A, i32 %X) {
40 ; CHECK-V6: sxtab r0, r1, r0, ror #16
41 ; CHECK-V7: sxtab r0, r1, r0, ror #16
45 %E = trunc i32 %D to i8
46 %F = sext i8 %E to i32
51 define signext i32 @test4(i32 %A, i32 %X) {
53 ; CHECK-V6: sxtah r0, r1, r0, ror #8
54 ; CHECK-V7: sxtah r0, r1, r0, ror #8
58 %E = trunc i32 %D to i16
59 %F = sext i16 %E to i32
64 define signext i32 @test5(i32 %A, i32 %X) {
66 ; CHECK-V6: sxtah r0, r1, r0, ror #24
67 ; CHECK-V7: sxtah r0, r1, r0, ror #24
71 %E = trunc i32 %D to i16
72 %F = sext i16 %E to i32
77 define i32 @test6(i8 %A, i32 %X) {
79 ; CHECK-V6: sxtab r0, r1, r0
80 ; CHECK-V7: sxtab r0, r1, r0
81 %sext = sext i8 %A to i32
82 %add = add i32 %X, %sext
86 define i32 @test7(i32 %A, i32 %X) {
88 ; CHECK-V6: sxtab r0, r1, r0
89 ; CHECK-V7: sxtab r0, r1, r0
91 %shr = ashr i32 %shl, 24
92 %add = add i32 %X, %shr
96 define i32 @test8(i16 %A, i32 %X) {
98 ; CHECK-V6: sxtah r0, r1, r0
99 ; CHECK-V7: sxtah r0, r1, r0
100 %sext = sext i16 %A to i32
101 %add = add i32 %X, %sext
105 define i32 @test9(i32 %A, i32 %X) {
107 ; CHECK-V6: sxtah r0, r1, r0
108 ; CHECK-V7: sxtah r0, r1, r0
109 %shl = shl i32 %A, 16
110 %shr = ashr i32 %shl, 16
111 %add = add i32 %X, %shr