[Instrumentation] Fix a warning
[llvm-project.git] / llvm / test / CodeGen / AArch64 / tailcall-ccmismatch.ll
blob64a5fad59e978f0b22570f820d2866d5dc503b4e
1 ; RUN: llc -o - %s | FileCheck %s
2 ; RUN: llc -global-isel -verify-machineinstrs -o - %s | FileCheck %s
3 target triple="aarch64--"
5 declare void @somefunc()
6 define preserve_mostcc void @test_ccmismatch_notail() {
7 ; Ensure that no tail call is used here, as the called function somefunc does
8 ; not preserve enough registers for preserve_mostcc.
9 ; CHECK-LABEL: test_ccmismatch_notail:
10 ; CHECK-NOT: b somefunc
11 ; CHECK: bl somefunc
12   tail call void @somefunc()
13   ret void
16 declare preserve_mostcc void @some_preserve_most_func()
17 define void @test_ccmismatch_tail() {
18 ; We can perform a tail call here, because some_preserve_most_func preserves
19 ; all registers necessary for test_ccmismatch_tail.
20 ; CHECK-LABEL: test_ccmismatch_tail:
21 ; CHECK-NOT: bl some_preserve_most_func
22 ; CHECK: b some_preserve_most_func
23   tail call preserve_mostcc void @some_preserve_most_func()
24   ret void