2 // - float structure members are passes in floating point registers
5 // assembly-output: emit-asm
6 // needs-llvm-components: sparc
7 // compile-flags: --target=sparcv9-sun-solaris -Copt-level=3
9 #![feature(no_core, lang_items)]
26 // NB: due to delay slots the `ld` following the call is actually executed before the call.
28 pub unsafe extern "C" fn callee(arg: Franta) {
29 // CHECK-LABEL: callee:
30 // CHECK: st %f3, [[PLACE_D:.*]]
31 // CHECK: st %f2, [[PLACE_C:.*]]
32 // CHECK: st %f1, [[PLACE_B:.*]]
33 // CHECK: st %f0, [[PLACE_A:.*]]
34 // CHECK: call tst_use
35 // CHECK-NEXT: ld [[PLACE_A]], %f1
36 // CHECK: call tst_use
37 // CHECK-NEXT: ld [[PLACE_B]], %f1
38 // CHECK: call tst_use
39 // CHECK-NEXT: ld [[PLACE_C]], %f1
40 // CHECK: call tst_use
41 // CHECK-NEXT: ld [[PLACE_D]], %f1
47 tail_call_avoidance_fn();
51 fn opaque_callee(arg: Franta, intarg: i32);
54 // This exists so that post-https://reviews.llvm.org/D138741 LLVM doesn't
55 // tail-call away some of our assertions.
56 fn tail_call_avoidance_fn();
60 pub unsafe extern "C" fn caller() {
61 // CHECK-LABEL: caller:
62 // CHECK: ld [{{.*}}], %f0
63 // CHECK: ld [{{.*}}], %f1
64 // CHECK: ld [{{.*}}], %f2
65 // CHECK: ld [{{.*}}], %f3
66 // CHECK: call opaque_callee
68 opaque_callee(Franta { a: 1.0, b: 2.0, c: 3.0, d: 4.0 }, 3);
69 tail_call_avoidance_fn();