1*9880d681SAndroid Build Coastguard Worker; RUN: llc -mtriple=mipsel-linux-gnu -march=mipsel -mattr=mips16 -relocation-model=pic < %s | FileCheck %s -check-prefix=picel 2*9880d681SAndroid Build Coastguard Worker 3*9880d681SAndroid Build Coastguard Worker@ptrsv = global float ()* @sv, align 4 4*9880d681SAndroid Build Coastguard Worker@ptrdv = global double ()* @dv, align 4 5*9880d681SAndroid Build Coastguard Worker@ptrscv = global { float, float } ()* @scv, align 4 6*9880d681SAndroid Build Coastguard Worker@ptrdcv = global { double, double } ()* @dcv, align 4 7*9880d681SAndroid Build Coastguard Worker@x = common global float 0.000000e+00, align 4 8*9880d681SAndroid Build Coastguard Worker@.str = private unnamed_addr constant [4 x i8] c"%f\0A\00", align 1 9*9880d681SAndroid Build Coastguard Worker@xd = common global double 0.000000e+00, align 8 10*9880d681SAndroid Build Coastguard Worker@xy = common global { float, float } zeroinitializer, align 4 11*9880d681SAndroid Build Coastguard Worker@.str1 = private unnamed_addr constant [10 x i8] c"%f + %fi\0A\00", align 1 12*9880d681SAndroid Build Coastguard Worker@xyd = common global { double, double } zeroinitializer, align 8 13*9880d681SAndroid Build Coastguard Worker 14*9880d681SAndroid Build Coastguard Worker; Function Attrs: nounwind 15*9880d681SAndroid Build Coastguard Workerdefine float @sv() #0 { 16*9880d681SAndroid Build Coastguard Workerentry: 17*9880d681SAndroid Build Coastguard Worker ret float 1.000000e+01 18*9880d681SAndroid Build Coastguard Worker} 19*9880d681SAndroid Build Coastguard Worker; picel: .ent sv 20*9880d681SAndroid Build Coastguard Worker; picel: lw ${{[0-9]+}}, %call16(__mips16_ret_sf)(${{[0-9]+}}) 21*9880d681SAndroid Build Coastguard Worker; picel: .end sv 22*9880d681SAndroid Build Coastguard Worker 23*9880d681SAndroid Build Coastguard Worker; Function Attrs: nounwind 24*9880d681SAndroid Build Coastguard Workerdefine double @dv() #0 { 25*9880d681SAndroid Build Coastguard Workerentry: 26*9880d681SAndroid Build Coastguard Worker ret double 1.500000e+01 27*9880d681SAndroid Build Coastguard Worker} 28*9880d681SAndroid Build Coastguard Worker 29*9880d681SAndroid Build Coastguard Worker; picel: .ent dv 30*9880d681SAndroid Build Coastguard Worker; picel: lw ${{[0-9]+}}, %call16(__mips16_ret_df)(${{[0-9]+}}) 31*9880d681SAndroid Build Coastguard Worker; picel: .end dv 32*9880d681SAndroid Build Coastguard Worker 33*9880d681SAndroid Build Coastguard Worker; Function Attrs: nounwind 34*9880d681SAndroid Build Coastguard Workerdefine { float, float } @scv() #0 { 35*9880d681SAndroid Build Coastguard Workerentry: 36*9880d681SAndroid Build Coastguard Worker %retval = alloca { float, float }, align 4 37*9880d681SAndroid Build Coastguard Worker %real = getelementptr inbounds { float, float }, { float, float }* %retval, i32 0, i32 0 38*9880d681SAndroid Build Coastguard Worker %imag = getelementptr inbounds { float, float }, { float, float }* %retval, i32 0, i32 1 39*9880d681SAndroid Build Coastguard Worker store float 5.000000e+00, float* %real 40*9880d681SAndroid Build Coastguard Worker store float 9.900000e+01, float* %imag 41*9880d681SAndroid Build Coastguard Worker %0 = load { float, float }, { float, float }* %retval 42*9880d681SAndroid Build Coastguard Worker ret { float, float } %0 43*9880d681SAndroid Build Coastguard Worker} 44*9880d681SAndroid Build Coastguard Worker 45*9880d681SAndroid Build Coastguard Worker; picel: .ent scv 46*9880d681SAndroid Build Coastguard Worker; picel: lw ${{[0-9]+}}, %call16(__mips16_ret_sc)(${{[0-9]+}}) 47*9880d681SAndroid Build Coastguard Worker; picel: .end scv 48*9880d681SAndroid Build Coastguard Worker 49*9880d681SAndroid Build Coastguard Worker; Function Attrs: nounwind 50*9880d681SAndroid Build Coastguard Workerdefine { double, double } @dcv() #0 { 51*9880d681SAndroid Build Coastguard Workerentry: 52*9880d681SAndroid Build Coastguard Worker %retval = alloca { double, double }, align 8 53*9880d681SAndroid Build Coastguard Worker %real = getelementptr inbounds { double, double }, { double, double }* %retval, i32 0, i32 0 54*9880d681SAndroid Build Coastguard Worker %imag = getelementptr inbounds { double, double }, { double, double }* %retval, i32 0, i32 1 55*9880d681SAndroid Build Coastguard Worker store double 0x416BC8B0A0000000, double* %real 56*9880d681SAndroid Build Coastguard Worker store double 0x41CDCCB763800000, double* %imag 57*9880d681SAndroid Build Coastguard Worker %0 = load { double, double }, { double, double }* %retval 58*9880d681SAndroid Build Coastguard Worker ret { double, double } %0 59*9880d681SAndroid Build Coastguard Worker} 60*9880d681SAndroid Build Coastguard Worker 61*9880d681SAndroid Build Coastguard Worker; picel: .ent dcv 62*9880d681SAndroid Build Coastguard Worker; picel: lw ${{[0-9]+}}, %call16(__mips16_ret_dc)(${{[0-9]+}}) 63*9880d681SAndroid Build Coastguard Worker; picel: .end dcv 64*9880d681SAndroid Build Coastguard Worker 65*9880d681SAndroid Build Coastguard Worker; Function Attrs: nounwind 66*9880d681SAndroid Build Coastguard Workerdefine i32 @main() #0 { 67*9880d681SAndroid Build Coastguard Workerentry: 68*9880d681SAndroid Build Coastguard Worker %0 = load float ()*, float ()** @ptrsv, align 4 69*9880d681SAndroid Build Coastguard Worker %call = call float %0() 70*9880d681SAndroid Build Coastguard Worker store float %call, float* @x, align 4 71*9880d681SAndroid Build Coastguard Worker %1 = load float, float* @x, align 4 72*9880d681SAndroid Build Coastguard Worker %conv = fpext float %1 to double 73*9880d681SAndroid Build Coastguard Worker %call1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), double %conv) 74*9880d681SAndroid Build Coastguard Worker %2 = load double ()*, double ()** @ptrdv, align 4 75*9880d681SAndroid Build Coastguard Worker %call2 = call double %2() 76*9880d681SAndroid Build Coastguard Worker store double %call2, double* @xd, align 8 77*9880d681SAndroid Build Coastguard Worker %3 = load double, double* @xd, align 8 78*9880d681SAndroid Build Coastguard Worker %call3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), double %3) 79*9880d681SAndroid Build Coastguard Worker %4 = load { float, float } ()*, { float, float } ()** @ptrscv, align 4 80*9880d681SAndroid Build Coastguard Worker %call4 = call { float, float } %4() 81*9880d681SAndroid Build Coastguard Worker %5 = extractvalue { float, float } %call4, 0 82*9880d681SAndroid Build Coastguard Worker %6 = extractvalue { float, float } %call4, 1 83*9880d681SAndroid Build Coastguard Worker store float %5, float* getelementptr inbounds ({ float, float }, { float, float }* @xy, i32 0, i32 0) 84*9880d681SAndroid Build Coastguard Worker store float %6, float* getelementptr inbounds ({ float, float }, { float, float }* @xy, i32 0, i32 1) 85*9880d681SAndroid Build Coastguard Worker %xy.real = load float, float* getelementptr inbounds ({ float, float }, { float, float }* @xy, i32 0, i32 0) 86*9880d681SAndroid Build Coastguard Worker %xy.imag = load float, float* getelementptr inbounds ({ float, float }, { float, float }* @xy, i32 0, i32 1) 87*9880d681SAndroid Build Coastguard Worker %conv5 = fpext float %xy.real to double 88*9880d681SAndroid Build Coastguard Worker %conv6 = fpext float %xy.imag to double 89*9880d681SAndroid Build Coastguard Worker %xy.real7 = load float, float* getelementptr inbounds ({ float, float }, { float, float }* @xy, i32 0, i32 0) 90*9880d681SAndroid Build Coastguard Worker %xy.imag8 = load float, float* getelementptr inbounds ({ float, float }, { float, float }* @xy, i32 0, i32 1) 91*9880d681SAndroid Build Coastguard Worker %conv9 = fpext float %xy.real7 to double 92*9880d681SAndroid Build Coastguard Worker %conv10 = fpext float %xy.imag8 to double 93*9880d681SAndroid Build Coastguard Worker %call11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str1, i32 0, i32 0), double %conv5, double %conv10) 94*9880d681SAndroid Build Coastguard Worker %7 = load { double, double } ()*, { double, double } ()** @ptrdcv, align 4 95*9880d681SAndroid Build Coastguard Worker %call12 = call { double, double } %7() 96*9880d681SAndroid Build Coastguard Worker %8 = extractvalue { double, double } %call12, 0 97*9880d681SAndroid Build Coastguard Worker %9 = extractvalue { double, double } %call12, 1 98*9880d681SAndroid Build Coastguard Worker store double %8, double* getelementptr inbounds ({ double, double }, { double, double }* @xyd, i32 0, i32 0) 99*9880d681SAndroid Build Coastguard Worker store double %9, double* getelementptr inbounds ({ double, double }, { double, double }* @xyd, i32 0, i32 1) 100*9880d681SAndroid Build Coastguard Worker %xyd.real = load double, double* getelementptr inbounds ({ double, double }, { double, double }* @xyd, i32 0, i32 0) 101*9880d681SAndroid Build Coastguard Worker %xyd.imag = load double, double* getelementptr inbounds ({ double, double }, { double, double }* @xyd, i32 0, i32 1) 102*9880d681SAndroid Build Coastguard Worker %xyd.real13 = load double, double* getelementptr inbounds ({ double, double }, { double, double }* @xyd, i32 0, i32 0) 103*9880d681SAndroid Build Coastguard Worker %xyd.imag14 = load double, double* getelementptr inbounds ({ double, double }, { double, double }* @xyd, i32 0, i32 1) 104*9880d681SAndroid Build Coastguard Worker %call15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str1, i32 0, i32 0), double %xyd.real, double %xyd.imag14) 105*9880d681SAndroid Build Coastguard Worker ret i32 0 106*9880d681SAndroid Build Coastguard Worker} 107*9880d681SAndroid Build Coastguard Worker 108*9880d681SAndroid Build Coastguard Worker; picel: .ent main 109*9880d681SAndroid Build Coastguard Worker 110*9880d681SAndroid Build Coastguard Worker; picel: lw ${{[0-9]+}}, %got(__mips16_call_stub_sf_0)(${{[0-9]+}}) 111*9880d681SAndroid Build Coastguard Worker 112*9880d681SAndroid Build Coastguard Worker; picel: lw ${{[0-9]+}}, %got(__mips16_call_stub_df_0)(${{[0-9]+}}) 113*9880d681SAndroid Build Coastguard Worker 114*9880d681SAndroid Build Coastguard Worker; picel: lw ${{[0-9]+}}, %got(__mips16_call_stub_sc_0)(${{[0-9]+}}) 115*9880d681SAndroid Build Coastguard Worker 116*9880d681SAndroid Build Coastguard Worker; picel: lw ${{[0-9]+}}, %got(__mips16_call_stub_dc_0)(${{[0-9]+}}) 117*9880d681SAndroid Build Coastguard Worker 118*9880d681SAndroid Build Coastguard Worker 119*9880d681SAndroid Build Coastguard Workerdeclare i32 @printf(i8*, ...) #1 120*9880d681SAndroid Build Coastguard Worker 121*9880d681SAndroid Build Coastguard Workerattributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" } 122*9880d681SAndroid Build Coastguard Workerattributes #1 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" } 123*9880d681SAndroid Build Coastguard Worker 124*9880d681SAndroid Build Coastguard Worker 125*9880d681SAndroid Build Coastguard Worker 126