2012-01-04 01:55:04 +00:00
|
|
|
; RUN: llc < %s -mtriple=thumbv7-apple-ios -mattr=+thumb2 | FileCheck %s
|
2009-08-04 21:12:13 +00:00
|
|
|
|
|
|
|
@X = external global [0 x i32] ; <[0 x i32]*> [#uses=5]
|
|
|
|
|
|
|
|
define i32 @t1() {
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: t1:
|
2009-08-11 21:11:32 +00:00
|
|
|
; CHECK: push {r7, lr}
|
2014-05-16 14:14:30 +00:00
|
|
|
; CHECK: ldrd
|
2009-08-11 21:11:32 +00:00
|
|
|
; CHECK: pop {r7, pc}
|
2009-08-04 21:12:13 +00:00
|
|
|
%tmp = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 0) ; <i32> [#uses=1]
|
|
|
|
%tmp3 = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 1) ; <i32> [#uses=1]
|
2010-06-03 21:53:01 +00:00
|
|
|
%tmp4 = call i32 @f1( i32 %tmp, i32 %tmp3 ) ; <i32> [#uses=1]
|
2009-08-04 21:12:13 +00:00
|
|
|
ret i32 %tmp4
|
|
|
|
}
|
|
|
|
|
|
|
|
define i32 @t2() {
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: t2:
|
2009-08-11 21:11:32 +00:00
|
|
|
; CHECK: push {r7, lr}
|
2011-08-18 21:50:53 +00:00
|
|
|
; CHECK: ldm
|
2009-08-11 21:11:32 +00:00
|
|
|
; CHECK: pop {r7, pc}
|
2009-08-04 21:12:13 +00:00
|
|
|
%tmp = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 2) ; <i32> [#uses=1]
|
|
|
|
%tmp3 = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 3) ; <i32> [#uses=1]
|
|
|
|
%tmp5 = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 4) ; <i32> [#uses=1]
|
2010-06-03 21:53:01 +00:00
|
|
|
%tmp6 = call i32 @f2( i32 %tmp, i32 %tmp3, i32 %tmp5 ) ; <i32> [#uses=1]
|
2009-08-04 21:12:13 +00:00
|
|
|
ret i32 %tmp6
|
|
|
|
}
|
|
|
|
|
|
|
|
define i32 @t3() {
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: t3:
|
2009-08-11 21:11:32 +00:00
|
|
|
; CHECK: push {r7, lr}
|
2014-05-16 14:14:30 +00:00
|
|
|
; CHECK: ldm
|
2009-08-11 21:11:32 +00:00
|
|
|
; CHECK: pop {r7, pc}
|
2009-08-04 21:12:13 +00:00
|
|
|
%tmp = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 1) ; <i32> [#uses=1]
|
|
|
|
%tmp3 = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 2) ; <i32> [#uses=1]
|
|
|
|
%tmp5 = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 3) ; <i32> [#uses=1]
|
2010-06-03 21:53:01 +00:00
|
|
|
%tmp6 = call i32 @f2( i32 %tmp, i32 %tmp3, i32 %tmp5 ) ; <i32> [#uses=1]
|
2009-08-04 21:12:13 +00:00
|
|
|
ret i32 %tmp6
|
|
|
|
}
|
|
|
|
|
|
|
|
declare i32 @f1(i32, i32)
|
|
|
|
|
|
|
|
declare i32 @f2(i32, i32, i32)
|