brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.1 KiB · b27aa63 Raw
65 lines · plain
1; RUN: llc < %s -O0 -o - | FileCheck %s2target datalayout = "e-m:o-p:32:32-f64:32:64-v64:32:64-v128:32:128-a:0:32-n32-S32"3target triple = "armv7s-apple-ios7"4 5%foo = type <{ %Sf }>6%Sf = type <{ float }>7 8declare float @llvm.ceil.f32(float) 9 10; Check that we are not emitting a tail call for the last call to ceil.11; This function returns three different results.12; CHECK-LABEL: func1:13; CHECK-NOT: b _ceilf14; CHECK: pop15define { float, float, float } @func1() {16entry:17  %0 = alloca %foo, align 418  %1 = alloca %foo, align 419  %2 = alloca %foo, align 420  store float 0.000000e+00, ptr %0, align 421  store float 1.000000e+00, ptr %1, align 422  store float 5.000000e+00, ptr %2, align 423  br i1 true, label %3, label %424 25; <label>:3                                       ; preds = %entry26  store float 2.000000e+00, ptr %1, align 427  br label %428 29; <label>:4                                       ; preds = %3, %entry30  %5 = call float @llvm.ceil.f32(float 5.000000e+00)31  %6 = load float, ptr %1, align 432  %7 = call float @llvm.ceil.f32(float %6)33  %8 = insertvalue { float, float, float } { float 0.000000e+00, float undef, float undef }, float %5, 134  %9 = insertvalue { float, float, float } %8, float %7, 235  ret { float, float, float } %936}37 38; Check that we are not emitting a tail call for the last call to ceil.39; This function returns two different results.40; CHECK-LABEL: func2:41; CHECK-NOT: b _ceilf42; CHECK: pop43define { float, float } @func2() {44entry:45  %0 = alloca %foo, align 446  %1 = alloca %foo, align 447  %2 = alloca %foo, align 448  store float 0.000000e+00, ptr %0, align 449  store float 1.000000e+00, ptr %1, align 450  store float 5.000000e+00, ptr %2, align 451  br i1 true, label %3, label %452 53; <label>:3                                       ; preds = %entry54  store float 2.000000e+00, ptr %1, align 455  br label %456 57; <label>:4                                       ; preds = %3, %entry58  %5 = call float @llvm.ceil.f32(float 5.000000e+00)59  %6 = load float, ptr %1, align 460  %7 = call float @llvm.ceil.f32(float %6)61  %8 = insertvalue { float, float } { float 0.000000e+00, float undef }, float %7, 162  ret { float, float } %863}64 65