Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 22e9e52

Browse files
committed
Make tests unit.
1 parent d9ee0f4 commit 22e9e52

16 files changed

+22
-17
lines changed

src/test/mir-opt/const_allocation.main.ConstProp.after.32bit.mir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ fn main() -> () {
1010
StorageLive(_2); // scope 0 at $DIR/const_allocation.rs:+1:5: +1:8
1111
_2 = const {alloc1: &&[(Option<i32>, &[&str])]}; // scope 0 at $DIR/const_allocation.rs:+1:5: +1:8
1212
// mir::Constant
13-
// + span: $DIR/const_allocation.rs:8:5: 8:8
13+
// + span: $DIR/const_allocation.rs:9:5: 9:8
1414
// + literal: Const { ty: &&[(Option<i32>, &[&str])], val: Value(Scalar(alloc1)) }
1515
_1 = (*_2); // scope 0 at $DIR/const_allocation.rs:+1:5: +1:8
1616
StorageDead(_2); // scope 0 at $DIR/const_allocation.rs:+1:8: +1:9
1717
StorageDead(_1); // scope 0 at $DIR/const_allocation.rs:+1:8: +1:9
18-
nop; // scope 0 at $DIR/const_allocation.rs:+0:11: +2:2
18+
_0 = const (); // scope 0 at $DIR/const_allocation.rs:+0:11: +2:2
1919
return; // scope 0 at $DIR/const_allocation.rs:+2:2: +2:2
2020
}
2121
}

src/test/mir-opt/const_allocation.main.ConstProp.after.64bit.mir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ fn main() -> () {
1010
StorageLive(_2); // scope 0 at $DIR/const_allocation.rs:+1:5: +1:8
1111
_2 = const {alloc1: &&[(Option<i32>, &[&str])]}; // scope 0 at $DIR/const_allocation.rs:+1:5: +1:8
1212
// mir::Constant
13-
// + span: $DIR/const_allocation.rs:8:5: 8:8
13+
// + span: $DIR/const_allocation.rs:9:5: 9:8
1414
// + literal: Const { ty: &&[(Option<i32>, &[&str])], val: Value(Scalar(alloc1)) }
1515
_1 = (*_2); // scope 0 at $DIR/const_allocation.rs:+1:5: +1:8
1616
StorageDead(_2); // scope 0 at $DIR/const_allocation.rs:+1:8: +1:9
1717
StorageDead(_1); // scope 0 at $DIR/const_allocation.rs:+1:8: +1:9
18-
nop; // scope 0 at $DIR/const_allocation.rs:+0:11: +2:2
18+
_0 = const (); // scope 0 at $DIR/const_allocation.rs:+0:11: +2:2
1919
return; // scope 0 at $DIR/const_allocation.rs:+2:2: +2:2
2020
}
2121
}

src/test/mir-opt/const_allocation.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// unit-test: ConstProp
12
// ignore-endian-big
23
// EMIT_MIR_FOR_EACH_BIT_WIDTH
34
static FOO: &[(Option<i32>, &[&str])] =

src/test/mir-opt/const_allocation2.main.ConstProp.after.32bit.mir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ fn main() -> () {
1010
StorageLive(_2); // scope 0 at $DIR/const_allocation2.rs:+1:5: +1:8
1111
_2 = const {alloc1: &&[(Option<i32>, &[&u8])]}; // scope 0 at $DIR/const_allocation2.rs:+1:5: +1:8
1212
// mir::Constant
13-
// + span: $DIR/const_allocation2.rs:5:5: 5:8
13+
// + span: $DIR/const_allocation2.rs:6:5: 6:8
1414
// + literal: Const { ty: &&[(Option<i32>, &[&u8])], val: Value(Scalar(alloc1)) }
1515
_1 = (*_2); // scope 0 at $DIR/const_allocation2.rs:+1:5: +1:8
1616
StorageDead(_2); // scope 0 at $DIR/const_allocation2.rs:+1:8: +1:9
1717
StorageDead(_1); // scope 0 at $DIR/const_allocation2.rs:+1:8: +1:9
18-
nop; // scope 0 at $DIR/const_allocation2.rs:+0:11: +2:2
18+
_0 = const (); // scope 0 at $DIR/const_allocation2.rs:+0:11: +2:2
1919
return; // scope 0 at $DIR/const_allocation2.rs:+2:2: +2:2
2020
}
2121
}

