Skip to content

Commit 5466eb4

Browse files
committed
Add inline(never) attribute to musttail test functions
This ensures the test remains robust against optimization passes that might otherwise inline the functions and obscure the tail call behavior we're testing.
1 parent f85cdbf commit 5466eb4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tests/codegen/tail-call-musttail.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
// CHECK-LABEL: define {{.*}}@simple_tail_call(
1010
#[no_mangle]
11+
#[inline(never)]
1112
pub fn simple_tail_call(n: i32) -> i32 {
1213
// CHECK: musttail call {{.*}}@simple_tail_call(
1314
// CHECK-NEXT: ret i32
@@ -20,6 +21,7 @@ pub fn simple_tail_call(n: i32) -> i32 {
2021

2122
// CHECK-LABEL: define {{.*}}@tail_call_with_args(
2223
#[no_mangle]
24+
#[inline(never)]
2325
pub fn tail_call_with_args(a: i32, b: i32, c: i32) -> i32 {
2426
// CHECK: musttail call {{.*}}@tail_call_with_args(
2527
// CHECK-NEXT: ret i32

0 commit comments

Comments
 (0)