blob: 253b0e145f811504edceec9c4c7d521b8dfce911 [file] [log] [blame]
Dan Gohmanda594cf2009-09-09 00:09:15 +00001; RUN: llc < %s -march=arm > %t
Dan Gohmanf17a25c2007-07-18 16:29:46 +00002; RUN: grep ldrsb %t
3; RUN: grep ldrb %t
4; RUN: grep ldrsh %t
5; RUN: grep ldrh %t
6
Tanya Lattner246a1372008-02-17 20:02:20 +00007
8define i32 @f1(i8* %p) {
Dan Gohmanf17a25c2007-07-18 16:29:46 +00009entry:
Tanya Lattner246a1372008-02-17 20:02:20 +000010 %tmp = load i8* %p ; <i8> [#uses=1]
11 %tmp1 = sext i8 %tmp to i32 ; <i32> [#uses=1]
12 ret i32 %tmp1
Dan Gohmanf17a25c2007-07-18 16:29:46 +000013}
14
Tanya Lattner246a1372008-02-17 20:02:20 +000015define i32 @f2(i8* %p) {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000016entry:
Tanya Lattner246a1372008-02-17 20:02:20 +000017 %tmp = load i8* %p ; <i8> [#uses=1]
18 %tmp2 = zext i8 %tmp to i32 ; <i32> [#uses=1]
19 ret i32 %tmp2
Dan Gohmanf17a25c2007-07-18 16:29:46 +000020}
21
Tanya Lattner246a1372008-02-17 20:02:20 +000022define i32 @f3(i16* %p) {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000023entry:
Tanya Lattner246a1372008-02-17 20:02:20 +000024 %tmp = load i16* %p ; <i16> [#uses=1]
25 %tmp3 = sext i16 %tmp to i32 ; <i32> [#uses=1]
26 ret i32 %tmp3
Dan Gohmanf17a25c2007-07-18 16:29:46 +000027}
28
Tanya Lattner246a1372008-02-17 20:02:20 +000029define i32 @f4(i16* %p) {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000030entry:
Tanya Lattner246a1372008-02-17 20:02:20 +000031 %tmp = load i16* %p ; <i16> [#uses=1]
32 %tmp4 = zext i16 %tmp to i32 ; <i32> [#uses=1]
33 ret i32 %tmp4
Dan Gohmanf17a25c2007-07-18 16:29:46 +000034}