Make tests unit.

This commit is contained in:
Camille GILLOT 2022-12-04 19:38:46 +00:00
parent d9ee0f468f
commit 22e9e52c84
16 changed files with 22 additions and 17 deletions

View file

@ -10,12 +10,12 @@ fn main() -> () {
StorageLive(_2); // scope 0 at $DIR/const_allocation.rs:+1:5: +1:8
_2 = const {alloc1: &&[(Option<i32>, &[&str])]}; // scope 0 at $DIR/const_allocation.rs:+1:5: +1:8
// mir::Constant
// + span: $DIR/const_allocation.rs:8:5: 8:8
// + span: $DIR/const_allocation.rs:9:5: 9:8
// + literal: Const { ty: &&[(Option<i32>, &[&str])], val: Value(Scalar(alloc1)) }
_1 = (*_2); // scope 0 at $DIR/const_allocation.rs:+1:5: +1:8
StorageDead(_2); // scope 0 at $DIR/const_allocation.rs:+1:8: +1:9
StorageDead(_1); // scope 0 at $DIR/const_allocation.rs:+1:8: +1:9
nop; // scope 0 at $DIR/const_allocation.rs:+0:11: +2:2
_0 = const (); // scope 0 at $DIR/const_allocation.rs:+0:11: +2:2
return; // scope 0 at $DIR/const_allocation.rs:+2:2: +2:2
}
}

View file

@ -10,12 +10,12 @@ fn main() -> () {
StorageLive(_2); // scope 0 at $DIR/const_allocation.rs:+1:5: +1:8
_2 = const {alloc1: &&[(Option<i32>, &[&str])]}; // scope 0 at $DIR/const_allocation.rs:+1:5: +1:8
// mir::Constant
// + span: $DIR/const_allocation.rs:8:5: 8:8
// + span: $DIR/const_allocation.rs:9:5: 9:8
// + literal: Const { ty: &&[(Option<i32>, &[&str])], val: Value(Scalar(alloc1)) }
_1 = (*_2); // scope 0 at $DIR/const_allocation.rs:+1:5: +1:8
StorageDead(_2); // scope 0 at $DIR/const_allocation.rs:+1:8: +1:9
StorageDead(_1); // scope 0 at $DIR/const_allocation.rs:+1:8: +1:9
nop; // scope 0 at $DIR/const_allocation.rs:+0:11: +2:2
_0 = const (); // scope 0 at $DIR/const_allocation.rs:+0:11: +2:2
return; // scope 0 at $DIR/const_allocation.rs:+2:2: +2:2
}
}

View file

@ -1,3 +1,4 @@
// unit-test: ConstProp
// ignore-endian-big
// EMIT_MIR_FOR_EACH_BIT_WIDTH
static FOO: &[(Option<i32>, &[&str])] =

View file

@ -10,12 +10,12 @@ fn main() -> () {
StorageLive(_2); // scope 0 at $DIR/const_allocation2.rs:+1:5: +1:8
_2 = const {alloc1: &&[(Option<i32>, &[&u8])]}; // scope 0 at $DIR/const_allocation2.rs:+1:5: +1:8
// mir::Constant
// + span: $DIR/const_allocation2.rs:5:5: 5:8
// + span: $DIR/const_allocation2.rs:6:5: 6:8
// + literal: Const { ty: &&[(Option<i32>, &[&u8])], val: Value(Scalar(alloc1)) }
_1 = (*_2); // scope 0 at $DIR/const_allocation2.rs:+1:5: +1:8
StorageDead(_2); // scope 0 at $DIR/const_allocation2.rs:+1:8: +1:9
StorageDead(_1); // scope 0 at $DIR/const_allocation2.rs:+1:8: +1:9
nop; // scope 0 at $DIR/const_allocation2.rs:+0:11: +2:2
_0 = const (); // scope 0 at $DIR/const_allocation2.rs:+0:11: +2:2
return; // scope 0 at $DIR/const_allocation2.rs:+2:2: +2:2
}
}

View file

@ -10,12 +10,12 @@ fn main() -> () {
StorageLive(_2); // scope 0 at $DIR/const_allocation2.rs:+1:5: +1:8
_2 = const {alloc1: &&[(Option<i32>, &[&u8])]}; // scope 0 at $DIR/const_allocation2.rs:+1:5: +1:8
// mir::Constant
// + span: $DIR/const_allocation2.rs:5:5: 5:8
// + span: $DIR/const_allocation2.rs:6:5: 6:8
// + literal: Const { ty: &&[(Option<i32>, &[&u8])], val: Value(Scalar(alloc1)) }
_1 = (*_2); // scope 0 at $DIR/const_allocation2.rs:+1:5: +1:8
StorageDead(_2); // scope 0 at $DIR/const_allocation2.rs:+1:8: +1:9
StorageDead(_1); // scope 0 at $DIR/const_allocation2.rs:+1:8: +1:9
nop; // scope 0 at $DIR/const_allocation2.rs:+0:11: +2:2
_0 = const (); // scope 0 at $DIR/const_allocation2.rs:+0:11: +2:2
return; // scope 0 at $DIR/const_allocation2.rs:+2:2: +2:2
}
}

View file

@ -1,3 +1,4 @@
// unit-test: ConstProp
// ignore-endian-big
// EMIT_MIR_FOR_EACH_BIT_WIDTH
// EMIT_MIR const_allocation2.main.ConstProp.after.mir

View file

