Skip to content

Commit f6afb35

Browse files
committed
Prevent a test from seeing forbidden numbers in the rustc version
The final CHECK-NOT directive in this test was able to see past the end of the enclosing function, and find the substring 753 or 754 in the git hash in the rustc version number, causing false failures in CI. Adding an explicit check for `ret` prevents the CHECK-NOT directive from seeing past the end of the function.
1 parent 5e17a2a commit f6afb35

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Diff for: tests/codegen/issues/issue-122600-ptr-discriminant-update.rs

+2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ pub unsafe fn update(s: *mut State) {
3737
// CHECK-NOT: store
3838
// CHECK-NOT: memcpy
3939
// CHECK-NOT: 75{{3|4}}
40+
41+
// CHECK: ret
4042
let State::A(v) = s.read() else { std::hint::unreachable_unchecked() };
4143
s.write(State::B(v));
4244
}

0 commit comments

Comments
 (0)