1 ; RUN: llc -mtriple=mipsel-linux-gnu -march=mipsel -mattr=mips16 -relocation-model=pic < %s | FileCheck %s -check-prefix=picel
3 @ptrsv = global float ()* @sv, align 4
4 @ptrdv = global double ()* @dv, align 4
5 @ptrscv = global { float, float } ()* @scv, align 4
6 @ptrdcv = global { double, double } ()* @dcv, align 4
7 @x = common global float 0.000000e+00, align 4
8 @.str = private unnamed_addr constant [4 x i8] c"%f\0A\00", align 1
9 @xd = common global double 0.000000e+00, align 8
10 @xy = common global { float, float } zeroinitializer, align 4
11 @.str1 = private unnamed_addr constant [10 x i8] c"%f + %fi\0A\00", align 1
12 @xyd = common global { double, double } zeroinitializer, align 8
14 ; Function Attrs: nounwind
15 define float @sv() #0 {
17 ret float 1.000000e+01
20 ; picel: lw ${{[0-9]+}}, %call16(__mips16_ret_sf)(${{[0-9]+}})
23 ; Function Attrs: nounwind
24 define double @dv() #0 {
26 ret double 1.500000e+01
30 ; picel: lw ${{[0-9]+}}, %call16(__mips16_ret_df)(${{[0-9]+}})
33 ; Function Attrs: nounwind
34 define { float, float } @scv() #0 {
36 %retval = alloca { float, float }, align 4
37 %real = getelementptr inbounds { float, float }, { float, float }* %retval, i32 0, i32 0
38 %imag = getelementptr inbounds { float, float }, { float, float }* %retval, i32 0, i32 1
39 store float 5.000000e+00, float* %real
40 store float 9.900000e+01, float* %imag
41 %0 = load { float, float }, { float, float }* %retval
42 ret { float, float } %0
46 ; picel: lw ${{[0-9]+}}, %call16(__mips16_ret_sc)(${{[0-9]+}})
49 ; Function Attrs: nounwind
50 define { double, double } @dcv() #0 {
52 %retval = alloca { double, double }, align 8
53 %real = getelementptr inbounds { double, double }, { double, double }* %retval, i32 0, i32 0
54 %imag = getelementptr inbounds { double, double }, { double, double }* %retval, i32 0, i32 1
55 store double 0x416BC8B0A0000000, double* %real
56 store double 0x41CDCCB763800000, double* %imag
57 %0 = load { double, double }, { double, double }* %retval
58 ret { double, double } %0
62 ; picel: lw ${{[0-9]+}}, %call16(__mips16_ret_dc)(${{[0-9]+}})
65 ; Function Attrs: nounwind
66 define i32 @main() #0 {
68 %0 = load float ()*, float ()** @ptrsv, align 4
69 %call = call float %0()
70 store float %call, float* @x, align 4
71 %1 = load float, float* @x, align 4
72 %conv = fpext float %1 to double
73 %call1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), double %conv)
74 %2 = load double ()*, double ()** @ptrdv, align 4
75 %call2 = call double %2()
76 store double %call2, double* @xd, align 8
77 %3 = load double, double* @xd, align 8
78 %call3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), double %3)
79 %4 = load { float, float } ()*, { float, float } ()** @ptrscv, align 4
80 %call4 = call { float, float } %4()
81 %5 = extractvalue { float, float } %call4, 0
82 %6 = extractvalue { float, float } %call4, 1
83 store float %5, float* getelementptr inbounds ({ float, float }, { float, float }* @xy, i32 0, i32 0)
84 store float %6, float* getelementptr inbounds ({ float, float }, { float, float }* @xy, i32 0, i32 1)
85 %xy.real = load float, float* getelementptr inbounds ({ float, float }, { float, float }* @xy, i32 0, i32 0)
86 %xy.imag = load float, float* getelementptr inbounds ({ float, float }, { float, float }* @xy, i32 0, i32 1)
87 %conv5 = fpext float %xy.real to double
88 %conv6 = fpext float %xy.imag to double
89 %xy.real7 = load float, float* getelementptr inbounds ({ float, float }, { float, float }* @xy, i32 0, i32 0)
90 %xy.imag8 = load float, float* getelementptr inbounds ({ float, float }, { float, float }* @xy, i32 0, i32 1)
91 %conv9 = fpext float %xy.real7 to double
92 %conv10 = fpext float %xy.imag8 to double
93 %call11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str1, i32 0, i32 0), double %conv5, double %conv10)
94 %7 = load { double, double } ()*, { double, double } ()** @ptrdcv, align 4
95 %call12 = call { double, double } %7()
96 %8 = extractvalue { double, double } %call12, 0
97 %9 = extractvalue { double, double } %call12, 1
98 store double %8, double* getelementptr inbounds ({ double, double }, { double, double }* @xyd, i32 0, i32 0)
99 store double %9, double* getelementptr inbounds ({ double, double }, { double, double }* @xyd, i32 0, i32 1)
100 %xyd.real = load double, double* getelementptr inbounds ({ double, double }, { double, double }* @xyd, i32 0, i32 0)
101 %xyd.imag = load double, double* getelementptr inbounds ({ double, double }, { double, double }* @xyd, i32 0, i32 1)
102 %xyd.real13 = load double, double* getelementptr inbounds ({ double, double }, { double, double }* @xyd, i32 0, i32 0)
103 %xyd.imag14 = load double, double* getelementptr inbounds ({ double, double }, { double, double }* @xyd, i32 0, i32 1)
104 %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)
110 ; picel: lw ${{[0-9]+}}, %got(__mips16_call_stub_sf_0)(${{[0-9]+}})
112 ; picel: lw ${{[0-9]+}}, %got(__mips16_call_stub_df_0)(${{[0-9]+}})
114 ; picel: lw ${{[0-9]+}}, %got(__mips16_call_stub_sc_0)(${{[0-9]+}})
116 ; picel: lw ${{[0-9]+}}, %got(__mips16_call_stub_dc_0)(${{[0-9]+}})
119 declare i32 @printf(i8*, ...) #1
121 attributes #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 attributes #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" }