blob: aeda02282b99c170eb9ff3a1f1d90ff66b06be42 [file] [log] [blame]
Eli Friedman575d0162011-06-16 01:49:31 +00001; RUN: llc < %s -mtriple=armv7-apple-ios -o - | FileCheck %s
Renato Golin4cd51872011-05-22 21:41:23 +00002; RUN: llc < %s -mtriple=arm-none-eabi -o - | FileCheck --check-prefix=EABI %s
3
4@from = common global [500 x i32] zeroinitializer, align 4
5@to = common global [500 x i32] zeroinitializer, align 4
Rafael Espindolab5dee632006-12-05 17:57:23 +00006
Tanya Lattnerf697c032008-02-17 20:02:20 +00007define void @f() {
Rafael Espindolab5dee632006-12-05 17:57:23 +00008entry:
Renato Golin4cd51872011-05-22 21:41:23 +00009
10 ; CHECK: memmove
11 ; EABI: __aeabi_memmove
Chris Lattner80ed9dc2011-06-18 06:05:24 +000012 call void @llvm.memmove.p0i8.p0i8.i32(i8* bitcast ([500 x i32]* @from to i8*), i8* bitcast ([500 x i32]* @to to i8*), i32 500, i32 0, i1 false)
Renato Golin4cd51872011-05-22 21:41:23 +000013
14 ; CHECK: memcpy
15 ; EABI: __aeabi_memcpy
Chris Lattner80ed9dc2011-06-18 06:05:24 +000016 call void @llvm.memcpy.p0i8.p0i8.i32(i8* bitcast ([500 x i32]* @from to i8*), i8* bitcast ([500 x i32]* @to to i8*), i32 500, i32 0, i1 false)
Renato Golin4cd51872011-05-22 21:41:23 +000017
18 ; EABI memset swaps arguments
19 ; CHECK: mov r1, #0
20 ; CHECK: memset
21 ; EABI: mov r2, #0
22 ; EABI: __aeabi_memset
Chris Lattner80ed9dc2011-06-18 06:05:24 +000023 call void @llvm.memset.p0i8.i32(i8* bitcast ([500 x i32]* @from to i8*), i8 0, i32 500, i32 0, i1 false)
Tanya Lattnerf697c032008-02-17 20:02:20 +000024 unreachable
Rafael Espindolab5dee632006-12-05 17:57:23 +000025}
26
Chris Lattner80ed9dc2011-06-18 06:05:24 +000027declare void @llvm.memmove.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind
28declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind
29declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i32, i1) nounwind