2011-12-21 02:26:50 +08:00
|
|
|
; RUN: llc < %s -O0 -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=armv7-apple-ios | FileCheck %s --check-prefix=ARM
|
|
|
|
; RUN: llc < %s -O0 -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=thumbv7-apple-ios | FileCheck %s --check-prefix=THUMB
|
2012-06-13 03:25:13 +08:00
|
|
|
; RUN: llc < %s -O0 -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=armv7-apple-ios -arm-long-calls | FileCheck %s --check-prefix=ARM-LONG
|
|
|
|
; RUN: llc < %s -O0 -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=thumbv7-apple-ios -arm-long-calls | FileCheck %s --check-prefix=THUMB-LONG
|
2011-11-12 07:31:03 +08:00
|
|
|
|
|
|
|
@message1 = global [60 x i8] c"The LLVM Compiler Infrastructure\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", align 1
|
|
|
|
@temp = common global [60 x i8] zeroinitializer, align 1
|
|
|
|
|
|
|
|
define void @t1() nounwind ssp {
|
|
|
|
; ARM: t1
|
2012-01-07 09:47:05 +08:00
|
|
|
; ARM: movw r0, :lower16:_message1
|
|
|
|
; ARM: movt r0, :upper16:_message1
|
2011-11-12 07:31:03 +08:00
|
|
|
; ARM: add r0, r0, #5
|
|
|
|
; ARM: movw r1, #64
|
|
|
|
; ARM: movw r2, #10
|
|
|
|
; ARM: uxtb r1, r1
|
2011-11-13 17:44:21 +08:00
|
|
|
; ARM: bl _memset
|
2012-06-13 03:25:13 +08:00
|
|
|
; ARM-LONG: t1
|
|
|
|
; ARM-LONG: movw r3, :lower16:L_memset$non_lazy_ptr
|
|
|
|
; ARM-LONG: movt r3, :upper16:L_memset$non_lazy_ptr
|
|
|
|
; ARM-LONG: ldr r3, [r3]
|
|
|
|
; ARM-LONG: blx r3
|
2011-11-12 07:31:03 +08:00
|
|
|
; THUMB: t1
|
2012-01-07 09:47:05 +08:00
|
|
|
; THUMB: movw r0, :lower16:_message1
|
|
|
|
; THUMB: movt r0, :upper16:_message1
|
2011-11-12 07:31:03 +08:00
|
|
|
; THUMB: adds r0, #5
|
|
|
|
; THUMB: movs r1, #64
|
|
|
|
; THUMB: movt r1, #0
|
|
|
|
; THUMB: movs r2, #10
|
|
|
|
; THUMB: movt r2, #0
|
|
|
|
; THUMB: uxtb r1, r1
|
|
|
|
; THUMB: bl _memset
|
2012-06-13 03:25:13 +08:00
|
|
|
; THUMB-LONG: t1
|
|
|
|
; THUMB-LONG: movw r3, :lower16:L_memset$non_lazy_ptr
|
|
|
|
; THUMB-LONG: movt r3, :upper16:L_memset$non_lazy_ptr
|
|
|
|
; THUMB-LONG: ldr r3, [r3]
|
|
|
|
; THUMB-LONG: blx r3
|
2011-11-12 07:31:03 +08:00
|
|
|
call void @llvm.memset.p0i8.i32(i8* getelementptr inbounds ([60 x i8]* @message1, i32 0, i32 5), i8 64, i32 10, i32 1, i1 false)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i32, i1) nounwind
|
|
|
|
|
|
|
|
define void @t2() nounwind ssp {
|
|
|
|
; ARM: t2
|
2012-01-07 09:47:05 +08:00
|
|
|
; ARM: movw r0, :lower16:L_temp$non_lazy_ptr
|
|
|
|
; ARM: movt r0, :upper16:L_temp$non_lazy_ptr
|
2011-11-12 07:31:03 +08:00
|
|
|
; ARM: ldr r0, [r0]
|
|
|
|
; ARM: add r1, r0, #4
|
|
|
|
; ARM: add r0, r0, #16
|
2011-11-15 06:46:17 +08:00
|
|
|
; ARM: movw r2, #17
|
2011-11-12 07:31:03 +08:00
|
|
|
; ARM: str r0, [sp] @ 4-byte Spill
|
|
|
|
; ARM: mov r0, r1
|
|
|
|
; ARM: ldr r1, [sp] @ 4-byte Reload
|
2011-11-13 17:44:21 +08:00
|
|
|
; ARM: bl _memcpy
|
2012-06-13 03:25:13 +08:00
|
|
|
; ARM-LONG: t2
|
|
|
|
; ARM-LONG: movw r3, :lower16:L_memcpy$non_lazy_ptr
|
|
|
|
; ARM-LONG: movt r3, :upper16:L_memcpy$non_lazy_ptr
|
|
|
|
; ARM-LONG: ldr r3, [r3]
|
|
|
|
; ARM-LONG: blx r3
|
2011-11-12 07:31:03 +08:00
|
|
|
; THUMB: t2
|
2012-01-07 09:47:05 +08:00
|
|
|
; THUMB: movw r0, :lower16:L_temp$non_lazy_ptr
|
|
|
|
; THUMB: movt r0, :upper16:L_temp$non_lazy_ptr
|
2011-11-12 07:31:03 +08:00
|
|
|
; THUMB: ldr r0, [r0]
|
|
|
|
; THUMB: adds r1, r0, #4
|
|
|
|
; THUMB: adds r0, #16
|
2011-11-15 06:46:17 +08:00
|
|
|
; THUMB: movs r2, #17
|
2011-11-12 07:31:03 +08:00
|
|
|
; THUMB: movt r2, #0
|
|
|
|
; THUMB: mov r0, r1
|
|
|
|
; THUMB: bl _memcpy
|
2012-06-13 03:25:13 +08:00
|
|
|
; THUMB-LONG: t2
|
|
|
|
; THUMB-LONG: movw r3, :lower16:L_memcpy$non_lazy_ptr
|
|
|
|
; THUMB-LONG: movt r3, :upper16:L_memcpy$non_lazy_ptr
|
|
|
|
; THUMB-LONG: ldr r3, [r3]
|
|
|
|
; THUMB-LONG: blx r3
|
2011-11-15 06:46:17 +08:00
|
|
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* getelementptr inbounds ([60 x i8]* @temp, i32 0, i32 4), i8* getelementptr inbounds ([60 x i8]* @temp, i32 0, i32 16), i32 17, i32 1, i1 false)
|
2011-11-12 07:31:03 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind
|
|
|
|
|
|
|
|
define void @t3() nounwind ssp {
|
|
|
|
; ARM: t3
|
2012-01-07 09:47:05 +08:00
|
|
|
; ARM: movw r0, :lower16:L_temp$non_lazy_ptr
|
|
|
|
; ARM: movt r0, :upper16:L_temp$non_lazy_ptr
|
2011-11-12 07:31:03 +08:00
|
|
|
; ARM: ldr r0, [r0]
|
|
|
|
; ARM: add r1, r0, #4
|
|
|
|
; ARM: add r0, r0, #16
|
|
|
|
; ARM: movw r2, #10
|
|
|
|
; ARM: mov r0, r1
|
2011-11-13 17:44:21 +08:00
|
|
|
; ARM: bl _memmove
|
2012-06-13 03:25:13 +08:00
|
|
|
; ARM-LONG: t3
|
|
|
|
; ARM-LONG: movw r3, :lower16:L_memmove$non_lazy_ptr
|
|
|
|
; ARM-LONG: movt r3, :upper16:L_memmove$non_lazy_ptr
|
|
|
|
; ARM-LONG: ldr r3, [r3]
|
|
|
|
; ARM-LONG: blx r3
|
2011-11-12 07:31:03 +08:00
|
|
|
; THUMB: t3
|
2012-01-07 09:47:05 +08:00
|
|
|
; THUMB: movw r0, :lower16:L_temp$non_lazy_ptr
|
|
|
|
; THUMB: movt r0, :upper16:L_temp$non_lazy_ptr
|
2011-11-12 07:31:03 +08:00
|
|
|
; THUMB: ldr r0, [r0]
|
|
|
|
; THUMB: adds r1, r0, #4
|
|
|
|
; THUMB: adds r0, #16
|
|
|
|
; THUMB: movs r2, #10
|
|
|
|
; THUMB: movt r2, #0
|
|
|
|
; THUMB: mov r0, r1
|
|
|
|
; THUMB: bl _memmove
|
2012-06-13 03:25:13 +08:00
|
|
|
; THUMB-LONG: t3
|
|
|
|
; THUMB-LONG: movw r3, :lower16:L_memmove$non_lazy_ptr
|
|
|
|
; THUMB-LONG: movt r3, :upper16:L_memmove$non_lazy_ptr
|
|
|
|
; THUMB-LONG: ldr r3, [r3]
|
|
|
|
; THUMB-LONG: blx r3
|
2011-11-12 07:31:03 +08:00
|
|
|
call void @llvm.memmove.p0i8.p0i8.i32(i8* getelementptr inbounds ([60 x i8]* @temp, i32 0, i32 4), i8* getelementptr inbounds ([60 x i8]* @temp, i32 0, i32 16), i32 10, i32 1, i1 false)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2011-11-15 06:46:17 +08:00
|
|
|
define void @t4() nounwind ssp {
|
|
|
|
; ARM: t4
|
2012-01-07 09:47:05 +08:00
|
|
|
; ARM: movw r0, :lower16:L_temp$non_lazy_ptr
|
|
|
|
; ARM: movt r0, :upper16:L_temp$non_lazy_ptr
|
2011-11-15 06:46:17 +08:00
|
|
|
; ARM: ldr r0, [r0]
|
2012-01-07 12:07:22 +08:00
|
|
|
; ARM: ldr r1, [r0, #16]
|
|
|
|
; ARM: str r1, [r0, #4]
|
|
|
|
; ARM: ldr r1, [r0, #20]
|
|
|
|
; ARM: str r1, [r0, #8]
|
|
|
|
; ARM: ldrh r1, [r0, #24]
|
2011-11-15 06:46:17 +08:00
|
|
|
; ARM: strh r1, [r0, #12]
|
|
|
|
; ARM: bx lr
|
2012-01-07 09:47:05 +08:00
|
|
|
; THUMB: movw r0, :lower16:L_temp$non_lazy_ptr
|
|
|
|
; THUMB: movt r0, :upper16:L_temp$non_lazy_ptr
|
2011-11-15 06:46:17 +08:00
|
|
|
; THUMB: ldr r0, [r0]
|
2012-01-07 12:07:22 +08:00
|
|
|
; THUMB: ldr r1, [r0, #16]
|
|
|
|
; THUMB: str r1, [r0, #4]
|
|
|
|
; THUMB: ldr r1, [r0, #20]
|
|
|
|
; THUMB: str r1, [r0, #8]
|
|
|
|
; THUMB: ldrh r1, [r0, #24]
|
2011-11-15 06:46:17 +08:00
|
|
|
; THUMB: strh r1, [r0, #12]
|
|
|
|
; THUMB: bx lr
|
|
|
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* getelementptr inbounds ([60 x i8]* @temp, i32 0, i32 4), i8* getelementptr inbounds ([60 x i8]* @temp, i32 0, i32 16), i32 10, i32 1, i1 false)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2011-11-12 07:31:03 +08:00
|
|
|
declare void @llvm.memmove.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind
|