src/test/mir-opt/const_allocation2.main.ConstProp.after.64bit.mir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ fn main() -> () {
1010
StorageLive(_2); // scope 0 at $DIR/const_allocation2.rs:+1:5: +1:8
1111
_2 = const {alloc1: &&[(Option<i32>, &[&u8])]}; // scope 0 at $DIR/const_allocation2.rs:+1:5: +1:8
1212
// mir::Constant
13-
// + span: $DIR/const_allocation2.rs:5:5: 5:8
13+
// + span: $DIR/const_allocation2.rs:6:5: 6:8
1414
// + literal: Const { ty: &&[(Option<i32>, &[&u8])], val: Value(Scalar(alloc1)) }
1515
_1 = (*_2); // scope 0 at $DIR/const_allocation2.rs:+1:5: +1:8
1616
StorageDead(_2); // scope 0 at $DIR/const_allocation2.rs:+1:8: +1:9
1717
StorageDead(_1); // scope 0 at $DIR/const_allocation2.rs:+1:8: +1:9
18-
nop; // scope 0 at $DIR/const_allocation2.rs:+0:11: +2:2
18+
_0 = const (); // scope 0 at $DIR/const_allocation2.rs:+0:11: +2:2
1919
return; // scope 0 at $DIR/const_allocation2.rs:+2:2: +2:2
2020
}
2121
}

src/test/mir-opt/const_allocation2.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// unit-test: ConstProp
12
// ignore-endian-big
23
// EMIT_MIR_FOR_EACH_BIT_WIDTH
34
// EMIT_MIR const_allocation2.main.ConstProp.after.mir

src/test/mir-opt/const_allocation3.main.ConstProp.after.32bit.mir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ fn main() -> () {
1010
StorageLive(_2); // scope 0 at $DIR/const_allocation3.rs:+1:5: +1:8
1111
_2 = const {alloc1: &&Packed}; // scope 0 at $DIR/const_allocation3.rs:+1:5: +1:8
1212
// mir::Constant
13-
// + span: $DIR/const_allocation3.rs:5:5: 5:8
13+
// + span: $DIR/const_allocation3.rs:6:5: 6:8
1414
// + literal: Const { ty: &&Packed, val: Value(Scalar(alloc1)) }
1515
_1 = (*_2); // scope 0 at $DIR/const_allocation3.rs:+1:5: +1:8
1616
StorageDead(_2); // scope 0 at $DIR/const_allocation3.rs:+1:8: +1:9
1717
StorageDead(_1); // scope 0 at $DIR/const_allocation3.rs:+1:8: +1:9
18-
nop; // scope 0 at $DIR/const_allocation3.rs:+0:11: +2:2
18+
_0 = const (); // scope 0 at $DIR/const_allocation3.rs:+0:11: +2:2
1919
return; // scope 0 at $DIR/const_allocation3.rs:+2:2: +2:2
2020
}
2121
}

src/test/mir-opt/const_allocation3.main.ConstProp.after.64bit.mir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ fn main() -> () {
1010
StorageLive(_2); // scope 0 at $DIR/const_allocation3.rs:+1:5: +1:8
1111
_2 = const {alloc1: &&Packed}; // scope 0 at $DIR/const_allocation3.rs:+1:5: +1:8
1212
// mir::Constant
13-
// + span: $DIR/const_allocation3.rs:5:5: 5:8
13+
// + span: $DIR/const_allocation3.rs:6:5: 6:8
1414
// + literal: Const { ty: &&Packed, val: Value(Scalar(alloc1)) }
1515
_1 = (*_2); // scope 0 at $DIR/const_allocation3.rs:+1:5: +1:8
1616
StorageDead(_2); // scope 0 at $DIR/const_allocation3.rs:+1:8: +1:9
1717
StorageDead(_1); // scope 0 at $DIR/const_allocation3.rs:+1:8: +1:9
18-
nop; // scope 0 at $DIR/const_allocation3.rs:+0:11: +2:2
18+
_0 = const (); // scope 0 at $DIR/const_allocation3.rs:+0:11: +2:2
1919
return; // scope 0 at $DIR/const_allocation3.rs:+2:2: +2:2
2020
}
2121
}

