Skip to content

Commit 0724a01

Browse files
authored
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``
2 parents dab1434 + ef54e65 commit 0724a01

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/test/assembly/sparc-struct-abi.rs

+5
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,16 @@ pub unsafe extern "C" fn callee(arg: Franta) {
4444
tst_use(arg.b);
4545
tst_use(arg.c);
4646
tst_use(arg.d);
47+
tail_call_avoidance_fn();
4748
}
4849

4950
extern "C" {
5051
fn opaque_callee(arg: Franta, intarg: i32);
5152
fn tst_use(arg: f32);
5253
fn clobber();
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();
5357
}
5458

5559
#[no_mangle]
@@ -62,4 +66,5 @@ pub unsafe extern "C" fn caller() {
6266
// CHECK: call opaque_callee
6367
// CHECK: mov 3, %o2
6468
opaque_callee(Franta { a: 1.0, b: 2.0, c: 3.0, d: 4.0 }, 3);
69+
tail_call_avoidance_fn();
6570
}

0 commit comments

Comments
 (0)