blob: a3ef2dc8ef48dc8ee77a92283b3807412c6ee83a [file] [log] [blame]
Chris Lattner09c14c02012-06-01 05:03:31 +00001; RUN: llc < %s | FileCheck %s
2target datalayout = "e-p:64:64:64-S128-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f16:16:16-f32:32:32-f64:64:64-f128:128:128-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
3target triple = "x86_64-apple-darwin11.4.0"
4
5declare i64 @testi()
6
7define i64 @test_trivial() {
8 %A = tail call i64 @testi()
9 ret i64 %A
10}
11; CHECK: test_trivial:
12; CHECK: jmp _testi ## TAILCALL
13
14
15define i64 @test_noop_bitcast() {
16 %A = tail call i64 @testi()
17 %B = bitcast i64 %A to i64
18 ret i64 %B
19}
20; CHECK: test_noop_bitcast:
21; CHECK: jmp _testi ## TAILCALL
Chris Lattner5b0d9462012-06-01 05:16:33 +000022
23
24; Tail call shouldn't be blocked by no-op inttoptr.
25define i8* @test_inttoptr() {
26 %A = tail call i64 @testi()
27 %B = inttoptr i64 %A to i8*
28 ret i8* %B
29}
30
31; CHECK: test_inttoptr:
32; CHECK: jmp _testi ## TAILCALL
33
34
35declare <4 x float> @testv()
36
37define <4 x i32> @test_vectorbitcast() {
38 %A = tail call <4 x float> @testv()
39 %B = bitcast <4 x float> %A to <4 x i32>
40 ret <4 x i32> %B
41}
42; CHECK: test_vectorbitcast:
43; CHECK: jmp _testv ## TAILCALL