Skip to content

Commit

Permalink
bless mir-opt, codegen, and remaining ui tests
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Jul 14, 2021
1 parent ae950a2 commit 1f21ab1
Show file tree
Hide file tree
Showing 17 changed files with 140 additions and 146 deletions.
2 changes: 1 addition & 1 deletion src/test/codegen/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// CHECK: @STATIC = {{.*}}, align 4

// This checks the constants from inline_enum_const
// CHECK: @alloc8 = {{.*}}, align 2
// CHECK: @alloc9 = {{.*}}, align 2

// This checks the constants from {low,high}_align_const, they share the same
// constant, but the alignment differs, so the higher one should be used
Expand Down
2 changes: 1 addition & 1 deletion src/test/codegen/remap_path_prefix/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ mod aux_mod;
include!("aux_mod.rs");

// Here we check that the expansion of the file!() macro is mapped.
// CHECK: @alloc1 = private unnamed_addr constant <{ [34 x i8] }> <{ [34 x i8] c"/the/src/remap_path_prefix/main.rs" }>, align 1
// CHECK: @alloc2 = private unnamed_addr constant <{ [34 x i8] }> <{ [34 x i8] c"/the/src/remap_path_prefix/main.rs" }>, align 1
pub static FILE_PATH: &'static str = file!();

fn main() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ fn main() -> () {
_1 = const b"foo"; // scope 0 at $DIR/byte_slice.rs:5:13: 5:19
// ty::Const
// + ty: &[u8; 3]
// + val: Value(Scalar(alloc0))
// + val: Value(Scalar(alloc1))
// mir::Constant
// + span: $DIR/byte_slice.rs:5:13: 5:19
// + literal: Const { ty: &[u8; 3], val: Value(Scalar(alloc0)) }
// + literal: Const { ty: &[u8; 3], val: Value(Scalar(alloc1)) }
StorageLive(_2); // scope 1 at $DIR/byte_slice.rs:6:9: 6:10
_2 = [const 5_u8, const 120_u8]; // scope 1 at $DIR/byte_slice.rs:6:13: 6:24
_0 = const (); // scope 0 at $DIR/byte_slice.rs:4:11: 7:2
Expand All @@ -29,6 +29,6 @@ fn main() -> () {
}
}

