blob: 6b0916fc67580267ee99d262708ed2f77fdde3b6 [file] [log] [blame]
Evan Chenga6bff982010-01-30 01:22:00 +00001; RUN: llc < %s -march=x86 -asm-verbose=false | FileCheck %s -check-prefix=32
2; RUN: llc < %s -march=x86-64 -asm-verbose=false | FileCheck %s -check-prefix=64
Evan Chengb1712452010-01-27 06:25:16 +00003
Evan Cheng7096ae42010-01-29 06:45:59 +00004define void @t1(i32 %x) nounwind ssp {
Evan Chengb1712452010-01-27 06:25:16 +00005entry:
Evan Chenga6bff982010-01-30 01:22:00 +00006; 32: t1:
7; 32: jmp {{_?}}foo
8
9; 64: t1:
10; 64: jmp {{_?}}foo
Evan Chengb1712452010-01-27 06:25:16 +000011 tail call void @foo() nounwind
12 ret void
13}
14
15declare void @foo()
Evan Cheng7096ae42010-01-29 06:45:59 +000016
17define void @t2() nounwind ssp {
18entry:
Evan Chenga6bff982010-01-30 01:22:00 +000019; 32: t2:
20; 32: jmp {{_?}}foo2
21
22; 64: t2:
23; 64: jmp {{_?}}foo2
Evan Cheng7096ae42010-01-29 06:45:59 +000024 %0 = tail call i32 @foo2() nounwind
25 ret void
26}
27
28declare i32 @foo2()
29
30define void @t3() nounwind ssp {
31entry:
Evan Chenga6bff982010-01-30 01:22:00 +000032; 32: t3:
33; 32: jmp {{_?}}foo3
34
35; 64: t3:
36; 64: jmp {{_?}}foo3
Evan Cheng7096ae42010-01-29 06:45:59 +000037 %0 = tail call i32 @foo3() nounwind
38 ret void
39}
40
41declare i32 @foo3()
Evan Chenga6bff982010-01-30 01:22:00 +000042
43define void @t4(void (i32)* nocapture %x) nounwind ssp {
44entry:
45; 32: t4:
46; 32: call *
47; FIXME: gcc can generate a tailcall for this. But it's tricky.
48
49; 64: t4:
50; 64-NOT: call
51; 64: jmpq *
52 tail call void %x(i32 0) nounwind
53 ret void
54}
55
56define void @t5(void ()* nocapture %x) nounwind ssp {
57entry:
58; 32: t5:
59; 32-NOT: call
60; 32: jmpl *
61
62; 64: t5:
63; 64-NOT: call
64; 64: jmpq *
65 tail call void %x() nounwind
66 ret void
67}