Skip to content

Commit

Permalink
Fix codegen and mir-opt tests
Browse files Browse the repository at this point in the history
Mostly renamed allocations, but I'm not sure about the const prop tests
  • Loading branch information
jonas-schievink committed Apr 20, 2020
1 parent c5bfbb6 commit a5c1851
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 19 deletions.
1 change: 0 additions & 1 deletion src/librustc_mir/interpret/eval_context.rs
Expand Up @@ -760,7 +760,6 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
self.deallocate_local(local.value)?;
}

let return_place = frame.return_place;
if M::after_stack_pop(self, frame, unwinding)? == StackPopJump::NoJump {
// The hook already did everything.
// We want to skip the `info!` below, hence early return.
Expand Down
4 changes: 2 additions & 2 deletions src/test/codegen/consts.rs
Expand Up @@ -10,11 +10,11 @@
// CHECK: @STATIC = {{.*}}, align 4

// This checks the constants from inline_enum_const
// CHECK: @alloc5 = {{.*}}, align 2
// CHECK: @alloc7 = {{.*}}, 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
// CHECK: [[LOW_HIGH:@[0-9]+]] = {{.*}} getelementptr inbounds (<{ [8 x i8] }>, <{ [8 x i8] }>* @alloc15, i32 0, i32 0, i32 0), {{.*}}
// CHECK: [[LOW_HIGH:@[0-9]+]] = {{.*}} getelementptr inbounds (<{ [8 x i8] }>, <{ [8 x i8] }>* @alloc19, i32 0, i32 0, i32 0), {{.*}}

#[derive(Copy, Clone)]
// repr(i16) is required for the {low,high}_align_const test
Expand Down
Expand Up @@ -30,44 +30,44 @@ fn main() -> () {
}

alloc0 (static: FOO, size: 16, align: 8) {
╾──────alloc24+0──────╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
╾──────alloc25+0──────╼ 03 00 00 00 00 00 00 00 │ ╾──────╼........
}

alloc24 (size: 72, align: 8) {
0x00 │ 00 00 00 00 __ __ __ __ ╾──────alloc9+0───────╼ │ ....░░░░╾──────╼
alloc25 (size: 72, align: 8) {
0x00 │ 00 00 00 00 __ __ __ __ ╾──────alloc10+0──────╼ │ ....░░░░╾──────╼
0x10 │ 00 00 00 00 00 00 00 00 00 00 00 00 __ __ __ __ │ ............░░░░
0x20 │ ╾──────alloc14+0──────╼ 02 00 00 00 00 00 00 00 │ ╾──────╼........
0x30 │ 01 00 00 00 2a 00 00 00 ╾──────alloc22+0──────╼ │ ....*...╾──────╼
0x20 │ ╾──────alloc15+0──────╼ 02 00 00 00 00 00 00 00 │ ╾──────╼........
0x30 │ 01 00 00 00 2a 00 00 00 ╾──────alloc23+0──────╼ │ ....*...╾──────╼
0x40 │ 03 00 00 00 00 00 00 00 │ ........
}

alloc9 (size: 0, align: 8) {}
alloc10 (size: 0, align: 8) {}

alloc14 (size: 16, align: 8) {
╾──────alloc12+0──────╼ ╾──────alloc13+0──────╼ │ ╾──────╼╾──────╼
alloc15 (size: 16, align: 8) {
╾──────alloc13+0──────╼ ╾──────alloc14+0──────╼ │ ╾──────╼╾──────╼
}

alloc12 (size: 1, align: 1) {
alloc13 (size: 1, align: 1) {
05 │ .
}

alloc13 (size: 1, align: 1) {
alloc14 (size: 1, align: 1) {
06 │ .
}

alloc22 (size: 24, align: 8) {
0x00 │ ╾──────alloc18+3──────╼ ╾──────alloc19+0──────╼ │ ╾──────╼╾──────╼
0x10 │ ╾──────alloc21+2──────╼ │ ╾──────╼
alloc23 (size: 24, align: 8) {
0x00 │ ╾──────alloc19+3──────╼ ╾──────alloc20+0──────╼ │ ╾──────╼╾──────╼
0x10 │ ╾──────alloc22+2──────╼ │ ╾──────╼
}

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

alloc19 (size: 1, align: 1) {
alloc20 (size: 1, align: 1) {
2a │ *
}

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

0 comments on commit a5c1851

Please sign in to comment.