88// so its important to check that those are
99// unneccessarily affected
1010
11- // ------------------------------------------------------------------------------------------------
11+ // ----------------------------------------------------------------------------------------------
1212
1313// regularly this tailcall would jump to the first instruction the function
1414// CHECK-LABEL: <tailcall_fn>:
@@ -27,38 +27,21 @@ pub fn tailcall_fn() {
2727 }
2828}
2929
30- // ------------------------------------------------------------------------------------------------
30+ // ----------------------------------------------------------------------------------------------
3131
32- // empty_fn just returns. Note that 'ret' is a single byte instruction, but hotpatch requires a two
33- // or more byte instructions to be at the start of the functions.
32+ // empty_fn just returns. Note that 'ret' is a single byte instruction, but hotpatch requires
33+ // a two or more byte instructions to be at the start of the functions.
3434// Preferably we would also tests a different single byte instruction,
3535// but I was not able to make rustc emit anything but 'ret'.
3636
37+ // check that if the first instruction is just a single byte, so our test is valid
3738// CHECK-LABEL: <empty_fn>:
38- // CHECK-NEXT: ret
39+ // CHECK-NOT: 0: {{[0-9a-f][0-9a-f]}} {{[0-9a-f][0-9a-f]}} {{.*}}
3940
41+ // check that the first instruction is at least 2 bytes long
4042// HOTPATCH-LABEL: <empty_fn>:
41- // HOTPATCH-NOT: ret
42- // HOTPATCH: ret
43+ // HOTPATCH-NEXT: 0: {{[0-9a-f][0-9a-f]}} {{[0-9a-f][0-9a-f]}} {{.*}}
4344
4445#[ no_mangle]
4546#[ inline( never) ]
4647pub fn empty_fn ( ) { }
47-
48- // ------------------------------------------------------------------------------------------------
49-
50- // return_42 should not be affected by hotpatch
51-
52- // CHECK-LABEL: <return_42>:
53- // CHECK-NEXT: 0:
54- // CHECK-NEXT: ret
55-
56- // HOTPATCH-LABEL: <return_42>:
57- // HOTPATCH-NEXT: 0:
58- // HOTPATCH-NEXT: ret
59-
60- #[ no_mangle]
61- #[ inline( never) ]
62- pub fn return_42 ( ) -> i32 {
63- 42
64- }
0 commit comments