Skip to content

Commit 5ca5f02

Browse files
authored
Rollup merge of rust-lang#100086 - JakobDegen:better-tests, r=wesleywiser
Add more `// unit-test`s to MIR opt tests I only changed things which are hopefully completely uninteresting. I plan to submit more PRs that cover more files, but those cases will need some more complicated (and hence possibly controversial) changes, so I'll try and submit those in reasonably sized batches. r? rust-lang/wg-mir-opt
2 parents 507b299 + ac75863 commit 5ca5f02

34 files changed

+160
-179
lines changed

src/test/mir-opt/bool_compare.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// unit-test: InstCombine
2+
13
// EMIT_MIR bool_compare.opt1.InstCombine.diff
24
fn opt1(x: bool) -> u32 {
35
if x != true { 0 } else { 1 }

src/test/mir-opt/combine_array_len.norm2.InstCombine.64bit.diff

Lines changed: 0 additions & 77 deletions
This file was deleted.

src/test/mir-opt/combine_array_len.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// EMIT_MIR_FOR_EACH_BIT_WIDTH
1+
// unit-test: InstCombine
22
// EMIT_MIR combine_array_len.norm2.InstCombine.diff
33

44
fn norm2(x: [f32; 2]) -> f32 {

src/test/mir-opt/const_goto.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// unit-test: ConstGoto
2+
13
pub enum Foo {
24
A,
35
B,

src/test/mir-opt/const_goto_storage.match_nested_if.ConstGoto.diff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
bb0: {
1818
StorageLive(_1); // scope 0 at $DIR/const_goto_storage.rs:+1:9: +1:12
1919
- StorageLive(_2); // scope 0 at $DIR/const_goto_storage.rs:+1:21: +1:23
20-
- nop; // scope 0 at $DIR/const_goto_storage.rs:+1:21: +1:23
20+
- Deinit(_2); // scope 0 at $DIR/const_goto_storage.rs:+1:21: +1:23
2121
- StorageLive(_3); // scope 0 at $DIR/const_goto_storage.rs:+2:15: +6:10
2222
- StorageLive(_4); // scope 0 at $DIR/const_goto_storage.rs:+2:18: +2:76
2323
- StorageLive(_5); // scope 0 at $DIR/const_goto_storage.rs:+2:21: +2:52

src/test/mir-opt/const_goto_storage.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// unit-test: ConstGoto
2+
13
// EMIT_MIR const_goto_storage.match_nested_if.ConstGoto.diff
24
fn match_nested_if() -> bool {
35
let val = match () {

src/test/mir-opt/deaggregator_test.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// unit-test: Deaggregator
2+
13
struct Baz {
24
x: usize,
35
y: f32,

src/test/mir-opt/deaggregator_test_enum.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// unit-test: Deaggregator
2+
13
enum Baz {
24
Empty,
35
Foo { x: usize },

src/test/mir-opt/deaggregator_test_enum_2.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// unit-test: Deaggregator
12
// Test that deaggregate fires in more than one basic block
23

34
enum Foo {

0 commit comments

Comments
 (0)