blob: 9a28124b84ce4d1566fc6e1fb0246f36346efef5 [file] [log] [blame]
Dan Gohmanda594cf2009-09-09 00:09:15 +00001; RUN: llc < %s -march=thumb | FileCheck %s -check-prefix=V5
2; RUN: llc < %s -march=thumb -mattr=+v6 | FileCheck %s -check-prefix=V6
Evan Cheng085e19b2009-06-24 06:36:07 +00003
Evan Cheng5e1d2182009-08-28 00:31:43 +00004; rdar://7176514
5
6define i32 @test1(i8* %t1) nounwind {
7; V5: ldrb
8
9; V6: ldrb
10 %tmp.u = load i8* %t1
Evan Cheng085e19b2009-06-24 06:36:07 +000011 %tmp1.s = zext i8 %tmp.u to i32
12 ret i32 %tmp1.s
13}
14
Evan Cheng5e1d2182009-08-28 00:31:43 +000015define i32 @test2(i16* %t1) nounwind {
16; V5: ldrh
17
18; V6: ldrh
19 %tmp.u = load i16* %t1
Evan Cheng085e19b2009-06-24 06:36:07 +000020 %tmp1.s = zext i16 %tmp.u to i32
21 ret i32 %tmp1.s
22}
23
Evan Cheng5e1d2182009-08-28 00:31:43 +000024define i32 @test3(i8* %t0) nounwind {
25; V5: ldrb
26; V5: lsls
27; V5: asrs
28
29; V6: ldrb
30; V6: sxtb
31 %tmp.s = load i8* %t0
Evan Cheng085e19b2009-06-24 06:36:07 +000032 %tmp1.s = sext i8 %tmp.s to i32
33 ret i32 %tmp1.s
34}
35
Evan Cheng5e1d2182009-08-28 00:31:43 +000036define i32 @test4(i16* %t0) nounwind {
37; V5: ldrh
38; V5: lsls
39; V5: asrs
40
41; V6: ldrh
42; V6: sxth
43 %tmp.s = load i16* %t0
44 %tmp1.s = sext i16 %tmp.s to i32
45 ret i32 %tmp1.s
46}
47
48define i32 @test5() nounwind {
49; V5: movs r0, #0
50; V5: ldrsh
51
52; V6: movs r0, #0
53; V6: ldrsh
Evan Cheng085e19b2009-06-24 06:36:07 +000054 %tmp.s = load i16* null
55 %tmp1.s = sext i16 %tmp.s to i32
56 ret i32 %tmp1.s
57}