Chris Lattner | 09c14c0 | 2012-06-01 05:03:31 +0000 | [diff] [blame] | 1 | ; RUN: llc < %s | FileCheck %s |
| 2 | target 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" |
| 3 | target triple = "x86_64-apple-darwin11.4.0" |
| 4 | |
| 5 | declare i64 @testi() |
| 6 | |
| 7 | define 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 | |
| 15 | define 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 Lattner | 5b0d946 | 2012-06-01 05:16:33 +0000 | [diff] [blame^] | 22 | |
| 23 | |
| 24 | ; Tail call shouldn't be blocked by no-op inttoptr. |
| 25 | define 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 | |
| 35 | declare <4 x float> @testv() |
| 36 | |
| 37 | define <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 |