@ -10,12 +10,12 @@ fn main() -> () {
StorageLive(_2); // scope 0 at $DIR/const_allocation3.rs:+1:5: +1:8
_2 = const {alloc1: &&Packed}; // scope 0 at $DIR/const_allocation3.rs:+1:5: +1:8
// mir::Constant
// + span: $DIR/const_allocation3.rs:5:5: 5:8
// + span: $DIR/const_allocation3.rs:6:5: 6:8
// + literal: Const { ty: &&Packed, val: Value(Scalar(alloc1)) }
_1 = (*_2); // scope 0 at $DIR/const_allocation3.rs:+1:5: +1:8
StorageDead(_2); // scope 0 at $DIR/const_allocation3.rs:+1:8: +1:9
StorageDead(_1); // scope 0 at $DIR/const_allocation3.rs:+1:8: +1:9
nop; // scope 0 at $DIR/const_allocation3.rs:+0:11: +2:2
_0 = const (); // scope 0 at $DIR/const_allocation3.rs:+0:11: +2:2
return; // scope 0 at $DIR/const_allocation3.rs:+2:2: +2:2
}
}

View file

@ -10,12 +10,12 @@ fn main() -> () {
StorageLive(_2); // scope 0 at $DIR/const_allocation3.rs:+1:5: +1:8
_2 = const {alloc1: &&Packed}; // scope 0 at $DIR/const_allocation3.rs:+1:5: +1:8
// mir::Constant
// + span: $DIR/const_allocation3.rs:5:5: 5:8
// + span: $DIR/const_allocation3.rs:6:5: 6:8
// + literal: Const { ty: &&Packed, val: Value(Scalar(alloc1)) }
_1 = (*_2); // scope 0 at $DIR/const_allocation3.rs:+1:5: +1:8
StorageDead(_2); // scope 0 at $DIR/const_allocation3.rs:+1:8: +1:9
StorageDead(_1); // scope 0 at $DIR/const_allocation3.rs:+1:8: +1:9
nop; // scope 0 at $DIR/const_allocation3.rs:+0:11: +2:2
_0 = const (); // scope 0 at $DIR/const_allocation3.rs:+0:11: +2:2
return; // scope 0 at $DIR/const_allocation3.rs:+2:2: +2:2
}
}

View file

@ -1,3 +1,4 @@
// unit-test: ConstProp
// ignore-endian-big
// EMIT_MIR_FOR_EACH_BIT_WIDTH
// EMIT_MIR const_allocation3.main.ConstProp.after.mir

View file

@ -13,7 +13,7 @@
StorageLive(_2); // scope 0 at $DIR/ref_deref.rs:+1:6: +1:10
_4 = const _; // scope 0 at $DIR/ref_deref.rs:+1:6: +1:10
// mir::Constant
// + span: $DIR/ref_deref.rs:5:6: 5:10
// + span: $DIR/ref_deref.rs:6:6: 6:10
// + literal: Const { ty: &i32, val: Unevaluated(main, [], Some(promoted[0])) }
_2 = _4; // scope 0 at $DIR/ref_deref.rs:+1:6: +1:10
- _1 = (*_2); // scope 0 at $DIR/ref_deref.rs:+1:5: +1:10

View file

@ -16,7 +16,7 @@
- _2 = &_3; // scope 0 at $DIR/ref_deref.rs:+1:6: +1:10
+ _4 = const _; // scope 0 at $DIR/ref_deref.rs:+1:6: +1:10
+ // mir::Constant
+ // + span: $DIR/ref_deref.rs:5:6: 5:10
+ // + span: $DIR/ref_deref.rs:6:6: 6:10
+ // + literal: Const { ty: &i32, val: Unevaluated(main, [], Some(promoted[0])) }
+ _2 = &(*_4); // scope 0 at $DIR/ref_deref.rs:+1:6: +1:10
_1 = (*_2); // scope 0 at $DIR/ref_deref.rs:+1:5: +1:10

View file

@ -1,3 +1,4 @@
// compile-flags: -Zmir-enable-passes=-SimplifyLocals-before-const-prop
// EMIT_MIR ref_deref.main.PromoteTemps.diff
// EMIT_MIR ref_deref.main.ConstProp.diff

View file

@ -1,4 +1,4 @@
// unit-test
// compile-flags: -Zmir-enable-passes=-SimplifyLocals-before-const-prop
// EMIT_MIR ref_deref_project.main.PromoteTemps.diff
// EMIT_MIR ref_deref_project.main.ConstProp.diff

View file

@ -20,7 +20,7 @@
StorageLive(_4); // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
_9 = const _; // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
// mir::Constant
// + span: $DIR/slice_len.rs:5:6: 5:19
// + span: $DIR/slice_len.rs:6:6: 6:19
// + literal: Const { ty: &[u32; 3], val: Unevaluated(main, [], Some(promoted[0])) }
_4 = _9; // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
_3 = _4; // scope 0 at $DIR/slice_len.rs:+1:6: +1:19

View file

@ -20,7 +20,7 @@
StorageLive(_4); // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
_9 = const _; // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
// mir::Constant
// + span: $DIR/slice_len.rs:5:6: 5:19
// + span: $DIR/slice_len.rs:6:6: 6:19
// + literal: Const { ty: &[u32; 3], val: Unevaluated(main, [], Some(promoted[0])) }
_4 = _9; // scope 0 at $DIR/slice_len.rs:+1:6: +1:19
_3 = _4; // scope 0 at $DIR/slice_len.rs:+1:6: +1:19

View file

@ -1,3 +1,4 @@
// compile-flags: -Zmir-enable-passes=-SimplifyLocals-before-const-prop
// EMIT_MIR_FOR_EACH_BIT_WIDTH
// EMIT_MIR slice_len.main.ConstProp.diff