2014-05-24 12:50:23 +00:00
|
|
|
; RUN: llc -verify-machineinstrs < %s -mtriple=aarch64-none-linux-gnu -tailcallopt | FileCheck %s -check-prefix CHECK-TAIL
|
|
|
|
; RUN: llc -verify-machineinstrs < %s -mtriple=aarch64-none-linux-gnu | FileCheck %s
|
2013-01-31 12:12:40 +00:00
|
|
|
|
|
|
|
; Without tailcallopt fastcc still means the caller cleans up the
|
|
|
|
; stack, so try to make sure this is respected.
|
|
|
|
|
|
|
|
define fastcc void @func_stack0() {
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: func_stack0:
|
2014-05-24 12:50:23 +00:00
|
|
|
; CHECK: mov x29, sp
|
|
|
|
; CHECK-NEXT: sub sp, sp, #32
|
2014-05-15 01:33:17 +00:00
|
|
|
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-TAIL-LABEL: func_stack0:
|
2014-05-24 12:50:23 +00:00
|
|
|
; CHECK-TAIL: stp x29, x30, [sp, #-16]!
|
|
|
|
; CHECK-TAIL-NEXT: mov x29, sp
|
|
|
|
; CHECK-TAIL-NEXT: sub sp, sp, #32
|
2014-05-15 01:33:17 +00:00
|
|
|
|
2013-01-31 12:12:40 +00:00
|
|
|
|
|
|
|
call fastcc void @func_stack8([8 x i32] undef, i32 42)
|
|
|
|
; CHECK: bl func_stack8
|
|
|
|
; CHECK-NOT: sub sp, sp,
|
|
|
|
|
|
|
|
; CHECK-TAIL: bl func_stack8
|
|
|
|
; CHECK-TAIL: sub sp, sp, #16
|
|
|
|
|
|
|
|
|
|
|
|
call fastcc void @func_stack32([8 x i32] undef, i128 0, i128 9)
|
|
|
|
; CHECK: bl func_stack32
|
|
|
|
; CHECK-NOT: sub sp, sp,
|
|
|
|
|
2014-05-15 01:33:17 +00:00
|
|
|
|
2013-01-31 12:12:40 +00:00
|
|
|
; CHECK-TAIL: bl func_stack32
|
|
|
|
; CHECK-TAIL: sub sp, sp, #32
|
|
|
|
|
|
|
|
|
|
|
|
call fastcc void @func_stack0()
|
|
|
|
; CHECK: bl func_stack0
|
|
|
|
; CHECK-NOT: sub sp, sp
|
|
|
|
|
2014-05-15 01:33:17 +00:00
|
|
|
|
2013-01-31 12:12:40 +00:00
|
|
|
; CHECK-TAIL: bl func_stack0
|
|
|
|
; CHECK-TAIL-NOT: sub sp, sp
|
|
|
|
|
|
|
|
ret void
|
2014-05-24 12:50:23 +00:00
|
|
|
; CHECK: mov sp, x29
|
|
|
|
; CHECK-NEXT: ldp x29, x30, [sp], #16
|
2013-01-31 12:12:40 +00:00
|
|
|
; CHECK-NEXT: ret
|
|
|
|
|
2014-05-15 01:33:17 +00:00
|
|
|
|
2014-05-24 12:50:23 +00:00
|
|
|
; CHECK-TAIL: mov sp, x29
|
|
|
|
; CHECK-TAIL-NEXT: ldp x29, x30, [sp], #16
|
2013-01-31 12:12:40 +00:00
|
|
|
; CHECK-TAIL-NEXT: ret
|
|
|
|
}
|
|
|
|
|
|
|
|
define fastcc void @func_stack8([8 x i32], i32 %stacked) {
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: func_stack8:
|
2014-05-24 12:50:23 +00:00
|
|
|
; CHECK: stp x29, x30, [sp, #-16]!
|
|
|
|
; CHECK: mov x29, sp
|
|
|
|
; CHECK: sub sp, sp, #32
|
2013-01-31 12:12:40 +00:00
|
|
|
|
2014-05-15 01:33:17 +00:00
|
|
|
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-TAIL-LABEL: func_stack8:
|
2014-05-24 12:50:23 +00:00
|
|
|
; CHECK-TAIL: stp x29, x30, [sp, #-16]!
|
|
|
|
; CHECK-TAIL: mov x29, sp
|
|
|
|
; CHECK-TAIL: sub sp, sp, #32
|
2014-05-15 01:33:17 +00:00
|
|
|
|
2013-01-31 12:12:40 +00:00
|
|
|
|
|
|
|
call fastcc void @func_stack8([8 x i32] undef, i32 42)
|
|
|
|
; CHECK: bl func_stack8
|
|
|
|
; CHECK-NOT: sub sp, sp,
|
|
|
|
|
2014-05-15 01:33:17 +00:00
|
|
|
|
2013-01-31 12:12:40 +00:00
|
|
|
; CHECK-TAIL: bl func_stack8
|
|
|
|
; CHECK-TAIL: sub sp, sp, #16
|
|
|
|
|
|
|
|
|
|
|
|
call fastcc void @func_stack32([8 x i32] undef, i128 0, i128 9)
|
|
|
|
; CHECK: bl func_stack32
|
|
|
|
; CHECK-NOT: sub sp, sp,
|
|
|
|
|
2014-05-15 01:33:17 +00:00
|
|
|
|
2013-01-31 12:12:40 +00:00
|
|
|
; CHECK-TAIL: bl func_stack32
|
|
|
|
; CHECK-TAIL: sub sp, sp, #32
|
|
|
|
|
|
|
|
|
|
|
|
call fastcc void @func_stack0()
|
|
|
|
; CHECK: bl func_stack0
|
|
|
|
; CHECK-NOT: sub sp, sp
|
|
|
|
|
|
|
|
; CHECK-TAIL: bl func_stack0
|
|
|
|
; CHECK-TAIL-NOT: sub sp, sp
|
|
|
|
|
|
|
|
ret void
|
2014-05-24 12:50:23 +00:00
|
|
|
; CHECK: mov sp, x29
|
|
|
|
; CHECK-NEXT: ldp x29, x30, [sp], #16
|
2013-01-31 12:12:40 +00:00
|
|
|
; CHECK-NEXT: ret
|
|
|
|
|
2014-05-15 01:33:17 +00:00
|
|
|
|
2014-05-24 12:50:23 +00:00
|
|
|
; CHECK-TAIL: mov sp, x29
|
|
|
|
; CHECK-TAIL-NEXT: ldp x29, x30, [sp], #16
|
2013-01-31 12:12:40 +00:00
|
|
|
; CHECK-TAIL-NEXT: ret
|
|
|
|
}
|
|
|
|
|
|
|
|
define fastcc void @func_stack32([8 x i32], i128 %stacked0, i128 %stacked1) {
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-LABEL: func_stack32:
|
2014-05-24 12:50:23 +00:00
|
|
|
; CHECK: mov x29, sp
|
2014-05-15 01:33:17 +00:00
|
|
|
|
2013-07-14 06:24:09 +00:00
|
|
|
; CHECK-TAIL-LABEL: func_stack32:
|
2014-05-24 12:50:23 +00:00
|
|
|
; CHECK-TAIL: mov x29, sp
|
2014-05-15 01:33:17 +00:00
|
|
|
|
2013-01-31 12:12:40 +00:00
|
|
|
|
|
|
|
call fastcc void @func_stack8([8 x i32] undef, i32 42)
|
|
|
|
; CHECK: bl func_stack8
|
|
|
|
; CHECK-NOT: sub sp, sp,
|
|
|
|
|
|
|
|
; CHECK-TAIL: bl func_stack8
|
|
|
|
; CHECK-TAIL: sub sp, sp, #16
|
|
|
|
|
|
|
|
|
|
|
|
call fastcc void @func_stack32([8 x i32] undef, i128 0, i128 9)
|
|
|
|
; CHECK: bl func_stack32
|
|
|
|
; CHECK-NOT: sub sp, sp,
|
|
|
|
|
2014-05-15 01:33:17 +00:00
|
|
|
|
2013-01-31 12:12:40 +00:00
|
|
|
; CHECK-TAIL: bl func_stack32
|
|
|
|
; CHECK-TAIL: sub sp, sp, #32
|
|
|
|
|
|
|
|
|
|
|
|
call fastcc void @func_stack0()
|
|
|
|
; CHECK: bl func_stack0
|
|
|
|
; CHECK-NOT: sub sp, sp
|
|
|
|
|
2014-05-15 01:33:17 +00:00
|
|
|
|
2013-01-31 12:12:40 +00:00
|
|
|
; CHECK-TAIL: bl func_stack0
|
|
|
|
; CHECK-TAIL-NOT: sub sp, sp
|
|
|
|
|
|
|
|
ret void
|
2014-05-24 12:50:23 +00:00
|
|
|
; CHECK: mov sp, x29
|
|
|
|
; CHECK-NEXT: ldp x29, x30, [sp], #16
|
2013-01-31 12:12:40 +00:00
|
|
|
; CHECK-NEXT: ret
|
|
|
|
|
2014-05-24 12:50:23 +00:00
|
|
|
; CHECK-TAIL: mov sp, x29
|
|
|
|
; CHECK-TAIL-NEXT: ldp x29, x30, [sp], #16
|
2013-01-31 12:12:40 +00:00
|
|
|
; CHECK-TAIL-NEXT: ret
|
|
|
|
}
|