-; RUN: llc < %s -mtriple=armv7-apple-ios -disable-post-ra -o - | FileCheck %s --check-prefix=CHECK-IOS --check-prefix=CHECK
-; RUN: llc < %s -mtriple=thumbv7m-none-macho -disable-post-ra -o - | FileCheck %s --check-prefix=CHECK-DARWIN --check-prefix=CHECK
-; RUN: llc < %s -mtriple=arm-none-eabi -disable-post-ra -o - | FileCheck %s --check-prefix=CHECK-EABI --check-prefix=CHECK
-; RUN: llc < %s -mtriple=arm-none-eabihf -disable-post-ra -o - | FileCheck %s --check-prefix=CHECK-EABI --check-prefix=CHECK
+; RUN: llc < %s -mtriple=armv7-apple-ios -disable-post-ra -o - | FileCheck %s --check-prefix=CHECK-IOS
+; RUN: llc < %s -mtriple=thumbv7m-none-macho -disable-post-ra -o - | FileCheck %s --check-prefix=CHECK-DARWIN
+; RUN: llc < %s -mtriple=arm-none-eabi -disable-post-ra -o - | FileCheck %s --check-prefix=CHECK-EABI
+; RUN: llc < %s -mtriple=arm-none-eabihf -disable-post-ra -o - | FileCheck %s --check-prefix=CHECK-EABI
+; RUN: llc < %s -mtriple=arm-none-androideabi -disable-post-ra -o - | FileCheck %s --check-prefix=CHECK-EABI
+; RUN: llc < %s -mtriple=arm-none-gnueabi -disable-post-ra -o - | FileCheck %s --check-prefix=CHECK-GNUEABI
+; RUN: llc < %s -mtriple=arm-none-gnueabihf -disable-post-ra -o - | FileCheck %s --check-prefix=CHECK-GNUEABI
define void @f1(i8* %dest, i8* %src) {
entry:
; CHECK-LABEL: f1
- ; CHECK-IOS: memmove
- ; CHECK-DARWIN: memmove
- ; CHECK-EABI: __aeabi_memmove
+ ; CHECK-IOS: bl _memmove
+ ; CHECK-DARWIN: bl _memmove
+ ; CHECK-EABI: bl __aeabi_memmove
+ ; CHECK-GNUEABI: bl memmove
call void @llvm.memmove.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 500, i32 0, i1 false)
- ; CHECK-IOS: memcpy
- ; CHECK-DARWIN: memcpy
- ; CHECK-EABI: __aeabi_memcpy
+ ; CHECK-IOS: bl _memcpy
+ ; CHECK-DARWIN: bl _memcpy
+ ; CHECK-EABI: bl __aeabi_memcpy
+ ; CHECK-GNUEABI: bl memcpy
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 500, i32 0, i1 false)
; EABI memset swaps arguments
; CHECK-IOS: mov r1, #1
- ; CHECK-IOS: memset
+ ; CHECK-IOS: bl _memset
; CHECK-DARWIN: movs r1, #1
- ; CHECK-DARWIN: memset
+ ; CHECK-DARWIN: bl _memset
; CHECK-EABI: mov r2, #1
- ; CHECK-EABI: __aeabi_memset
+ ; CHECK-EABI: bl __aeabi_memset
+ ; CHECK-GNUEABI: mov r1, #1
+ ; CHECK-GNUEABI: bl memset
call void @llvm.memset.p0i8.i32(i8* %dest, i8 1, i32 500, i32 0, i1 false)
; EABI uses memclr if value set to 0
; CHECK-IOS: mov r1, #0
- ; CHECK-IOS: memset
+ ; CHECK-IOS: bl _memset
; CHECK-DARWIN: movs r1, #0
- ; CHECK-DARWIN: memset
- ; CHECK-EABI: __aeabi_memclr
+ ; CHECK-DARWIN: bl _memset
+ ; CHECK-EABI: bl __aeabi_memclr
+ ; CHECK-GNUEABI: bl memset
call void @llvm.memset.p0i8.i32(i8* %dest, i8 0, i32 500, i32 0, i1 false)
-
+
; EABI uses aligned function variants if possible
- ; CHECK-IOS: memmove
- ; CHECK-DARWIN: memmove
- ; CHECK-EABI: __aeabi_memmove4
+ ; CHECK-IOS: bl _memmove
+ ; CHECK-DARWIN: bl _memmove
+ ; CHECK-EABI: bl __aeabi_memmove4
+ ; CHECK-GNUEABI: bl memmove
call void @llvm.memmove.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 500, i32 4, i1 false)
- ; CHECK-IOS: memcpy
- ; CHECK-DARWIN: memcpy
- ; CHECK-EABI: __aeabi_memcpy4
+ ; CHECK-IOS: bl _memcpy
+ ; CHECK-DARWIN: bl _memcpy
+ ; CHECK-EABI: bl __aeabi_memcpy4
+ ; CHECK-GNUEABI: bl memcpy
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 500, i32 4, i1 false)
- ; CHECK-IOS: memset
- ; CHECK-DARWIN: memset
- ; CHECK-EABI: __aeabi_memset4
+ ; CHECK-IOS: bl _memset
+ ; CHECK-DARWIN: bl _memset
+ ; CHECK-EABI: bl __aeabi_memset4
+ ; CHECK-GNUEABI: bl memset
call void @llvm.memset.p0i8.i32(i8* %dest, i8 1, i32 500, i32 4, i1 false)
- ; CHECK-IOS: memset
- ; CHECK-DARWIN: memset
- ; CHECK-EABI: __aeabi_memclr4
+ ; CHECK-IOS: bl _memset
+ ; CHECK-DARWIN: bl _memset
+ ; CHECK-EABI: bl __aeabi_memclr4
+ ; CHECK-GNUEABI: bl memset
call void @llvm.memset.p0i8.i32(i8* %dest, i8 0, i32 500, i32 4, i1 false)
- ; CHECK-IOS: memmove
- ; CHECK-DARWIN: memmove
- ; CHECK-EABI: __aeabi_memmove8
+ ; CHECK-IOS: bl _memmove
+ ; CHECK-DARWIN: bl _memmove
+ ; CHECK-EABI: bl __aeabi_memmove8
+ ; CHECK-GNUEABI: bl memmove
call void @llvm.memmove.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 500, i32 8, i1 false)
- ; CHECK-IOS: memcpy
- ; CHECK-DARWIN: memcpy
- ; CHECK-EABI: __aeabi_memcpy8
+ ; CHECK-IOS: bl _memcpy
+ ; CHECK-DARWIN: bl _memcpy
+ ; CHECK-EABI: bl __aeabi_memcpy8
+ ; CHECK-GNUEABI: bl memcpy
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 500, i32 8, i1 false)
- ; CHECK-IOS: memset
- ; CHECK-DARWIN: memset
- ; CHECK-EABI: __aeabi_memset8
+ ; CHECK-IOS: bl _memset
+ ; CHECK-DARWIN: bl _memset
+ ; CHECK-EABI: bl __aeabi_memset8
+ ; CHECK-GNUEABI: bl memset
call void @llvm.memset.p0i8.i32(i8* %dest, i8 1, i32 500, i32 8, i1 false)
- ; CHECK-IOS: memset
- ; CHECK-DARWIN: memset
- ; CHECK-EABI: __aeabi_memclr8
+ ; CHECK-IOS: bl _memset
+ ; CHECK-DARWIN: bl _memset
+ ; CHECK-EABI: bl __aeabi_memclr8
+ ; CHECK-GNUEABI: bl memset
call void @llvm.memset.p0i8.i32(i8* %dest, i8 0, i32 500, i32 8, i1 false)
unreachable
; IOS (ARMv7) should 8-byte align, others should 4-byte align
; CHECK-IOS: add r1, sp, #32
- ; CHECK-IOS: memmove
+ ; CHECK-IOS: bl _memmove
; CHECK-DARWIN: add r1, sp, #28
- ; CHECK-DARWIN: memmove
+ ; CHECK-DARWIN: bl _memmove
; CHECK-EABI: add r1, sp, #28
- ; CHECK-EABI: __aeabi_memmove
+ ; CHECK-EABI: bl __aeabi_memmove
+ ; CHECK-GNUEABI: add r1, sp, #28
+ ; CHECK-GNUEABI: bl memmove
%arr0 = alloca [9 x i8], align 1
%0 = bitcast [9 x i8]* %arr0 to i8*
call void @llvm.memmove.p0i8.p0i8.i32(i8* %dest, i8* %0, i32 %n, i32 0, i1 false)
; CHECK: add r1, sp, #16
- ; CHECK-IOS: memcpy
- ; CHECK-DARWIN: memcpy
- ; CHECK-EABI: __aeabi_memcpy
+ ; CHECK-IOS: bl _memcpy
+ ; CHECK-DARWIN: bl _memcpy
+ ; CHECK-EABI: bl __aeabi_memcpy
+ ; CHECK-GNUEABI: bl memcpy
%arr1 = alloca [9 x i8], align 1
%1 = bitcast [9 x i8]* %arr1 to i8*
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %1, i32 %n, i32 0, i1 false)
; CHECK-IOS: mov r0, sp
; CHECK-IOS: mov r1, #1
- ; CHECK-IOS: memset
+ ; CHECK-IOS: bl _memset
; CHECK-DARWIN: add r0, sp, #4
; CHECK-DARWIN: movs r1, #1
- ; CHECK-DARWIN: memset
+ ; CHECK-DARWIN: bl _memset
; CHECK-EABI: add r0, sp, #4
; CHECK-EABI: mov r2, #1
- ; CHECK-EABI: __aeabi_memset
+ ; CHECK-EABI: bl __aeabi_memset
+ ; CHECK-GNUEABI: add r0, sp, #4
+ ; CHECK-GNUEABI: mov r1, #1
+ ; CHECK-GNUEABI: bl memset
%arr2 = alloca [9 x i8], align 1
%2 = bitcast [9 x i8]* %arr2 to i8*
call void @llvm.memset.p0i8.i32(i8* %2, i8 1, i32 %n, i32 0, i1 false)
; CHECK-LABEL: f3
; CHECK: {{add(.w)? r1, sp, #17|sub(.w)? r1, r7, #15}}
- ; CHECK-IOS: memmove
- ; CHECK-DARWIN: memmove
- ; CHECK-EABI: __aeabi_memmove
+ ; CHECK-IOS: bl _memmove
+ ; CHECK-DARWIN: bl _memmove
+ ; CHECK-EABI: bl __aeabi_memmove
+ ; CHECK-GNUEABI: bl memmove
%arr0 = alloca [7 x i8], align 1
%0 = bitcast [7 x i8]* %arr0 to i8*
call void @llvm.memmove.p0i8.p0i8.i32(i8* %dest, i8* %0, i32 %n, i32 0, i1 false)
; CHECK: {{add(.w)? r1, sp, #10}}
- ; CHECK-IOS: memcpy
- ; CHECK-DARWIN: memcpy
- ; CHECK-EABI: __aeabi_memcpy
+ ; CHECK-IOS: bl _memcpy
+ ; CHECK-DARWIN: bl _memcpy
+ ; CHECK-EABI: bl __aeabi_memcpy
+ ; CHECK-GNUEABI: bl memcpy
%arr1 = alloca [7 x i8], align 1
%1 = bitcast [7 x i8]* %arr1 to i8*
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %1, i32 %n, i32 0, i1 false)
; CHECK: {{add(.w)? r0, sp, #3}}
; CHECK-IOS: mov r1, #1
- ; CHECK-IOS: memset
+ ; CHECK-IOS: bl _memset
; CHECK-DARWIN: movs r1, #1
- ; CHECK-DARWIN: memset
+ ; CHECK-DARWIN: bl _memset
; CHECK-EABI: mov r2, #1
- ; CHECK-EABI: __aeabi_memset
+ ; CHECK-EABI: bl __aeabi_memset
+ ; CHECK-GNUEABI: mov r1, #1
+ ; CHECK-GNUEABI: bl memset
%arr2 = alloca [7 x i8], align 1
%2 = bitcast [7 x i8]* %arr2 to i8*
call void @llvm.memset.p0i8.i32(i8* %2, i8 1, i32 %n, i32 0, i1 false)
; CHECK-LABEL: f4
; CHECK: {{add(.w)? r., sp, #23|sub(.w)? r., r7, #17}}
- ; CHECK-IOS: memmove
- ; CHECK-DARWIN: memmove
- ; CHECK-EABI: __aeabi_memmove
+ ; CHECK-IOS: bl _memmove
+ ; CHECK-DARWIN: bl _memmove
+ ; CHECK-EABI: bl __aeabi_memmove
+ ; CHECK-GNUEABI: bl memmove
%arr0 = alloca [9 x i8], align 1
%0 = getelementptr inbounds [9 x i8], [9 x i8]* %arr0, i32 0, i32 4
call void @llvm.memmove.p0i8.p0i8.i32(i8* %dest, i8* %0, i32 %n, i32 0, i1 false)
; CHECK: {{add(.w)? r., sp, #(10|14)}}
- ; CHECK-IOS: memcpy
- ; CHECK-DARWIN: memcpy
- ; CHECK-EABI: __aeabi_memcpy
+ ; CHECK-IOS: bl _memcpy
+ ; CHECK-DARWIN: bl _memcpy
+ ; CHECK-EABI: bl __aeabi_memcpy
+ ; CHECK-GNUEABI: bl memcpy
%arr1 = alloca [9 x i8], align 1
%1 = getelementptr inbounds [9 x i8], [9 x i8]* %arr1, i32 0, i32 4
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %1, i32 %n, i32 0, i1 false)
; CHECK: {{add(.w)? r., sp, #(1|5)}}
; CHECK-IOS: mov r1, #1
- ; CHECK-IOS: memset
+ ; CHECK-IOS: bl _memset
; CHECK-DARWIN: movs r1, #1
- ; CHECK-DARWIN: memset
+ ; CHECK-DARWIN: bl _memset
; CHECK-EABI: mov r2, #1
- ; CHECK-EABI: __aeabi_memset
+ ; CHECK-EABI: bl __aeabi_memset
+ ; CHECK-GNUEABI: mov r1, #1
+ ; CHECK-GNUEABI: bl memset
%arr2 = alloca [9 x i8], align 1
%2 = getelementptr inbounds [9 x i8], [9 x i8]* %arr2, i32 0, i32 4
call void @llvm.memset.p0i8.i32(i8* %2, i8 1, i32 %n, i32 0, i1 false)
; CHECK-LABEL: f5
; CHECK: {{add(.w)? r., sp, #27|sub(.w)? r., r7, #21}}
- ; CHECK-IOS: memmove
- ; CHECK-DARWIN: memmove
- ; CHECK-EABI: __aeabi_memmove
+ ; CHECK-IOS: bl _memmove
+ ; CHECK-DARWIN: bl _memmove
+ ; CHECK-EABI: bl __aeabi_memmove
+ ; CHECK-GNUEABI: bl memmove
%arr0 = alloca [13 x i8], align 1
%0 = getelementptr inbounds [13 x i8], [13 x i8]* %arr0, i32 0, i32 1
call void @llvm.memmove.p0i8.p0i8.i32(i8* %dest, i8* %0, i32 %n, i32 0, i1 false)
; CHECK: {{add(.w)? r., sp, #(10|14)}}
- ; CHECK-IOS: memcpy
- ; CHECK-DARWIN: memcpy
- ; CHECK-EABI: __aeabi_memcpy
+ ; CHECK-IOS: bl _memcpy
+ ; CHECK-DARWIN: bl _memcpy
+ ; CHECK-EABI: bl __aeabi_memcpy
+ ; CHECK-GNUEABI: bl memcpy
%arr1 = alloca [13 x i8], align 1
%1 = getelementptr inbounds [13 x i8], [13 x i8]* %arr1, i32 0, i32 1
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %1, i32 %n, i32 0, i1 false)
; CHECK: {{add(.w)? r., sp, #(1|5)}}
; CHECK-IOS: mov r1, #1
- ; CHECK-IOS: memset
+ ; CHECK-IOS: bl _memset
; CHECK-DARWIN: movs r1, #1
- ; CHECK-DARWIN: memset
+ ; CHECK-DARWIN: bl _memset
; CHECK-EABI: mov r2, #1
- ; CHECK-EABI: __aeabi_memset
+ ; CHECK-EABI: bl __aeabi_memset
+ ; CHECK-GNUEABI: mov r1, #1
+ ; CHECK-GNUEABI: bl memset
%arr2 = alloca [13 x i8], align 1
%2 = getelementptr inbounds [13 x i8], [13 x i8]* %arr2, i32 0, i32 1
call void @llvm.memset.p0i8.i32(i8* %2, i8 1, i32 %n, i32 0, i1 false)
; CHECK-LABEL: f6
; CHECK: {{add(.w)? r., sp, #27|sub(.w)? r., r7, #25}}
- ; CHECK-IOS: memmove
- ; CHECK-DARWIN: memmove
- ; CHECK-EABI: __aeabi_memmove
+ ; CHECK-IOS: bl _memmove
+ ; CHECK-DARWIN: bl _memmove
+ ; CHECK-EABI: bl __aeabi_memmove
+ ; CHECK-GNUEABI: bl memmove
%arr0 = alloca [13 x i8], align 1
%0 = getelementptr inbounds [13 x i8], [13 x i8]* %arr0, i32 0, i32 %i
call void @llvm.memmove.p0i8.p0i8.i32(i8* %dest, i8* %0, i32 %n, i32 0, i1 false)
; CHECK: {{add(.w)? r., sp, #(10|14)}}
- ; CHECK-IOS: memcpy
- ; CHECK-DARWIN: memcpy
- ; CHECK-EABI: __aeabi_memcpy
+ ; CHECK-IOS: bl _memcpy
+ ; CHECK-DARWIN: bl _memcpy
+ ; CHECK-EABI: bl __aeabi_memcpy
+ ; CHECK-GNUEABI: bl memcpy
%arr1 = alloca [13 x i8], align 1
%1 = getelementptr inbounds [13 x i8], [13 x i8]* %arr1, i32 0, i32 %i
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %1, i32 %n, i32 0, i1 false)
; CHECK: {{add(.w)? r., sp, #(1|5)}}
; CHECK-IOS: mov r1, #1
- ; CHECK-IOS: memset
+ ; CHECK-IOS: bl _memset
; CHECK-DARWIN: movs r1, #1
- ; CHECK-DARWIN: memset
+ ; CHECK-DARWIN: bl _memset
; CHECK-EABI: mov r2, #1
- ; CHECK-EABI: __aeabi_memset
+ ; CHECK-EABI: bl __aeabi_memset
+ ; CHECK-GNUEABI: mov r1, #1
+ ; CHECK-GNUEABI: bl memset
%arr2 = alloca [13 x i8], align 1
%2 = getelementptr inbounds [13 x i8], [13 x i8]* %arr2, i32 0, i32 %i
call void @llvm.memset.p0i8.i32(i8* %2, i8 1, i32 %n, i32 0, i1 false)
; CHECK-LABEL: f7
; CHECK: {{add(.w)? r., sp, #27|sub(.w)? r., r7, #21}}
- ; CHECK-IOS: memmove
- ; CHECK-DARWIN: memmove
- ; CHECK-EABI: __aeabi_memmove
+ ; CHECK-IOS: bl _memmove
+ ; CHECK-DARWIN: bl _memmove
+ ; CHECK-EABI: bl __aeabi_memmove
+ ; CHECK-GNUEABI: bl memmove
%arr0 = alloca [13 x i8], align 1
%0 = getelementptr [13 x i8], [13 x i8]* %arr0, i32 0, i32 4
call void @llvm.memmove.p0i8.p0i8.i32(i8* %dest, i8* %0, i32 %n, i32 0, i1 false)
; CHECK: {{add(.w)? r., sp, #(10|14)}}
- ; CHECK-IOS: memcpy
- ; CHECK-DARWIN: memcpy
- ; CHECK-EABI: __aeabi_memcpy
+ ; CHECK-IOS: bl _memcpy
+ ; CHECK-DARWIN: bl _memcpy
+ ; CHECK-EABI: bl __aeabi_memcpy
+ ; CHECK-GNUEABI: bl memcpy
%arr1 = alloca [13 x i8], align 1
%1 = getelementptr [13 x i8], [13 x i8]* %arr1, i32 0, i32 4
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %1, i32 %n, i32 0, i1 false)
; CHECK: {{add(.w)? r., sp, #(1|5)}}
; CHECK-IOS: mov r1, #1
- ; CHECK-IOS: memset
+ ; CHECK-IOS: bl _memset
; CHECK-DARWIN: movs r1, #1
- ; CHECK-DARWIN: memset
+ ; CHECK-DARWIN: bl _memset
; CHECK-EABI: mov r2, #1
- ; CHECK-EABI: __aeabi_memset
+ ; CHECK-EABI: bl __aeabi_memset
+ ; CHECK-GNUEABI: mov r1, #1
+ ; CHECK-GNUEABI: bl memset
%arr2 = alloca [13 x i8], align 1
%2 = getelementptr [13 x i8], [13 x i8]* %arr2, i32 0, i32 4
call void @llvm.memset.p0i8.i32(i8* %2, i8 1, i32 %n, i32 0, i1 false)
; CHECK-LABEL: f8
; CHECK: {{add(.w)? r., sp, #27|sub(.w)? r., r7, #21}}
- ; CHECK-IOS: memmove
- ; CHECK-DARWIN: memmove
- ; CHECK-EABI: __aeabi_memmove
+ ; CHECK-IOS: bl _memmove
+ ; CHECK-DARWIN: bl _memmove
+ ; CHECK-EABI: bl __aeabi_memmove
+ ; CHECK-GNUEABI: bl memmove
%arr0 = alloca [13 x i8], align 1
%0 = getelementptr inbounds [13 x i8], [13 x i8]* %arr0, i32 0, i32 16
call void @llvm.memmove.p0i8.p0i8.i32(i8* %dest, i8* %0, i32 %n, i32 0, i1 false)
; CHECK: {{add(.w)? r., sp, #(10|14)}}
- ; CHECK-IOS: memcpy
- ; CHECK-DARWIN: memcpy
- ; CHECK-EABI: __aeabi_memcpy
+ ; CHECK-IOS: bl _memcpy
+ ; CHECK-DARWIN: bl _memcpy
+ ; CHECK-EABI: bl __aeabi_memcpy
+ ; CHECK-GNUEABI: bl memcpy
%arr1 = alloca [13 x i8], align 1
%1 = getelementptr inbounds [13 x i8], [13 x i8]* %arr1, i32 0, i32 16
call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %1, i32 %n, i32 0, i1 false)
; CHECK: {{add(.w)? r., sp, #(1|5)}}
; CHECK-IOS: mov r1, #1
- ; CHECK-IOS: memset
+ ; CHECK-IOS: bl _memset
; CHECK-DARWIN: movs r1, #1
- ; CHECK-DARWIN: memset
+ ; CHECK-DARWIN: bl _memset
; CHECK-EABI: mov r2, #1
- ; CHECK-EABI: __aeabi_memset
+ ; CHECK-EABI: bl __aeabi_memset
+ ; CHECK-GNUEABI: mov r1, #1
+ ; CHECK-GNUEABI: bl memset
%arr2 = alloca [13 x i8], align 1
%2 = getelementptr inbounds [13 x i8], [13 x i8]* %arr2, i32 0, i32 16
call void @llvm.memset.p0i8.i32(i8* %2, i8 1, i32 %n, i32 0, i1 false)
; CHECK-IOS: .align 3
; CHECK-DARWIN: .align 2
; CHECK-EABI: .align 2
+; CHECK-GNUEABI: .align 2
; CHECK: arr2:
; CHECK: {{\.section.+foo,bar}}
; CHECK-NOT: .align