1 ; 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
4 define void @t1(i32 %x) nounwind ssp {
11 tail call void @foo() nounwind
17 define void @t2() nounwind ssp {
24 %0 = tail call i32 @foo2() nounwind
30 define void @t3() nounwind ssp {
37 %0 = tail call i32 @foo3() nounwind
43 define void @t4(void (i32)* nocapture %x) nounwind ssp {
47 ; FIXME: gcc can generate a tailcall for this. But it's tricky.
52 tail call void %x(i32 0) nounwind
56 define void @t5(void ()* nocapture %x) nounwind ssp {
65 tail call void %x() nounwind
69 define i32 @t6(i32 %x) nounwind ssp {
78 %0 = icmp slt i32 %x, 10
79 br i1 %0, label %bb, label %bb1
82 %1 = add nsw i32 %x, -1
83 %2 = tail call i32 @t6(i32 %1) nounwind ssp
87 %3 = tail call i32 @bar(i32 %x) nounwind
93 define i32 @t7(i32 %a, i32 %b, i32 %c) nounwind ssp {
100 %0 = tail call i32 @bar2(i32 %a, i32 %b, i32 %c) nounwind
104 declare i32 @bar2(i32, i32, i32)
106 define signext i16 @t8() nounwind ssp {
109 ; 32: call {{_?}}bar3
112 ; 64: callq {{_?}}bar3
113 %0 = tail call signext i16 @bar3() nounwind ; <i16> [#uses=1]
117 declare signext i16 @bar3()
119 define signext i16 @t9(i32 (i32)* nocapture %x) nounwind ssp {
126 %0 = bitcast i32 (i32)* %x to i16 (i32)*
127 %1 = tail call signext i16 %0(i32 0) nounwind
131 define void @t10() nounwind ssp {
138 %0 = tail call i32 @foo4() noreturn nounwind
144 define i32 @t11(i32 %x, i32 %y, i32 %z.0, i32 %z.1, i32 %z.2) nounwind ssp {
145 ; In 32-bit mode, it's emitting a bunch of dead loads that are not being
146 ; eliminated currently.
149 ; 32-NOT: subl ${{[0-9]+}}, %esp
150 ; 32-NOT: addl ${{[0-9]+}}, %esp
154 ; 64-NOT: subq ${{[0-9]+}}, %esp
155 ; 64-NOT: addq ${{[0-9]+}}, %esp
158 %0 = icmp eq i32 %x, 0
159 br i1 %0, label %bb6, label %bb
162 %1 = tail call i32 @foo5(i32 %x, i32 %y, i32 %z.0, i32 %z.1, i32 %z.2) nounwind
169 declare i32 @foo5(i32, i32, i32, i32, i32)
171 %struct.t = type { i32, i32, i32, i32, i32 }
173 define i32 @t12(i32 %x, i32 %y, %struct.t* byval align 4 %z) nounwind ssp {
175 ; 32-NOT: subl ${{[0-9]+}}, %esp
176 ; 32-NOT: addl ${{[0-9]+}}, %esp
180 ; 64-NOT: subq ${{[0-9]+}}, %esp
181 ; 64-NOT: addq ${{[0-9]+}}, %esp
184 %0 = icmp eq i32 %x, 0
185 br i1 %0, label %bb2, label %bb
188 %1 = tail call i32 @foo6(i32 %x, i32 %y, %struct.t* byval align 4 %z) nounwind
195 declare i32 @foo6(i32, i32, %struct.t* byval align 4)