src/test/mir-opt/const_allocation3.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// unit-test: ConstProp
12
// ignore-endian-big
23
// EMIT_MIR_FOR_EACH_BIT_WIDTH
34
// EMIT_MIR const_allocation3.main.ConstProp.after.mir

src/test/mir-opt/const_prop/ref_deref.main.ConstProp.diff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
StorageLive(_2); // scope 0 at $DIR/ref_deref.rs:+1:6: +1:10
1414
_4 = const _; // scope 0 at $DIR/ref_deref.rs:+1:6: +1:10
1515
// mir::Constant
16-
// + span: $DIR/ref_deref.rs:5:6: 5:10
16+
// + span: $DIR/ref_deref.rs:6:6: 6:10
1717
// + literal: Const { ty: &i32, val: Unevaluated(main, [], Some(promoted[0])) }
1818
_2 = _4; // scope 0 at $DIR/ref_deref.rs:+1:6: +1:10
1919
- _1 = (*_2); // scope 0 at $DIR/ref_deref.rs:+1:5: +1:10

src/test/mir-opt/const_prop/ref_deref.main.PromoteTemps.diff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
- _2 = &_3; // scope 0 at $DIR/ref_deref.rs:+1:6: +1:10
1717
+ _4 = const _; // scope 0 at $DIR/ref_deref.rs:+1:6: +1:10
1818
+ // mir::Constant
19-
+ // + span: $DIR/ref_deref.rs:5:6: 5:10
19+
+ // + span: $DIR/ref_deref.rs:6:6: 6:10
2020
+ // + literal: Const { ty: &i32, val: Unevaluated(main, [], Some(promoted[0])) }
2121
+ _2 = &(*_4); // scope 0 at $DIR/ref_deref.rs:+1:6: +1:10
2222
_1 = (*_2); // scope 0 at $DIR/ref_deref.rs:+1:5: +1:10

src/test/mir-opt/const_prop/ref_deref.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// compile-flags: -Zmir-enable-passes=-SimplifyLocals-before-const-prop
12
// EMIT_MIR ref_deref.main.PromoteTemps.diff
23
// EMIT_MIR ref_deref.main.ConstProp.diff
34

src/test/mir-opt/const_prop/ref_deref_project.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// unit-test
1+
// compile-flags: -Zmir-enable-passes=-SimplifyLocals-before-const-prop
22
// EMIT_MIR ref_deref_project.main.PromoteTemps.diff
33
// EMIT_MIR ref_deref_project.main.ConstProp.diff
44

src/test/mir-opt/const_prop/slice_len.main.ConstProp.32bit.diff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
StorageLive(_4); // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
2121
_9 = const _; // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
2222
// mir::Constant
23-
// + span: $DIR/slice_len.rs:5:6: 5:19
23+
// + span: $DIR/slice_len.rs:6:6: 6:19
2424
// + literal: Const { ty: &[u32; 3], val: Unevaluated(main, [], Some(promoted[0])) }
2525
_4 = _9; // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
2626
_3 = _4; // scope 0 at $DIR/slice_len.rs:+1:6: +1:19

src/test/mir-opt/const_prop/slice_len.main.ConstProp.64bit.diff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
StorageLive(_4); // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
2121
_9 = const _; // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
2222
// mir::Constant
23-
// + span: $DIR/slice_len.rs:5:6: 5:19
23+
// + span: $DIR/slice_len.rs:6:6: 6:19
2424
// + literal: Const { ty: &[u32; 3], val: Unevaluated(main, [], Some(promoted[0])) }
2525
_4 = _9; // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
2626
_3 = _4; // scope 0 at $DIR/slice_len.rs:+1:6: +1:19

src/test/mir-opt/const_prop/slice_len.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// compile-flags: -Zmir-enable-passes=-SimplifyLocals-before-const-prop
12
// EMIT_MIR_FOR_EACH_BIT_WIDTH
23

34
// EMIT_MIR slice_len.main.ConstProp.diff

0 commit comments

Comments
 (0)