about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-12-02 21:22:47 +0100
committerGitHub <noreply@github.com>2022-12-02 21:22:47 +0100
commit0724a01b8c0d1e6dc06d4004301a1b18784d85d7 (patch)
tree891b5650a5131e9dbd6ae47cd93ee2110e041935
parentdab14348e981a9e660cf8c8d13f7547dbf04c1eb (diff)
parentef54e653c2fa6870b9830700aa8ec69330f50e78 (diff)
downloadrust-0724a01b8c0d1e6dc06d4004301a1b18784d85d7.tar.gz
rust-0724a01b8c0d1e6dc06d4004301a1b18784d85d7.zip
Rollup merge of #105033 - durin42:llvm-16-dont-tail-call-me-bro, r=tmandry
sparc-struct-abi: work around new tail-call optimization

Upstream LLVM change https://reviews.llvm.org/D138741 introduced some new tail-call smarts for SPARC which broke some of the checks in this test. Rather than adjust the test expectations, we add an extra no-args function that can get tail-called or not without hurting the needs of the test.

r? ``@nikic``
-rw-r--r--src/test/assembly/sparc-struct-abi.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/test/assembly/sparc-struct-abi.rs b/src/test/assembly/sparc-struct-abi.rs
index 6a898b2974a..6309dd420ff 100644
--- a/src/test/assembly/sparc-struct-abi.rs
+++ b/src/test/assembly/sparc-struct-abi.rs
@@ -44,12 +44,16 @@ pub unsafe extern "C" fn callee(arg: Franta) {
     tst_use(arg.b);
     tst_use(arg.c);
     tst_use(arg.d);
+    tail_call_avoidance_fn();
 }
 
 extern "C" {
     fn opaque_callee(arg: Franta, intarg: i32);
     fn tst_use(arg: f32);
     fn clobber();
+    // This exists so that post-https://reviews.llvm.org/D138741 LLVM doesn't
+    // tail-call away some of our assertions.
+    fn tail_call_avoidance_fn();
 }
 
 #[no_mangle]
@@ -62,4 +66,5 @@ pub unsafe extern "C" fn caller() {
     // CHECK: call opaque_callee
     // CHECK: mov     3, %o2
     opaque_callee(Franta { a: 1.0, b: 2.0, c: 3.0, d: 4.0 }, 3);
+    tail_call_avoidance_fn();
 }