2 // compile-flags: -C no-prepopulate-passes
7 // CHECK: define void @f_fpr_tracking(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, i8 zeroext %i)
9 pub extern "C" fn f_fpr_tracking(
28 pub struct DoubleDouble {
34 pub struct DoubleFloat {
39 // CHECK: define void @f_double_s_arg(double %0)
41 pub extern "C" fn f_double_s_arg(a: Double) {}
43 // CHECK: define double @f_ret_double_s()
45 pub extern "C" fn f_ret_double_s() -> Double {
49 // CHECK: define void @f_double_double_s_arg({ double, double } %0)
51 pub extern "C" fn f_double_double_s_arg(a: DoubleDouble) {}
53 // CHECK: define { double, double } @f_ret_double_double_s()
55 pub extern "C" fn f_ret_double_double_s() -> DoubleDouble {
56 DoubleDouble { f: 1., g: 2. }
59 // CHECK: define void @f_double_float_s_arg({ double, float } %0)
61 pub extern "C" fn f_double_float_s_arg(a: DoubleFloat) {}
63 // CHECK: define { double, float } @f_ret_double_float_s()
65 pub extern "C" fn f_ret_double_float_s() -> DoubleFloat {
66 DoubleFloat { f: 1., g: 2. }
69 // CHECK: define void @f_double_double_s_arg_insufficient_fprs(double %0, double %1, double %2, double %3, double %4, double %5, double %6, [2 x i64] %7)
71 pub extern "C" fn f_double_double_s_arg_insufficient_fprs(
84 pub struct DoubleInt8 {
90 pub struct DoubleUInt8 {
96 pub struct DoubleInt32 {
102 pub struct DoubleInt64 {
107 // CHECK: define void @f_double_int8_s_arg({ double, i8 } %0)
109 pub extern "C" fn f_double_int8_s_arg(a: DoubleInt8) {}
111 // CHECK: define { double, i8 } @f_ret_double_int8_s()
113 pub extern "C" fn f_ret_double_int8_s() -> DoubleInt8 {
114 DoubleInt8 { f: 1., i: 2 }
117 // CHECK: define void @f_double_int32_s_arg({ double, i32 } %0)
119 pub extern "C" fn f_double_int32_s_arg(a: DoubleInt32) {}
121 // CHECK: define { double, i32 } @f_ret_double_int32_s()
123 pub extern "C" fn f_ret_double_int32_s() -> DoubleInt32 {
124 DoubleInt32 { f: 1., i: 2 }
127 // CHECK: define void @f_double_uint8_s_arg({ double, i8 } %0)
129 pub extern "C" fn f_double_uint8_s_arg(a: DoubleUInt8) {}
131 // CHECK: define { double, i8 } @f_ret_double_uint8_s()
133 pub extern "C" fn f_ret_double_uint8_s() -> DoubleUInt8 {
134 DoubleUInt8 { f: 1., i: 2 }
137 // CHECK: define void @f_double_int64_s_arg({ double, i64 } %0)
139 pub extern "C" fn f_double_int64_s_arg(a: DoubleInt64) {}
141 // CHECK: define { double, i64 } @f_ret_double_int64_s()
143 pub extern "C" fn f_ret_double_int64_s() -> DoubleInt64 {
144 DoubleInt64 { f: 1., i: 2 }
147 // CHECK: define void @f_double_int8_s_arg_insufficient_gprs(i32 signext %a, i32 signext %b, i32 signext %c, i32 signext %d, i32 signext %e, i32 signext %f, i32 signext %g, i32 signext %h, [2 x i64] %0)
149 pub extern "C" fn f_double_int8_s_arg_insufficient_gprs(
162 // CHECK: define void @f_struct_double_int8_insufficient_fprs(float %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, [2 x i64] %8)
164 pub extern "C" fn f_struct_double_int8_insufficient_fprs(
178 pub struct DoubleArr1 {
182 // CHECK: define void @f_doublearr1_s_arg(double %0)
184 pub extern "C" fn f_doublearr1_s_arg(a: DoubleArr1) {}
186 // CHECK: define double @f_ret_doublearr1_s()
188 pub extern "C" fn f_ret_doublearr1_s() -> DoubleArr1 {
189 DoubleArr1 { a: [1.] }
193 pub struct DoubleArr2 {
197 // CHECK: define void @f_doublearr2_s_arg({ double, double } %0)
199 pub extern "C" fn f_doublearr2_s_arg(a: DoubleArr2) {}
201 // CHECK: define { double, double } @f_ret_doublearr2_s()
203 pub extern "C" fn f_ret_doublearr2_s() -> DoubleArr2 {
204 DoubleArr2 { a: [1., 2.] }
213 pub struct DoubleArr2Tricky1 {
217 // CHECK: define void @f_doublearr2_tricky1_s_arg({ double, double } %0)
219 pub extern "C" fn f_doublearr2_tricky1_s_arg(a: DoubleArr2Tricky1) {}
221 // CHECK: define { double, double } @f_ret_doublearr2_tricky1_s()
223 pub extern "C" fn f_ret_doublearr2_tricky1_s() -> DoubleArr2Tricky1 {
224 DoubleArr2Tricky1 { g: [Tricky1 { f: [1.] }, Tricky1 { f: [2.] }] }
228 pub struct EmptyStruct {}
231 pub struct DoubleArr2Tricky2 {
236 // CHECK: define void @f_doublearr2_tricky2_s_arg({ double, double } %0)
238 pub extern "C" fn f_doublearr2_tricky2_s_arg(a: DoubleArr2Tricky2) {}
240 // CHECK: define { double, double } @f_ret_doublearr2_tricky2_s()
242 pub extern "C" fn f_ret_doublearr2_tricky2_s() -> DoubleArr2Tricky2 {
243 DoubleArr2Tricky2 { s: EmptyStruct {}, g: [Tricky1 { f: [1.] }, Tricky1 { f: [2.] }] }
247 pub struct IntDoubleInt {
253 // CHECK: define void @f_int_double_int_s_arg(%IntDoubleInt* {{.*}}%a)
255 pub extern "C" fn f_int_double_int_s_arg(a: IntDoubleInt) {}
257 // CHECK: define void @f_ret_int_double_int_s(%IntDoubleInt* {{.*}}sret
259 pub extern "C" fn f_ret_int_double_int_s() -> IntDoubleInt {
260 IntDoubleInt { a: 1, b: 2., c: 3 }
264 pub struct CharCharDouble {
270 // CHECK: define void @f_char_char_double_s_arg([2 x i64] %0)
272 pub extern "C" fn f_char_char_double_s_arg(a: CharCharDouble) {}
274 // CHECK: define [2 x i64] @f_ret_char_char_double_s()
276 pub extern "C" fn f_ret_char_char_double_s() -> CharCharDouble {
277 CharCharDouble { a: 1, b: 2, c: 3. }
285 // CHECK: define void @f_double_u_arg(i64 %0)
287 pub extern "C" fn f_double_u_arg(a: DoubleU) {}
289 // CHECK: define i64 @f_ret_double_u()
291 pub extern "C" fn f_ret_double_u() -> DoubleU {
292 unsafe { DoubleU { a: 1. } }