blob: 72c59ad85c487eb93e3e8581a0f2dafeb1d309d5 [file]
; The "target-abi" module flag selects the ABI used for codegen. APCS uses
; 4-byte stack alignment while AAPCS uses 8-byte alignment, which is observable
; in the emitted prologue. AAPCS also selects .init_array over .ctors. The flag
; drives both with no -target-abi option.
; RUN: split-file %s %t
; RUN: llc -mtriple=armv7-none-eabi -filetype=asm < %t/apcs.ll | FileCheck %s --check-prefix=APCS
; RUN: llc -mtriple=armv7-none-eabi -filetype=asm < %t/aapcs.ll | FileCheck %s --check-prefix=AAPCS
;--- apcs.ll
; APCS: push {lr}
; APCS: sub sp, sp, #4
; APCS: .section .ctors,"aw",%progbits
declare void @use(ptr)
define void @f() {
%a = alloca i32
call void @use(ptr %a)
ret void
}
define void @ctor() {
ret void
}
@llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 65535, ptr @ctor, ptr null }]
!llvm.module.flags = !{!0}
!0 = !{i32 1, !"target-abi", !"apcs"}
;--- aapcs.ll
; AAPCS: push {r11, lr}
; AAPCS: sub sp, sp, #8
; AAPCS: .section .init_array,"aw",%init_array
declare void @use(ptr)
define void @f() {
%a = alloca i32
call void @use(ptr %a)
ret void
}
define void @ctor() {
ret void
}
@llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 65535, ptr @ctor, ptr null }]
!llvm.module.flags = !{!0}
!0 = !{i32 1, !"target-abi", !"aapcs"}