alloc0 (size: 3, align: 1) {
alloc1 (size: 3, align: 1) {
66 6f 6f │ foo
}
40 changes: 20 additions & 20 deletions src/test/mir-opt/const_allocation.main.ConstProp.after.32bit.mir
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ fn main() -> () {
bb0: {
StorageLive(_1); // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
StorageLive(_2); // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
_2 = const {alloc0: &&[(Option<i32>, &[&str])]}; // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
_2 = const {alloc1: &&[(Option<i32>, &[&str])]}; // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
// ty::Const
// + ty: &&[(std::option::Option<i32>, &[&str])]
// + val: Value(Scalar(alloc0))
// + val: Value(Scalar(alloc1))
// mir::Constant
// + span: $DIR/const_allocation.rs:8:5: 8:8
// + literal: Const { ty: &&[(std::option::Option<i32>, &[&str])], val: Value(Scalar(alloc0)) }
// + literal: Const { ty: &&[(std::option::Option<i32>, &[&str])], val: Value(Scalar(alloc1)) }
_1 = (*_2); // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
StorageDead(_2); // scope 0 at $DIR/const_allocation.rs:8:8: 8:9
StorageDead(_1); // scope 0 at $DIR/const_allocation.rs:8:8: 8:9
Expand All @@ -23,43 +23,43 @@ fn main() -> () {
}
}

alloc0 (static: FOO, size: 8, align: 4) {
╾─alloc17─╼ 03 00 00 00 │ ╾──╼....
alloc1 (static: FOO, size: 8, align: 4) {
╾─alloc18─╼ 03 00 00 00 │ ╾──╼....
}

alloc17 (size: 48, align: 4) {
0x0000 00 00 00 __ __ __ __ ╾─alloc4──╼ 00 00 00 00 │ ....░░░░╾──╼....
0x1000 00 00 00 __ __ __ __ ╾─alloc8──╼ 02 00 00 00 │ ....░░░░╾──╼....
0x2001 00 00 00 2a 00 00 00 ╾─alloc13─╼ 03 00 00 00 │ ....*...╾──╼....
alloc18 (size: 48, align: 4) {
0x0000 00 00 00 __ __ __ __ ╾─alloc5──╼ 00 00 00 00 │ ....░░░░╾──╼....
0x1000 00 00 00 __ __ __ __ ╾─alloc9──╼ 02 00 00 00 │ ....░░░░╾──╼....
0x2001 00 00 00 2a 00 00 00 ╾─alloc14─╼ 03 00 00 00 │ ....*...╾──╼....
}

alloc4 (size: 0, align: 4) {}
alloc5 (size: 0, align: 4) {}

alloc8 (size: 16, align: 4) {
╾─alloc7──╼ 03 00 00 00 ╾─alloc9──╼ 03 00 00 00 │ ╾──╼....╾──╼....
alloc9 (size: 16, align: 4) {
╾─alloc8──╼ 03 00 00 00 ╾─alloc10─╼ 03 00 00 00 │ ╾──╼....╾──╼....
}

alloc7 (size: 3, align: 1) {
alloc8 (size: 3, align: 1) {
66 6f 6f │ foo
}

alloc9 (size: 3, align: 1) {
alloc10 (size: 3, align: 1) {
62 61 72 │ bar
}

alloc13 (size: 24, align: 4) {
0x00 │ ╾─alloc12─╼ 03 00 00 00 ╾─alloc14─╼ 03 00 00 00 │ ╾──╼....╾──╼....
0x10 │ ╾─alloc15─╼ 04 00 00 00 │ ╾──╼....
alloc14 (size: 24, align: 4) {
0x00 │ ╾─alloc13─╼ 03 00 00 00 ╾─alloc15─╼ 03 00 00 00 │ ╾──╼....╾──╼....
0x10 │ ╾─alloc16─╼ 04 00 00 00 │ ╾──╼....
}

alloc12 (size: 3, align: 1) {
alloc13 (size: 3, align: 1) {
6d 65 68 │ meh
}

alloc14 (size: 3, align: 1) {
alloc15 (size: 3, align: 1) {
6d 6f 70 │ mop
}

alloc15 (size: 4, align: 1) {
alloc16 (size: 4, align: 1) {
6d c3 b6 70 │ m..p
}
44 changes: 22 additions & 22 deletions src/test/mir-opt/const_allocation.main.ConstProp.after.64bit.mir
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ fn main() -> () {
bb0: {
StorageLive(_1); // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
StorageLive(_2); // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
_2 = const {alloc0: &&[(Option<i32>, &[&str])]}; // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
_2 = const {alloc1: &&[(Option<i32>, &[&str])]}; // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
// ty::Const
// + ty: &&[(std::option::Option<i32>, &[&str])]
// + val: Value(Scalar(alloc0))
// + val: Value(Scalar(alloc1))
// mir::Constant
// + span: $DIR/const_allocation.rs:8:5: 8:8
// + literal: Const { ty: &&[(std::option::Option<i32>, &[&str])], val: Value(Scalar(alloc0)) }
// + literal: Const { ty: &&[(std::option::Option<i32>, &[&str])], val: Value(Scalar(alloc1)) }
_1 = (*_2); // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
StorageDead(_2); // scope 0 at $DIR/const_allocation.rs:8:8: 8:9
StorageDead(_1); // scope 0 at $DIR/const_allocation.rs:8:8: 8:9
Expand All @@ -23,47 +23,47 @@ fn main() -> () {
}
}

alloc0 (static: FOO, size: 16, align: 8) {
╾───────alloc17───────╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
alloc1 (static: FOO, size: 16, align: 8) {
╾───────alloc18───────╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
}

alloc17 (size: 72, align: 8) {
0x0000 00 00 00 __ __ __ __ ╾───────alloc4────────╼ │ ....░░░░╾──────╼
alloc18 (size: 72, align: 8) {
0x0000 00 00 00 __ __ __ __ ╾───────alloc5────────╼ │ ....░░░░╾──────╼
0x1000 00 00 00 00 00 00 00 00 00 00 00 __ __ __ __ │ ............░░░░
0x20 │ ╾───────alloc8────────╼ 02 00 00 00 00 00 00 00 │ ╾──────╼........
0x3001 00 00 00 2a 00 00 00 ╾───────alloc13───────╼ │ ....*...╾──────╼
0x20 │ ╾───────alloc9────────╼ 02 00 00 00 00 00 00 00 │ ╾──────╼........
0x3001 00 00 00 2a 00 00 00 ╾───────alloc14───────╼ │ ....*...╾──────╼
0x4003 00 00 00 00 00 00 00 │ ........
}

alloc4 (size: 0, align: 8) {}
alloc5 (size: 0, align: 8) {}

alloc8 (size: 32, align: 8) {
0x00 │ ╾───────alloc7────────╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
0x10 │ ╾───────alloc9────────╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
alloc9 (size: 32, align: 8) {
0x00 │ ╾───────alloc8────────╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
0x10 │ ╾───────alloc10───────╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
}

alloc7 (size: 3, align: 1) {
alloc8 (size: 3, align: 1) {
66 6f 6f │ foo
}

alloc9 (size: 3, align: 1) {
alloc10 (size: 3, align: 1) {
62 61 72 │ bar
}

alloc13 (size: 48, align: 8) {
0x00 │ ╾───────alloc12───────╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
0x10 │ ╾───────alloc14───────╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
0x20 │ ╾───────alloc15───────╼ 04 00 00 00 00 00 00 00 │ ╾──────╼........
alloc14 (size: 48, align: 8) {
0x00 │ ╾───────alloc13───────╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
0x10 │ ╾───────alloc15───────╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
0x20 │ ╾───────alloc16───────╼ 04 00 00 00 00 00 00 00 │ ╾──────╼........
}

alloc12 (size: 3, align: 1) {
alloc13 (size: 3, align: 1) {
6d 65 68 │ meh
}

alloc14 (size: 3, align: 1) {
alloc15 (size: 3, align: 1) {
6d 6f 70 │ mop
}

alloc15 (size: 4, align: 1) {
alloc16 (size: 4, align: 1) {
6d c3 b6 70 │ m..p
}
38 changes: 19 additions & 19 deletions src/test/mir-opt/const_allocation2.main.ConstProp.after.32bit.mir
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ fn main() -> () {
bb0: {
StorageLive(_1); // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
StorageLive(_2); // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
_2 = const {alloc0: &&[(Option<i32>, &[&u8])]}; // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
_2 = const {alloc1: &&[(Option<i32>, &[&u8])]}; // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
// ty::Const
// + ty: &&[(std::option::Option<i32>, &[&u8])]
// + val: Value(Scalar(alloc0))
// + val: Value(Scalar(alloc1))
// mir::Constant
// + span: $DIR/const_allocation2.rs:5:5: 5:8
// + literal: Const { ty: &&[(std::option::Option<i32>, &[&u8])], val: Value(Scalar(alloc0)) }
// + literal: Const { ty: &&[(std::option::Option<i32>, &[&u8])], val: Value(Scalar(alloc1)) }
_1 = (*_2); // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
StorageDead(_2); // scope 0 at $DIR/const_allocation2.rs:5:8: 5:9
StorageDead(_1); // scope 0 at $DIR/const_allocation2.rs:5:8: 5:9
Expand All @@ -23,42 +23,42 @@ fn main() -> () {
}
}

alloc0 (static: FOO, size: 8, align: 4) {
╾─alloc27─╼ 03 00 00 00 │ ╾──╼....
alloc1 (static: FOO, size: 8, align: 4) {
╾─alloc28─╼ 03 00 00 00 │ ╾──╼....
}

alloc27 (size: 48, align: 4) {
0x0000 00 00 00 __ __ __ __ ╾─alloc12─╼ 00 00 00 00 │ ....░░░░╾──╼....
0x1000 00 00 00 __ __ __ __ ╾─alloc17─╼ 02 00 00 00 │ ....░░░░╾──╼....
0x2001 00 00 00 2a 00 00 00 ╾─alloc25─╼ 03 00 00 00 │ ....*...╾──╼....
alloc28 (size: 48, align: 4) {
0x0000 00 00 00 __ __ __ __ ╾─alloc13─╼ 00 00 00 00 │ ....░░░░╾──╼....
0x1000 00 00 00 __ __ __ __ ╾─alloc18─╼ 02 00 00 00 │ ....░░░░╾──╼....
0x2001 00 00 00 2a 00 00 00 ╾─alloc26─╼ 03 00 00 00 │ ....*...╾──╼....
}

alloc12 (size: 0, align: 4) {}
alloc13 (size: 0, align: 4) {}

alloc17 (size: 8, align: 4) {
╾─alloc15─╼ ╾─alloc16─╼ │ ╾──╼╾──╼
alloc18 (size: 8, align: 4) {
╾─alloc16─╼ ╾─alloc17─╼ │ ╾──╼╾──╼
}

alloc15 (size: 1, align: 1) {
alloc16 (size: 1, align: 1) {
05.
}

alloc16 (size: 1, align: 1) {
alloc17 (size: 1, align: 1) {
06.
}

alloc25 (size: 12, align: 4) {
╾─a21+0x3─╼ ╾─alloc22─╼ ╾─a24+0x2─╼ │ ╾──╼╾──╼╾──╼
alloc26 (size: 12, align: 4) {
╾─a22+0x3─╼ ╾─alloc23─╼ ╾─a25+0x2─╼ │ ╾──╼╾──╼╾──╼
}

alloc21 (size: 4, align: 1) {
alloc22 (size: 4, align: 1) {
2a 45 15 6f │ *E.o
}

alloc22 (size: 1, align: 1) {
alloc23 (size: 1, align: 1) {
2a │ *
}

alloc24 (size: 4, align: 1) {
alloc25 (size: 4, align: 1) {
2a 45 15 6f │ *E.o
}
40 changes: 20 additions & 20 deletions src/test/mir-opt/const_allocation2.main.ConstProp.after.64bit.mir
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ fn main() -> () {
bb0: {
StorageLive(_1); // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
StorageLive(_2); // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
_2 = const {alloc0: &&[(Option<i32>, &[&u8])]}; // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
_2 = const {alloc1: &&[(Option<i32>, &[&u8])]}; // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
// ty::Const
// + ty: &&[(std::option::Option<i32>, &[&u8])]
// + val: Value(Scalar(alloc0))
// + val: Value(Scalar(alloc1))
// mir::Constant
// + span: $DIR/const_allocation2.rs:5:5: 5:8
// + literal: Const { ty: &&[(std::option::Option<i32>, &[&u8])], val: Value(Scalar(alloc0)) }
// + literal: Const { ty: &&[(std::option::Option<i32>, &[&u8])], val: Value(Scalar(alloc1)) }
_1 = (*_2); // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
StorageDead(_2); // scope 0 at $DIR/const_allocation2.rs:5:8: 5:9
StorageDead(_1); // scope 0 at $DIR/const_allocation2.rs:5:8: 5:9
Expand All @@ -23,45 +23,45 @@ fn main() -> () {
}
}

alloc0 (static: FOO, size: 16, align: 8) {
╾───────alloc27───────╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
alloc1 (static: FOO, size: 16, align: 8) {
╾───────alloc28───────╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
}

alloc27 (size: 72, align: 8) {
0x0000 00 00 00 __ __ __ __ ╾───────alloc12───────╼ │ ....░░░░╾──────╼
alloc28 (size: 72, align: 8) {
0x0000 00 00 00 __ __ __ __ ╾───────alloc13───────╼ │ ....░░░░╾──────╼
0x1000 00 00 00 00 00 00 00 00 00 00 00 __ __ __ __ │ ............░░░░
0x20 │ ╾───────alloc17───────╼ 02 00 00 00 00 00 00 00 │ ╾──────╼........
0x3001 00 00 00 2a 00 00 00 ╾───────alloc25───────╼ │ ....*...╾──────╼
0x20 │ ╾───────alloc18───────╼ 02 00 00 00 00 00 00 00 │ ╾──────╼........
0x3001 00 00 00 2a 00 00 00 ╾───────alloc26───────╼ │ ....*...╾──────╼
0x4003 00 00 00 00 00 00 00 │ ........
}

alloc12 (size: 0, align: 8) {}
alloc13 (size: 0, align: 8) {}

alloc17 (size: 16, align: 8) {
╾───────alloc15───────╼ ╾───────alloc16───────╼ │ ╾──────╼╾──────╼
alloc18 (size: 16, align: 8) {
╾───────alloc16───────╼ ╾───────alloc17───────╼ │ ╾──────╼╾──────╼
}

alloc15 (size: 1, align: 1) {
alloc16 (size: 1, align: 1) {
05.
}

alloc16 (size: 1, align: 1) {
alloc17 (size: 1, align: 1) {
06.
}

alloc25 (size: 24, align: 8) {
0x00 │ ╾─────alloc21+0x3─────╼ ╾───────alloc22───────╼ │ ╾──────╼╾──────╼
0x10 │ ╾─────alloc24+0x2─────╼ │ ╾──────╼
alloc26 (size: 24, align: 8) {
0x00 │ ╾─────alloc22+0x3─────╼ ╾───────alloc23───────╼ │ ╾──────╼╾──────╼
0x10 │ ╾─────alloc25+0x2─────╼ │ ╾──────╼
}

alloc21 (size: 4, align: 1) {
alloc22 (size: 4, align: 1) {
2a 45 15 6f │ *E.o
}

alloc22 (size: 1, align: 1) {
alloc23 (size: 1, align: 1) {
2a │ *
}

alloc24 (size: 4, align: 1) {
alloc25 (size: 4, align: 1) {
2a 45 15 6f │ *E.o
}
Loading

0 comments on commit 1f21ab1

Please sign in to comment.