Skip to content

Commit

Permalink
update tests that are ignored by debug
Browse files Browse the repository at this point in the history
  • Loading branch information
dingxiangfei2009 committed Aug 31, 2023
1 parent 39cf0b5 commit 67553e8
Show file tree
Hide file tree
Showing 20 changed files with 326 additions and 278 deletions.
6 changes: 3 additions & 3 deletions tests/codegen/slice-as_chunks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ pub fn chunks4(x: &[u8]) -> &[[u8; 4]] {
// CHECK-LABEL: @chunks4_with_remainder
#[no_mangle]
pub fn chunks4_with_remainder(x: &[u8]) -> (&[[u8; 4]], &[u8]) {
// CHECK: and i64 %x.1, -4
// CHECK: and i64 %x.1, 3
// CHECK: lshr exact
// CHECK-DAG: and i64 %x.1, -4
// CHECK-DAG: and i64 %x.1, 3
// CHECK-DAG: lshr
// CHECK-NOT: mul
// CHECK-NOT: udiv
// CHECK-NOT: urem
Expand Down
6 changes: 3 additions & 3 deletions tests/codegen/slice-iter-nonnull.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,13 @@ pub fn slice_iter_is_empty(it: &std::slice::Iter<'_, u32>) -> bool {
// CHECK-LABEL: @slice_iter_len
#[no_mangle]
pub fn slice_iter_len(it: &std::slice::Iter<'_, u32>) -> usize {
// CHECK: %[[START:.+]] = load ptr, ptr %it,
// CHECK-SAME: !nonnull
// CHECK-SAME: !noundef
// CHECK: %[[ENDP:.+]] = getelementptr{{.+}}ptr %it,{{.+}} 1
// CHECK: %[[END:.+]] = load ptr, ptr %[[ENDP]]
// CHECK-SAME: !nonnull
// CHECK-SAME: !noundef
// CHECK: %[[START:.+]] = load ptr, ptr %it,
// CHECK-SAME: !nonnull
// CHECK-SAME: !noundef

// CHECK: ptrtoint
// CHECK: ptrtoint
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,130 +7,111 @@ fn naive(_1: &Blueprint, _2: &Blueprint) -> bool {
let mut _3: u32;
let mut _4: u32;
let mut _5: bool;
let mut _6: bool;
let mut _6: u32;
let mut _7: u32;
let mut _8: u32;
let mut _9: bool;
let mut _10: bool;
let mut _11: u32;
let mut _8: bool;
let mut _9: u32;
let mut _10: u32;
let mut _11: bool;
let mut _12: u32;
let mut _13: bool;
let mut _13: u32;
let mut _14: bool;
let mut _15: u32;
let mut _16: u32;
let mut _17: bool;
let mut _18: u32;
let mut _19: u32;
let mut _20: bool;

bb0: {
StorageLive(_14);
StorageLive(_10);
StorageLive(_6);
StorageLive(_5);
StorageLive(_3);
_3 = ((*_1).0: u32);
StorageLive(_4);
_4 = ((*_2).0: u32);
_5 = Eq(move _3, move _4);
StorageDead(_4);
StorageDead(_3);
switchInt(move _5) -> [0: bb1, otherwise: bb2];
}

bb1: {
_6 = const false;
goto -> bb3;
StorageDead(_4);
StorageDead(_3);
goto -> bb8;
}

bb2: {
StorageLive(_9);
StorageLive(_7);
_7 = ((*_1).1: u32);
StorageDead(_4);
StorageDead(_3);
StorageLive(_8);
_8 = ((*_2).1: u32);
_9 = Eq(move _7, move _8);
StorageDead(_8);
StorageDead(_7);
_6 = move _9;
goto -> bb3;
StorageLive(_6);
_6 = ((*_1).1: u32);
StorageLive(_7);
_7 = ((*_2).1: u32);
_8 = Eq(move _6, move _7);
switchInt(move _8) -> [0: bb3, otherwise: bb4];
}

bb3: {
StorageDead(_9);
StorageDead(_5);
switchInt(move _6) -> [0: bb4, otherwise: bb5];
StorageDead(_7);
StorageDead(_6);
goto -> bb8;
}

bb4: {
_10 = const false;
goto -> bb6;
StorageDead(_7);
StorageDead(_6);
StorageLive(_11);
StorageLive(_9);
_9 = ((*_1).2: u32);
StorageLive(_10);
_10 = ((*_2).2: u32);
_11 = Eq(move _9, move _10);
switchInt(move _11) -> [0: bb5, otherwise: bb6];
}

bb5: {
StorageLive(_13);
StorageLive(_11);
_11 = ((*_1).2: u32);
StorageLive(_12);
_12 = ((*_2).2: u32);
_13 = Eq(move _11, move _12);
StorageDead(_12);
StorageDead(_11);
_10 = move _13;
goto -> bb6;
StorageDead(_10);
StorageDead(_9);
goto -> bb8;
}

bb6: {
StorageDead(_13);
StorageDead(_6);
switchInt(move _10) -> [0: bb7, otherwise: bb8];
StorageDead(_10);
StorageDead(_9);
StorageLive(_14);
StorageLive(_12);
_12 = ((*_1).3: u32);
StorageLive(_13);
_13 = ((*_2).3: u32);
_14 = Eq(move _12, move _13);
switchInt(move _14) -> [0: bb7, otherwise: bb9];
}

bb7: {
_14 = const false;
goto -> bb9;
StorageDead(_13);
StorageDead(_12);
goto -> bb8;
}

bb8: {
StorageLive(_17);
_0 = const false;
goto -> bb10;
}

bb9: {
StorageDead(_13);
StorageDead(_12);
StorageLive(_15);
_15 = ((*_1).3: u32);
_15 = ((*_1).4: u32);
StorageLive(_16);
_16 = ((*_2).3: u32);
_17 = Eq(move _15, move _16);
_16 = ((*_2).4: u32);
_0 = Eq(move _15, move _16);
StorageDead(_16);
StorageDead(_15);
_14 = move _17;
goto -> bb9;
}

bb9: {
StorageDead(_17);
StorageDead(_10);
switchInt(move _14) -> [0: bb10, otherwise: bb11];
goto -> bb10;
}

bb10: {
_0 = const false;
goto -> bb12;
}

bb11: {
StorageLive(_20);
StorageLive(_18);
_18 = ((*_1).4: u32);
StorageLive(_19);
_19 = ((*_2).4: u32);
_20 = Eq(move _18, move _19);
StorageDead(_19);
StorageDead(_18);
_0 = move _20;
goto -> bb12;
}

bb12: {
StorageDead(_20);
StorageDead(_14);
StorageDead(_11);
StorageDead(_8);
StorageDead(_5);
return;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,94 +27,104 @@ fn returning(_1: &Blueprint, _2: &Blueprint) -> bool {
StorageLive(_4);
_4 = ((*_2).0: u32);
_5 = Ne(move _3, move _4);
StorageDead(_4);
StorageDead(_3);
switchInt(move _5) -> [0: bb1, otherwise: bb10];
}

bb1: {
StorageDead(_4);
StorageDead(_3);
StorageDead(_5);
StorageLive(_8);
StorageLive(_6);
_6 = ((*_1).1: u32);
StorageLive(_7);
_7 = ((*_2).1: u32);
_8 = Ne(move _6, move _7);
StorageDead(_7);
StorageDead(_6);
switchInt(move _8) -> [0: bb2, otherwise: bb9];
}

bb2: {
StorageDead(_7);
StorageDead(_6);
StorageDead(_8);
StorageLive(_11);
StorageLive(_9);
_9 = ((*_1).2: u32);
StorageLive(_10);
_10 = ((*_2).2: u32);
_11 = Ne(move _9, move _10);
StorageDead(_10);
StorageDead(_9);
switchInt(move _11) -> [0: bb3, otherwise: bb8];
}

bb3: {
StorageDead(_10);
StorageDead(_9);
StorageDead(_11);
StorageLive(_14);
StorageLive(_12);
_12 = ((*_1).3: u32);
StorageLive(_13);
_13 = ((*_2).3: u32);
_14 = Ne(move _12, move _13);
StorageDead(_13);
StorageDead(_12);
switchInt(move _14) -> [0: bb4, otherwise: bb7];
}

bb4: {
StorageDead(_13);
StorageDead(_12);
StorageDead(_14);
StorageLive(_17);
StorageLive(_15);
_15 = ((*_1).4: u32);
StorageLive(_16);
_16 = ((*_2).4: u32);
_17 = Ne(move _15, move _16);
StorageDead(_16);
StorageDead(_15);
switchInt(move _17) -> [0: bb5, otherwise: bb6];
}

bb5: {
StorageDead(_16);
StorageDead(_15);
StorageDead(_17);
_0 = const true;
goto -> bb11;
}

bb6: {
StorageDead(_16);
StorageDead(_15);
_0 = const false;
StorageDead(_17);
goto -> bb11;
}

bb7: {
StorageDead(_13);
StorageDead(_12);
_0 = const false;
StorageDead(_14);
goto -> bb11;
}

bb8: {
StorageDead(_10);
StorageDead(_9);
_0 = const false;
StorageDead(_11);
goto -> bb11;
}

bb9: {
StorageDead(_7);
StorageDead(_6);
_0 = const false;
StorageDead(_8);
goto -> bb11;
}

bb10: {
StorageDead(_4);
StorageDead(_3);
_0 = const false;
StorageDead(_5);
goto -> bb11;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,22 @@ fn step_forward(_1: u32, _2: usize) -> u32 {
_5 = Eq(_4, const 1_isize);
_6 = Not(move _5);
StorageDead(_5);
StorageDead(_3);
StorageDead(_8);
switchInt(move _6) -> [0: bb3, otherwise: bb2];
switchInt(move _6) -> [0: bb2, otherwise: bb3];
}

bb2: {
assert(!const true, "attempt to compute `{} + {}`, which would overflow", const _, const 1_u32) -> [success: bb3, unwind continue];
StorageDead(_3);
StorageDead(_8);
goto -> bb4;
}

bb3: {
StorageDead(_3);
StorageDead(_8);
assert(!const true, "attempt to compute `{} + {}`, which would overflow", const _, const 1_u32) -> [success: bb4, unwind continue];
}

bb4: {
StorageDead(_6);
StorageLive(_7);
_7 = _2 as u32 (IntToInt);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,19 @@ fn int_range(_1: usize, _2: usize) -> () {
_7 = Lt(move _5, move _6);
StorageDead(_6);
StorageDead(_5);
StorageDead(_16);
StorageDead(_15);
switchInt(move _7) -> [0: bb2, otherwise: bb3];
}

bb2: {
StorageDead(_16);
StorageDead(_15);
_8 = Option::<usize>::None;
goto -> bb5;
}

bb3: {
StorageDead(_16);
StorageDead(_15);
_9 = (_4.0: usize);
StorageLive(_10);
_10 = <usize as Step>::forward_unchecked(_9, const 1_usize) -> [return: bb4, unwind continue];
Expand Down
Loading

0 comments on commit 67553e8

Please sign in to comment.