blob: f66479c2cfa30651c524c06194b260562f50ddb8 [file] [log] [blame]
Mehdi Amini945a6602015-02-27 18:32:11 +00001; RUN: llc < %s -O0 -fast-isel-abort=1 -relocation-model=dynamic-no-pic -mtriple=armv7-apple-ios -verify-machineinstrs | FileCheck %s
2; RUN: llc < %s -O0 -fast-isel-abort=1 -relocation-model=dynamic-no-pic -mtriple=armv7-linux-gnueabi -verify-machineinstrs | FileCheck %s
3; RUN: llc < %s -O0 -fast-isel-abort=1 -relocation-model=dynamic-no-pic -mtriple=thumbv7-apple-ios -verify-machineinstrs | FileCheck %s
Chad Rosierf3e73ad2011-11-04 00:50:21 +00004
5; Sign-extend of i1 currently not supported by fast-isel
6;define signext i1 @ret0(i1 signext %a) nounwind uwtable ssp {
7;entry:
8; ret i1 %a
9;}
10
11define zeroext i1 @ret1(i1 signext %a) nounwind uwtable ssp {
12entry:
13; CHECK: ret1
14; CHECK: and r0, r0, #1
15; CHECK: bx lr
16 ret i1 %a
17}
18
19define signext i8 @ret2(i8 signext %a) nounwind uwtable ssp {
20entry:
21; CHECK: ret2
22; CHECK: sxtb r0, r0
23; CHECK: bx lr
24 ret i8 %a
25}
26
27define zeroext i8 @ret3(i8 signext %a) nounwind uwtable ssp {
28entry:
29; CHECK: ret3
JF Bastien06ce03d2013-06-07 20:10:37 +000030; CHECK: and r0, r0, #255
Chad Rosierf3e73ad2011-11-04 00:50:21 +000031; CHECK: bx lr
32 ret i8 %a
33}
34
35define signext i16 @ret4(i16 signext %a) nounwind uwtable ssp {
36entry:
37; CHECK: ret4
38; CHECK: sxth r0, r0
39; CHECK: bx lr
40 ret i16 %a
41}
42
43define zeroext i16 @ret5(i16 signext %a) nounwind uwtable ssp {
44entry:
45; CHECK: ret5
46; CHECK: uxth r0, r0
47; CHECK: bx lr
48 ret i16 %a
49}
Chad Rosierfcd29ae2012-02-17 01:21:28 +000050
51define i16 @ret6(i16 %a) nounwind uwtable ssp {
52entry:
53; CHECK: ret6
54; CHECK-NOT: uxth
55; CHECK-NOT: sxth
56; CHECK: bx lr
57 ret i16 %a
58}