about summary refs log tree commit diff
path: root/tests/codegen/issues
diff options
context:
space:
mode:
authorStuart Cook <Zalathar@users.noreply.github.com>2025-04-06 16:21:03 +1000
committerGitHub <noreply@github.com>2025-04-06 16:21:03 +1000
commitf4aa209e206788a7c75ef3484e98092872864e51 (patch)
treef05eaf76707f66ddbfbd50ab0eebb94e0bf0a7ee /tests/codegen/issues
parentf55034b2ebfb14c1748f30c25814e442727ee79e (diff)
parentf6afb35c6170ad3cadc6e6d7d41dc4dc3bd46556 (diff)
downloadrust-f4aa209e206788a7c75ef3484e98092872864e51.tar.gz
rust-f4aa209e206788a7c75ef3484e98092872864e51.zip
Rollup merge of #139438 - Zalathar:fix-test-122600, r=scottmcm
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 whenever the git hash happens to contain those digits in sequence.

Adding an explicit check for `ret` prevents the CHECK-NOT directive from seeing past the end of the function.

---

Manually tested by adding `// CHECK-NOT: rustc` after the existing CHECK-NOT directives, and demonstrating that the new check prevents it from seeing the rustc version string.
Diffstat (limited to 'tests/codegen/issues')
-rw-r--r--tests/codegen/issues/issue-122600-ptr-discriminant-update.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/codegen/issues/issue-122600-ptr-discriminant-update.rs b/tests/codegen/issues/issue-122600-ptr-discriminant-update.rs
index 2414c54e4b7..853a1ff36b1 100644
--- a/tests/codegen/issues/issue-122600-ptr-discriminant-update.rs
+++ b/tests/codegen/issues/issue-122600-ptr-discriminant-update.rs
@@ -36,6 +36,8 @@ pub unsafe fn update(s: *mut State) {
     // CHECK-NOT: store
     // CHECK-NOT: memcpy
     // CHECK-NOT: 75{{3|4}}
+
+    // CHECK: ret
     let State::A(v) = s.read() else { std::hint::unreachable_unchecked() };
     s.write(State::B(v));
 }