blob: 8d3800b43c14172044943f31e04cfbd8f7d0723f [file] [log] [blame]
Eli Friedman575d0162011-06-16 01:49:31 +00001; RUN: llc < %s -mtriple=armv7-apple-ios -o - | FileCheck %s
Tim Northoverd6a729b2014-01-06 14:28:05 +00002; RUN: llc < %s -mtriple=thumbv7m-none-macho -o - | FileCheck %s --check-prefix=DARWIN
Renato Golin4cd51872011-05-22 21:41:23 +00003; RUN: llc < %s -mtriple=arm-none-eabi -o - | FileCheck --check-prefix=EABI %s
Joerg Sonnenberger8fe41b72013-12-16 18:51:28 +00004; RUN: llc < %s -mtriple=arm-none-eabihf -o - | FileCheck --check-prefix=EABI %s
Renato Golin4cd51872011-05-22 21:41:23 +00005
6@from = common global [500 x i32] zeroinitializer, align 4
7@to = common global [500 x i32] zeroinitializer, align 4
Rafael Espindolab5dee632006-12-05 17:57:23 +00008
Tanya Lattnerf697c032008-02-17 20:02:20 +00009define void @f() {
Rafael Espindolab5dee632006-12-05 17:57:23 +000010entry:
Renato Golin4cd51872011-05-22 21:41:23 +000011
12 ; CHECK: memmove
13 ; EABI: __aeabi_memmove
Chris Lattner80ed9dc2011-06-18 06:05:24 +000014 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 +000015
16 ; CHECK: memcpy
17 ; EABI: __aeabi_memcpy
Chris Lattner80ed9dc2011-06-18 06:05:24 +000018 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 +000019
20 ; EABI memset swaps arguments
21 ; CHECK: mov r1, #0
22 ; CHECK: memset
Evan Cheng0460ae82012-02-21 20:46:00 +000023 ; DARWIN: movs r1, #0
24 ; DARWIN: memset
Renato Golin4cd51872011-05-22 21:41:23 +000025 ; EABI: mov r2, #0
26 ; EABI: __aeabi_memset
Chris Lattner80ed9dc2011-06-18 06:05:24 +000027 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 +000028 unreachable
Rafael Espindolab5dee632006-12-05 17:57:23 +000029}
30
Chris Lattner80ed9dc2011-06-18 06:05:24 +000031declare void @llvm.memmove.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind
32declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind
33declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i32, i1) nounwind