blob: a0f478e119a3efa50c7bbd1ec5b1922c850d6906 [file] [log] [blame]
Venkatraman Govindaraju7d29ffb2011-01-12 03:18:21 +00001; RUN: llc -march=sparc -O0 <%s
Venkatraman Govindaraju3b73dea2013-10-09 12:50:39 +00002; RUN: llc -march=sparc <%s | FileCheck %s --check-prefix=V8
3; RUN: llc -march=sparcv9 <%s | FileCheck %s --check-prefix=V9
4
5; V8-LABEL: test
6; V8: save %sp
7; V8: call foo
8; V8-NEXT: nop
9; V8: call bar
10; V8-NEXT: nop
11; V8: jmp %i7+8
12; V8-NEXT: restore
13
14; V9-LABEL: test
15; V9: save %sp
16; V9: call foo
17; V9-NEXT: nop
18; V9: call bar
19; V9-NEXT: nop
20; V9: jmp %i7+8
21; V9-NEXT: restore
Venkatraman Govindaraju7d29ffb2011-01-12 03:18:21 +000022
23define void @test() nounwind {
24entry:
25 %0 = tail call i32 (...)* @foo() nounwind
26 tail call void (...)* @bar() nounwind
27 ret void
28}
29
30declare i32 @foo(...)
31
32declare void @bar(...)
33
Venkatraman Govindaraju3b73dea2013-10-09 12:50:39 +000034
35; V8-LABEL: test_tail_call_with_return
36; V8: save %sp
37; V8: call foo
38; V8-NEXT: nop
39; V8: jmp %i7+8
40; V8-NEXT: restore %g0, %o0, %o0
41
42; V9-LABEL: test_tail_call_with_return
43; V9: save %sp
44; V9: call foo
45; V9-NEXT: nop
46; V9: jmp %i7+8
47; V9-NEXT: restore %g0, %o0, %o0
48
49define i32 @test_tail_call_with_return() nounwind {
50entry:
51 %0 = tail call i32 (...)* @foo() nounwind
52 ret i32 %0
53}