about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-10-20 21:04:13 +0200
committerGitHub <noreply@github.com>2024-10-20 21:04:13 +0200
commit7fbed7b07ebe23462bf01108b4f62e747ba9469d (patch)
treeac402f9e2403bda3b9bb15d3dd6b103317607bfd
parent2a9b6d96268eda2ce26db93a872bb15ec2601245 (diff)
parentebfe0e4620285f8f91d15ac84dff24cd2c1d6a4c (diff)
downloadrust-7fbed7b07ebe23462bf01108b4f62e747ba9469d.tar.gz
rust-7fbed7b07ebe23462bf01108b4f62e747ba9469d.zip
Rollup merge of #131927 - clubby789:skip-filecheck-directives, r=Mark-Simulacrum
Check for filecheck directives in files marked `skip-filecheck`

cc #116971
-rw-r--r--src/tools/miropt-test-tools/src/lib.rs3
-rw-r--r--tests/mir-opt/dest-prop/union.rs3
-rw-r--r--tests/mir-opt/issues/issue_59352.rs1
3 files changed, 4 insertions, 3 deletions
diff --git a/src/tools/miropt-test-tools/src/lib.rs b/src/tools/miropt-test-tools/src/lib.rs
index 4317f23a822..41b53d2ad0e 100644
--- a/src/tools/miropt-test-tools/src/lib.rs
+++ b/src/tools/miropt-test-tools/src/lib.rs
@@ -129,6 +129,9 @@ pub fn files_for_miropt_test(
 
             out.push(MiroptTestFile { expected_file, from_file, to_file });
         }
+        if !run_filecheck && l.trim_start().starts_with("// CHECK") {
+            panic!("error: test contains filecheck directive but is marked `skip-filecheck`");
+        }
     }
 
     MiroptTest { run_filecheck, suffix, files: out, passes }
diff --git a/tests/mir-opt/dest-prop/union.rs b/tests/mir-opt/dest-prop/union.rs
index 4e6fb71bf75..85eded09980 100644
--- a/tests/mir-opt/dest-prop/union.rs
+++ b/tests/mir-opt/dest-prop/union.rs
@@ -1,4 +1,3 @@
-// skip-filecheck
 // EMIT_MIR_FOR_EACH_PANIC_STRATEGY
 //! Tests that we can propagate into places that are projections into unions
 //@ compile-flags: -Zunsound-mir-opts -C debuginfo=full
@@ -8,7 +7,7 @@ fn val() -> u32 {
 
 // EMIT_MIR union.main.DestinationPropagation.diff
 fn main() {
-    // CHECK-LABEL: fn args(
+    // CHECK-LABEL: fn main(
     // CHECK: {{_.*}} = Un { us: const 1_u32 };
     union Un {
         us: u32,
diff --git a/tests/mir-opt/issues/issue_59352.rs b/tests/mir-opt/issues/issue_59352.rs
index 5c06b7e56f7..9024dc976e4 100644
--- a/tests/mir-opt/issues/issue_59352.rs
+++ b/tests/mir-opt/issues/issue_59352.rs
@@ -1,4 +1,3 @@
-// skip-filecheck
 // EMIT_MIR_FOR_EACH_PANIC_STRATEGY
 // This test is a mirror of codegen/issue-59352.rs.
 // The LLVM inliner doesn't inline `char::method::is_digit()` and so it doesn't recognize this case