
Despite of a valid tail call opportunity, backends still may not generate a tail call or such lowering is not implemented yet. Check that lowering has happened instead of its possibility when generating G_ASSERT_ALIGN.
25 lines
730 B
LLVM
25 lines
730 B
LLVM
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
|
|
; RUN: llc -mtriple=x86_64-linux-gnu -global-isel < %s | FileCheck %s --check-prefix=X64
|
|
; RUN: llc -mtriple=i686-linux-gnu -global-isel < %s | FileCheck %s --check-prefix=X86
|
|
|
|
declare ptr @foo()
|
|
|
|
define ptr @aligned_tailcall() nounwind {
|
|
; X64-LABEL: aligned_tailcall:
|
|
; X64: # %bb.0: # %entry
|
|
; X64-NEXT: pushq %rax
|
|
; X64-NEXT: callq foo
|
|
; X64-NEXT: popq %rcx
|
|
; X64-NEXT: retq
|
|
;
|
|
; X86-LABEL: aligned_tailcall:
|
|
; X86: # %bb.0: # %entry
|
|
; X86-NEXT: subl $12, %esp
|
|
; X86-NEXT: calll foo
|
|
; X86-NEXT: addl $12, %esp
|
|
; X86-NEXT: retl
|
|
entry:
|
|
%call = tail call align 8 ptr @foo()
|
|
ret ptr %call
|
|
}
|