diff options
| author | Jakob Degen <jakob.e.degen@gmail.com> | 2022-08-20 21:47:53 -0700 |
|---|---|---|
| committer | Jakob Degen <jakob.e.degen@gmail.com> | 2022-09-01 23:01:53 -0700 |
| commit | e5d60af3c6f44be48371e32ef553416d277c92ec (patch) | |
| tree | a977da12f72f7265c0aff24547c4159be55f1bfc /src/test/mir-opt/lower_array_len_e2e.array_len.PreCodegen.after.mir | |
| parent | 10706d62da83c4ec215165bc72df46219536648f (diff) | |
| download | rust-e5d60af3c6f44be48371e32ef553416d277c92ec.tar.gz rust-e5d60af3c6f44be48371e32ef553416d277c92ec.zip | |
Simplify MIR opt tests
This commit removes many cases of MIR opt tests emitting `.diff`s for more than one pass. These tests cannot be `unit-test`s, and so they are easy to break, and they also provide little value due to having excessively strong opinions over *how* a piece of code should be optimized. Where reasonable, we instead add separate test files that only emit the `PreCodegen.after` MIR for code where we want to track what the result of the net result of the optimization pipeline's output is.
Diffstat (limited to 'src/test/mir-opt/lower_array_len_e2e.array_len.PreCodegen.after.mir')
| -rw-r--r-- | src/test/mir-opt/lower_array_len_e2e.array_len.PreCodegen.after.mir | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/mir-opt/lower_array_len_e2e.array_len.PreCodegen.after.mir b/src/test/mir-opt/lower_array_len_e2e.array_len.PreCodegen.after.mir new file mode 100644 index 00000000000..4b19f679558 --- /dev/null +++ b/src/test/mir-opt/lower_array_len_e2e.array_len.PreCodegen.after.mir @@ -0,0 +1,11 @@ +// MIR for `array_len` after PreCodegen + +fn array_len(_1: &[u8; N]) -> usize { + debug arr => _1; // in scope 0 at $DIR/lower_array_len_e2e.rs:+0:34: +0:37 + let mut _0: usize; // return place in scope 0 at $DIR/lower_array_len_e2e.rs:+0:52: +0:57 + + bb0: { + _0 = const N; // scope 0 at $DIR/lower_array_len_e2e.rs:+1:5: +1:14 + return; // scope 0 at $DIR/lower_array_len_e2e.rs:+2:2: +2:2 + } +} |
