summaryrefslogtreecommitdiff
path: root/test/CodeGen/AArch64/tailcall-ccmismatch.ll
blob: ab96e609dd468c36522fe0a87d765c440d5000a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
; RUN: llc -o - %s | FileCheck %s
target triple="aarch64--"

declare void @somefunc()
define preserve_mostcc void @test_ccmismatch_notail() {
; Ensure that no tail call is used here, as the called function somefunc does
; not preserve enough registers for preserve_mostcc.
; CHECK-LABEL: test_ccmismatch_notail:
; CHECK-NOT: b somefunc
; CHECK: bl somefunc
  tail call void @somefunc()
  ret void
}

declare preserve_mostcc void @some_preserve_most_func()
define void @test_ccmismatch_tail() {
; We can perform a tail call here, because some_preserve_most_func preserves
; all registers necessary for test_ccmismatch_tail.
; CHECK-LABEL: test_ccmismatch_tail:
; CHECK-NOT: bl some_preserve_most_func
; CHECK: b some_preserve_most_func
  tail call preserve_mostcc void @some_preserve_most_func()
  ret void
}