about summary refs log tree commit diff
path: root/src/tools/compiletest
diff options
context:
space:
mode:
authorScott McMurray <scottmcm@users.noreply.github.com>2023-05-21 11:44:37 -0700
committerScott McMurray <scottmcm@users.noreply.github.com>2023-05-21 17:48:37 -0700
commitd69725d5d5173e6c6fc20873f306cbd66fa963e7 (patch)
tree4237d31f1a210397d910b0a41f1057b1b49035ad /src/tools/compiletest
parent05bf42bfa9f616652be4fb11142c6bec0c85db96 (diff)
downloadrust-d69725d5d5173e6c6fc20873f306cbd66fa963e7.tar.gz
rust-d69725d5d5173e6c6fc20873f306cbd66fa963e7.zip
Normalize block and local orders in mir-opt tests
Since this only affects `PreCodegen MIR, and it would be nice for that to be resilient to permutations of things that don't affect the actual semantic behaviours.
Diffstat (limited to 'src/tools/compiletest')
-rw-r--r--src/tools/compiletest/src/runtest.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs
index 5bc4d164265..a799d93ce25 100644
--- a/src/tools/compiletest/src/runtest.rs
+++ b/src/tools/compiletest/src/runtest.rs
@@ -2045,7 +2045,10 @@ impl<'test> TestCx<'test> {
                 if let Some(pass) = &self.props.mir_unit_test {
                     rustc.args(&["-Zmir-opt-level=0", &format!("-Zmir-enable-passes=+{}", pass)]);
                 } else {
-                    rustc.arg("-Zmir-opt-level=4");
+                    rustc.args(&[
+                        "-Zmir-opt-level=4",
+                        "-Zmir-enable-passes=+ReorderBasicBlocks,+ReorderLocals",
+                    ]);
                 }
 
                 let mir_dump_dir = self.get_mir_dump_dir();