Add 'musttail' marker to call instructions
[oota-llvm.git] / test / CodeGen / X86 / musttail.ll
1 ; RUN: llc -march=x86 < %s | FileCheck %s
2
3 ; FIXME: Eliminate this tail call at -O0, since musttail is a correctness
4 ; requirement.
5 ; RUN: not llc -march=x86 -O0 < %s
6
7 declare void @t1_callee(i8*)
8 define void @t1(i32* %a) {
9 ; CHECK-LABEL: t1:
10 ; CHECK: jmp {{_?}}t1_callee
11   %b = bitcast i32* %a to i8*
12   musttail call void @t1_callee(i8* %b)
13   ret void
14 }
15
16 declare i8* @t2_callee()
17 define i32* @t2() {
18 ; CHECK-LABEL: t2:
19 ; CHECK: jmp {{_?}}t2_callee
20   %v = musttail call i8* @t2_callee()
21   %w = bitcast i8* %v to i32*
22   ret i32* %w
23 }