aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorRenato Golin <renato.golin@arm.com>2011-05-22 21:41:23 +0000
committerRenato Golin <renato.golin@arm.com>2011-05-22 21:41:23 +0000
commit1ec11fb8b502971071a57b8b2de129f86bd41de0 (patch)
tree649f8511e819a0cec7103a10225820c5e21fa47d /test
parentfbc539ff37ddd08c2480be9185e7a40919ce8940 (diff)
downloadexternal_llvm-1ec11fb8b502971071a57b8b2de129f86bd41de0.zip
external_llvm-1ec11fb8b502971071a57b8b2de129f86bd41de0.tar.gz
external_llvm-1ec11fb8b502971071a57b8b2de129f86bd41de0.tar.bz2
RTABI chapter 4.3.4 specifies __eabi_mem* calls. Specifically, __eabi_memset accepts parameters (ptr, size, value) in a different order than GNU's memset (ptr, value, size), therefore the special lowering in AAPCS mode. Implementation by Evzen Muller.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131868 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/ARM/memfunc.ll24
1 files changed, 20 insertions, 4 deletions
diff --git a/test/CodeGen/ARM/memfunc.ll b/test/CodeGen/ARM/memfunc.ll
index 41d5944..032129d 100644
--- a/test/CodeGen/ARM/memfunc.ll
+++ b/test/CodeGen/ARM/memfunc.ll
@@ -1,10 +1,26 @@
-; RUN: llc < %s -march=arm
+; RUN: llc < %s -march=arm -o - | FileCheck %s
+; RUN: llc < %s -mtriple=arm-none-eabi -o - | FileCheck --check-prefix=EABI %s
+
+@from = common global [500 x i32] zeroinitializer, align 4
+@to = common global [500 x i32] zeroinitializer, align 4
define void @f() {
entry:
- call void @llvm.memmove.i32( i8* null, i8* null, i32 64, i32 0 )
- call void @llvm.memcpy.i32( i8* null, i8* null, i32 64, i32 0 )
- call void @llvm.memset.i32( i8* null, i8 64, i32 0, i32 0 )
+
+ ; CHECK: memmove
+ ; EABI: __aeabi_memmove
+ call void @llvm.memmove.i32( i8* bitcast ([500 x i32]* @from to i8*), i8* bitcast ([500 x i32]* @to to i8*), i32 500, i32 0 )
+
+ ; CHECK: memcpy
+ ; EABI: __aeabi_memcpy
+ call void @llvm.memcpy.i32( i8* bitcast ([500 x i32]* @from to i8*), i8* bitcast ([500 x i32]* @to to i8*), i32 500, i32 0 )
+
+ ; EABI memset swaps arguments
+ ; CHECK: mov r1, #0
+ ; CHECK: memset
+ ; EABI: mov r2, #0
+ ; EABI: __aeabi_memset
+ call void @llvm.memset.i32( i8* bitcast ([500 x i32]* @from to i8*), i8 0, i32 500, i32 0 )
unreachable
}