8
8
// so its important to check that those are
9
9
// unneccessarily affected
10
10
11
- // ------------------------------------------------------------------------------------------------
11
+ // ----------------------------------------------------------------------------------------------
12
12
13
13
// regularly this tailcall would jump to the first instruction the function
14
14
// CHECK-LABEL: <tailcall_fn>:
@@ -27,38 +27,21 @@ pub fn tailcall_fn() {
27
27
}
28
28
}
29
29
30
- // ------------------------------------------------------------------------------------------------
30
+ // ----------------------------------------------------------------------------------------------
31
31
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.
34
34
// Preferably we would also tests a different single byte instruction,
35
35
// but I was not able to make rustc emit anything but 'ret'.
36
36
37
+ // check that if the first instruction is just a single byte, so our test is valid
37
38
// CHECK-LABEL: <empty_fn>:
38
- // CHECK-NEXT: ret
39
+ // CHECK-NOT: 0: {{[0-9a-f][0-9a-f]}} {{[0-9a-f][0-9a-f]}} {{.*}}
39
40
41
+ // check that the first instruction is at least 2 bytes long
40
42
// 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]}} {{.*}}
43
44
44
45
#[ no_mangle]
45
46
#[ inline( never) ]
46
47
pub 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