1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -O0 -o - | FileCheck %s 2*9880d681SAndroid Build Coastguard Workertarget datalayout = "e-m:o-p:32:32-f64:32:64-v64:32:64-v128:32:128-a:0:32-n32-S32" 3*9880d681SAndroid Build Coastguard Workertarget triple = "armv7s-apple-ios7" 4*9880d681SAndroid Build Coastguard Worker 5*9880d681SAndroid Build Coastguard Worker%foo = type <{ %Sf }> 6*9880d681SAndroid Build Coastguard Worker%Sf = type <{ float }> 7*9880d681SAndroid Build Coastguard Worker 8*9880d681SAndroid Build Coastguard Workerdeclare float @llvm.ceil.f32(float) 9*9880d681SAndroid Build Coastguard Worker 10*9880d681SAndroid Build Coastguard Worker; Check that we are not emitting a tail call for the last call to ceil. 11*9880d681SAndroid Build Coastguard Worker; This function returns three different results. 12*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: func1: 13*9880d681SAndroid Build Coastguard Worker; CHECK-NOT: b _ceilf 14*9880d681SAndroid Build Coastguard Worker; CHECK: pop 15*9880d681SAndroid Build Coastguard Workerdefine { float, float, float } @func1() { 16*9880d681SAndroid Build Coastguard Workerentry: 17*9880d681SAndroid Build Coastguard Worker %0 = alloca %foo, align 4 18*9880d681SAndroid Build Coastguard Worker %1 = alloca %foo, align 4 19*9880d681SAndroid Build Coastguard Worker %2 = alloca %foo, align 4 20*9880d681SAndroid Build Coastguard Worker %.native = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 21*9880d681SAndroid Build Coastguard Worker %.native.value = getelementptr inbounds %Sf, %Sf* %.native, i32 0, i32 0 22*9880d681SAndroid Build Coastguard Worker store float 0.000000e+00, float* %.native.value, align 4 23*9880d681SAndroid Build Coastguard Worker %.native1 = getelementptr inbounds %foo, %foo* %1, i32 0, i32 0 24*9880d681SAndroid Build Coastguard Worker %.native1.value = getelementptr inbounds %Sf, %Sf* %.native1, i32 0, i32 0 25*9880d681SAndroid Build Coastguard Worker store float 1.000000e+00, float* %.native1.value, align 4 26*9880d681SAndroid Build Coastguard Worker %.native2 = getelementptr inbounds %foo, %foo* %2, i32 0, i32 0 27*9880d681SAndroid Build Coastguard Worker %.native2.value = getelementptr inbounds %Sf, %Sf* %.native2, i32 0, i32 0 28*9880d681SAndroid Build Coastguard Worker store float 5.000000e+00, float* %.native2.value, align 4 29*9880d681SAndroid Build Coastguard Worker br i1 true, label %3, label %4 30*9880d681SAndroid Build Coastguard Worker 31*9880d681SAndroid Build Coastguard Worker; <label>:3 ; preds = %entry 32*9880d681SAndroid Build Coastguard Worker %.native4 = getelementptr inbounds %foo, %foo* %1, i32 0, i32 0 33*9880d681SAndroid Build Coastguard Worker %.native4.value = getelementptr inbounds %Sf, %Sf* %.native4, i32 0, i32 0 34*9880d681SAndroid Build Coastguard Worker store float 2.000000e+00, float* %.native4.value, align 4 35*9880d681SAndroid Build Coastguard Worker br label %4 36*9880d681SAndroid Build Coastguard Worker 37*9880d681SAndroid Build Coastguard Worker; <label>:4 ; preds = %3, %entry 38*9880d681SAndroid Build Coastguard Worker %5 = call float @llvm.ceil.f32(float 5.000000e+00) 39*9880d681SAndroid Build Coastguard Worker %.native3 = getelementptr inbounds %foo, %foo* %1, i32 0, i32 0 40*9880d681SAndroid Build Coastguard Worker %.native3.value = getelementptr inbounds %Sf, %Sf* %.native3, i32 0, i32 0 41*9880d681SAndroid Build Coastguard Worker %6 = load float, float* %.native3.value, align 4 42*9880d681SAndroid Build Coastguard Worker %7 = call float @llvm.ceil.f32(float %6) 43*9880d681SAndroid Build Coastguard Worker %8 = insertvalue { float, float, float } { float 0.000000e+00, float undef, float undef }, float %5, 1 44*9880d681SAndroid Build Coastguard Worker %9 = insertvalue { float, float, float } %8, float %7, 2 45*9880d681SAndroid Build Coastguard Worker ret { float, float, float } %9 46*9880d681SAndroid Build Coastguard Worker} 47*9880d681SAndroid Build Coastguard Worker 48*9880d681SAndroid Build Coastguard Worker; Check that we are not emitting a tail call for the last call to ceil. 49*9880d681SAndroid Build Coastguard Worker; This function returns two different results. 50*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: func2: 51*9880d681SAndroid Build Coastguard Worker; CHECK-NOT: b _ceilf 52*9880d681SAndroid Build Coastguard Worker; CHECK: pop 53*9880d681SAndroid Build Coastguard Workerdefine { float, float } @func2() { 54*9880d681SAndroid Build Coastguard Workerentry: 55*9880d681SAndroid Build Coastguard Worker %0 = alloca %foo, align 4 56*9880d681SAndroid Build Coastguard Worker %1 = alloca %foo, align 4 57*9880d681SAndroid Build Coastguard Worker %2 = alloca %foo, align 4 58*9880d681SAndroid Build Coastguard Worker %.native = getelementptr inbounds %foo, %foo* %0, i32 0, i32 0 59*9880d681SAndroid Build Coastguard Worker %.native.value = getelementptr inbounds %Sf, %Sf* %.native, i32 0, i32 0 60*9880d681SAndroid Build Coastguard Worker store float 0.000000e+00, float* %.native.value, align 4 61*9880d681SAndroid Build Coastguard Worker %.native1 = getelementptr inbounds %foo, %foo* %1, i32 0, i32 0 62*9880d681SAndroid Build Coastguard Worker %.native1.value = getelementptr inbounds %Sf, %Sf* %.native1, i32 0, i32 0 63*9880d681SAndroid Build Coastguard Worker store float 1.000000e+00, float* %.native1.value, align 4 64*9880d681SAndroid Build Coastguard Worker %.native2 = getelementptr inbounds %foo, %foo* %2, i32 0, i32 0 65*9880d681SAndroid Build Coastguard Worker %.native2.value = getelementptr inbounds %Sf, %Sf* %.native2, i32 0, i32 0 66*9880d681SAndroid Build Coastguard Worker store float 5.000000e+00, float* %.native2.value, align 4 67*9880d681SAndroid Build Coastguard Worker br i1 true, label %3, label %4 68*9880d681SAndroid Build Coastguard Worker 69*9880d681SAndroid Build Coastguard Worker; <label>:3 ; preds = %entry 70*9880d681SAndroid Build Coastguard Worker %.native4 = getelementptr inbounds %foo, %foo* %1, i32 0, i32 0 71*9880d681SAndroid Build Coastguard Worker %.native4.value = getelementptr inbounds %Sf, %Sf* %.native4, i32 0, i32 0 72*9880d681SAndroid Build Coastguard Worker store float 2.000000e+00, float* %.native4.value, align 4 73*9880d681SAndroid Build Coastguard Worker br label %4 74*9880d681SAndroid Build Coastguard Worker 75*9880d681SAndroid Build Coastguard Worker; <label>:4 ; preds = %3, %entry 76*9880d681SAndroid Build Coastguard Worker %5 = call float @llvm.ceil.f32(float 5.000000e+00) 77*9880d681SAndroid Build Coastguard Worker %.native3 = getelementptr inbounds %foo, %foo* %1, i32 0, i32 0 78*9880d681SAndroid Build Coastguard Worker %.native3.value = getelementptr inbounds %Sf, %Sf* %.native3, i32 0, i32 0 79*9880d681SAndroid Build Coastguard Worker %6 = load float, float* %.native3.value, align 4 80*9880d681SAndroid Build Coastguard Worker %7 = call float @llvm.ceil.f32(float %6) 81*9880d681SAndroid Build Coastguard Worker %8 = insertvalue { float, float } { float 0.000000e+00, float undef }, float %7, 1 82*9880d681SAndroid Build Coastguard Worker ret { float, float } %8 83*9880d681SAndroid Build Coastguard Worker} 84*9880d681SAndroid Build Coastguard Worker 85