File tree Expand file tree Collapse file tree 2 files changed +43
-0
lines changed
tests/ui/explicit-tail-calls Expand file tree Collapse file tree 2 files changed +43
-0
lines changed Original file line number Diff line number Diff line change 1+ //@ check-pass
2+ //@ ignore-backends: gcc
3+ //@ known-bug: #148239
4+ //@ compile-flags: -Zno-codegen
5+ #![ expect( incomplete_features) ]
6+ #![ feature( explicit_tail_calls) ]
7+
8+ #[ inline( never) ]
9+ fn leaf ( _: & Box < u8 > ) -> [ u8 ; 1 ] {
10+ [ 1 ]
11+ }
12+
13+ #[ inline( never) ]
14+ fn dispatch ( param : & Box < u8 > ) -> [ u8 ; 1 ] {
15+ become leaf( param)
16+ }
17+
18+ fn main ( ) {
19+ let data = Box :: new ( 0 ) ;
20+ let out = dispatch ( & data) ;
21+ assert_eq ! ( out, [ 1 ] ) ;
22+ }
Original file line number Diff line number Diff line change 1+ //@ run-pass
2+ //@ ignore-backends: gcc
3+ //@ known-bug: #148239
4+ #![ expect( incomplete_features) ]
5+ #![ feature( explicit_tail_calls) ]
6+
7+ #[ inline( never) ]
8+ fn op_dummy ( _param : & Box < u8 > ) -> [ u8 ; 24 ] {
9+ [ 1 ; 24 ]
10+ }
11+
12+ #[ inline( never) ]
13+ fn dispatch ( param : & Box < u8 > ) -> [ u8 ; 24 ] {
14+ become op_dummy ( param)
15+ }
16+
17+ fn main ( ) {
18+ let param = Box :: new ( 0 ) ;
19+ let result = dispatch ( & param) ;
20+ assert_ne ! ( result, [ 1 ; 24 ] ) ; // the data is not right!
21+ }
You can’t perform that action at this time.
0 commit comments