Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 52 additions & 5 deletions compiler/rustc_codegen_rmc/src/codegen/statement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use super::typ::TypeExt;
use super::typ::FN_RETURN_VOID_VAR_NAME;
use crate::GotocCtx;
use cbmc::goto_program::{BuiltinFn, Expr, Location, Stmt, Type};
use cbmc::goto_program::{BuiltinFn, Expr, ExprValue, Location, Stmt, Type};
use rustc_hir::def_id::DefId;
use rustc_middle::mir;
use rustc_middle::mir::{
Expand Down Expand Up @@ -472,11 +472,14 @@ impl<'tcx> GotocCtx<'tcx> {
// CBMC requires that the argument to the assertion must be a string constant.
// If there is one in the MIR, use it; otherwise, explain that we can't.
// TODO: give a better message here.
let arg = match fargs[0].struct_expr_values() {
Some(values) => values[0].clone(),
_ => Expr::string_constant(

// Rewrite panic string depending on "assertion failed" prefix being present or not
let arg = if let Some(s) = rewrite_panic_string(fargs) {
Expr::string_constant(&s)
} else {
Expr::string_constant(
"This is a placeholder assertion message; the rust message requires dynamic string formatting, which is not supported by CBMC",
),
)
};

let loc = self.codegen_span_option(span);
Expand Down Expand Up @@ -647,3 +650,47 @@ impl<'tcx> GotocCtx<'tcx> {
.with_location(self.codegen_span(&stmt.source_info.span))
}
}

/// Assertions, regardless of failing or being proven true are printed as "assertion failed". For example, "assertion failed 1==2: SUCCESS".
/// This is due to the rustc builtin macros formatting the panic string with "assertion failed" prefix inside expressions. This function rewrites the panic string.
fn rewrite_panic_string(fargs: Vec<Expr>) -> Option<String> {
// Extract the StringConstant from the Expr Struct
let extracted_string =
if let Some(s) = extract_panic_string(&fargs[0]) { s } else { return None };

// Rewrite the String only in the case of the prefix being "assertion failed"
// If there are changes to be made in the future, different helper functions can be called based on the prefix
let rewritten_string = if let Some(stripped) = extracted_string.strip_prefix("assertion failed")
{
rewrite_assertion_failed(stripped)
} else {
extracted_string.to_string()
};

Some(rewritten_string)
}

/// Helper function to extract the panic string from the Expr and return only the StringConstant that is wrapped inside
fn extract_panic_string(e: &Expr) -> Option<&str> {
// The goto needs the translation to be represented as `&"constant"[0]`. The Rust Str type needs to be represented as a struct for CBMC
let extracted_string: &str = match e.struct_expr_values().unwrap()[0].value() {
ExprValue::AddressOf(expr) => match expr.value() {
ExprValue::Index { array, .. } => match array.value() {
ExprValue::StringConstant { s } => s,
_ => return None,
},
_ => return None,
},
ExprValue::StringConstant { s } => s,
_ => return None,
};

Some(extracted_string)
}

/// Micro helper function that specifically handles the case of "assertion failed" StringConstants
/// If the prefix is changed or the handling needs to be changed, only this function needs to be rewritten
fn rewrite_assertion_failed(stripped_string: &str) -> String {
let rewritten_string = format!("assertion{}", stripped_string);
rewritten_string
}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[pair::rmc_tests::test_one_plus_two.assertion.1] line 31 assertion failed: p.sum() == 3: SUCCESS
[pair::rmc_tests::test_one_plus_two.assertion.1] line 31 assertion: p.sum() == 3: SUCCESS
2 changes: 1 addition & 1 deletion src/test/cargo-rmc/simple-config-toml/test_sum.expected
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[rmc_tests::test_sum.assertion.1] line 27 assertion failed: p.sum() == a.wrapping_add(b): SUCCESS
[rmc_tests::test_sum.assertion.1] line 27 assertion: p.sum() == a.wrapping_add(b): SUCCESS
2 changes: 1 addition & 1 deletion src/test/cargo-rmc/simple-lib/test_one_plus_two.expected
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[pair::rmc_tests::test_one_plus_two.assertion.1] line 31 assertion failed: p.sum() == 3: SUCCESS
[pair::rmc_tests::test_one_plus_two.assertion.1] line 31 assertion: p.sum() == 3: SUCCESS
2 changes: 1 addition & 1 deletion src/test/cargo-rmc/simple-lib/test_sum.expected
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[rmc_tests::test_sum.assertion.1] line 27 assertion failed: p.sum() == a.wrapping_add(b): SUCCESS
[rmc_tests::test_sum.assertion.1] line 27 assertion: p.sum() == a.wrapping_add(b): SUCCESS
2 changes: 1 addition & 1 deletion src/test/cargo-rmc/simple-main/main.expected
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[main.assertion.1] line 4 assertion failed: 1 == 2: FAILURE
[main.assertion.1] line 4 assertion: 1 == 2: FAILURE
VERIFICATION FAILED
4 changes: 2 additions & 2 deletions src/test/expected/allocation/expected
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
line 8 assertion failed: foo() == None: SUCCESS
line 11 assertion failed: foo() == y: SUCCESS
line 8 assertion: foo() == None: SUCCESS
line 11 assertion: foo() == y: SUCCESS
6 changes: 3 additions & 3 deletions src/test/expected/array/expected
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ array 'y'.0 upper bound in y.0[var_12]: SUCCESS
array 'y'.0 upper bound in y.0[var_16]: FAILURE
array 'x'.0 upper bound in x.0[var_3]: SUCCESS
array 'x'.0 upper bound in x.0[var_5]: SUCCESS
line 12 assertion failed: y[0] == 1: SUCCESS
line 13 assertion failed: y[1] == 2: SUCCESS
line 12 assertion: y[0] == 1: SUCCESS
line 13 assertion: y[1] == 2: SUCCESS
line 14 index out of bounds: the length is move _17 but the index is _16: FAILURE
line 14 assertion failed: y[z] == 3: FAILURE
line 14 assertion: y[z] == 3: FAILURE
1 change: 1 addition & 0 deletions src/test/expected/assertion-without-failed/expected
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
line 4 assertion: 1 == 2: FAILURE
5 changes: 5 additions & 0 deletions src/test/expected/assertion-without-failed/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0 OR MIT
pub fn main() {
assert!(1 == 2);
}
44 changes: 22 additions & 22 deletions src/test/expected/binop/expected
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
line 4 attempt to compute `move _8 + move _9`, which would overflow: SUCCESS
line 4 assertion failed: a + b == correct: SUCCESS
line 4 assertion: a + b == correct: SUCCESS
line 5 attempt to compute `move _15 + move _16`, which would overflow: SUCCESS
line 5 assertion failed: a + b == wrong: FAILURE
line 5 assertion: a + b == wrong: FAILURE
line 9 attempt to compute `move _8 - move _9`, which would overflow: SUCCESS
line 9 assertion failed: a - b == correct: SUCCESS
line 9 assertion: a - b == correct: SUCCESS
line 10 attempt to compute `move _15 - move _16`, which would overflow: SUCCESS
line 10 assertion failed: a - b == wrong: FAILURE
line 10 assertion: a - b == wrong: FAILURE
line 14 attempt to compute `move _8 * move _9`, which would overflow: SUCCESS
line 14 assertion failed: a * b == correct: SUCCESS
line 14 assertion: a * b == correct: SUCCESS
line 15 attempt to compute `move _15 * move _16`, which would overflow: SUCCESS
line 15 assertion failed: a * b == wrong: FAILURE
line 15 assertion: a * b == wrong: FAILURE
line 19 attempt to divide `_8` by zero: SUCCESS
line 19 attempt to compute `_8 / _9`, which would overflow: SUCCESS
line 19 assertion failed: a / b == correct: SUCCESS
line 19 assertion: a / b == correct: SUCCESS
line 20 attempt to divide `_18` by zero: SUCCESS
line 20 attempt to compute `_18 / _19`, which would overflow: SUCCESS
line 20 assertion failed: a / b == wrong: FAILURE
line 20 assertion: a / b == wrong: FAILURE
line 24 attempt to calculate the remainder of `_8` with a divisor of zero: SUCCESS
line 24 attempt to compute the remainder of `_8 % _9`, which would overflow: SUCCESS
line 24 assertion failed: a % b == correct: SUCCESS
line 24 assertion: a % b == correct: SUCCESS
line 25 attempt to calculate the remainder of `_18` with a divisor of zero: SUCCESS
line 25 attempt to compute the remainder of `_18 % _19`, which would overflow: SUCCESS
line 25 assertion failed: a % b == wrong: FAILURE
line 25 assertion: a % b == wrong: FAILURE
line 29 attempt to shift left by `move _9`, which would overflow: SUCCESS
line 29 assertion failed: a << b == correct: SUCCESS
line 29 assertion: a << b == correct: SUCCESS
line 30 attempt to shift left by `move _16`, which would overflow: SUCCESS
line 30 assertion failed: a << b == wrong: FAILURE
line 30 assertion: a << b == wrong: FAILURE
line 34 attempt to shift right by `move _9`, which would overflow: SUCCESS
line 34 assertion failed: a >> b == correct: SUCCESS
line 34 assertion: a >> b == correct: SUCCESS
line 35 attempt to shift right by `move _16`, which would overflow: SUCCESS
line 35 assertion failed: a >> b == wrong: FAILURE
line 35 assertion: a >> b == wrong: FAILURE
line 39 attempt to shift right by `move _9`, which would overflow: SUCCESS
line 39 assertion failed: a >> b == correct: SUCCESS
line 39 assertion: a >> b == correct: SUCCESS
line 40 attempt to shift right by `move _16`, which would overflow: SUCCESS
line 40 assertion failed: a >> b == wrong: FAILURE
line 44 assertion failed: a & b == correct: SUCCESS
line 45 assertion failed: a & b == wrong: FAILURE
line 49 assertion failed: a | b == correct: SUCCESS
line 50 assertion failed: a | b == wrong: FAILURE
line 54 assertion failed: a ^ b == correct: SUCCESS
line 55 assertion failed: a ^ b == wrong: FAILURE
line 40 assertion: a >> b == wrong: FAILURE
line 44 assertion: a & b == correct: SUCCESS
line 45 assertion: a & b == wrong: FAILURE
line 49 assertion: a | b == correct: SUCCESS
line 50 assertion: a | b == wrong: FAILURE
line 54 assertion: a ^ b == correct: SUCCESS
line 55 assertion: a ^ b == wrong: FAILURE
2 changes: 1 addition & 1 deletion src/test/expected/closure/expected
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ line 20 attempt to compute `move _8 + move _9`, which would overflow: SUCCESS
line 20 attempt to compute `move _5 + move _6`, which would overflow: SUCCESS
line 20 attempt to compute `(*((*_1).0: &mut i32)) + move _4`, which would overflow: SUCCESS
line 25 attempt to compute `move _18 + const 12_i32`, which would overflow: SUCCESS
line 25 assertion failed: original_num + 12 == num: SUCCESS
line 25 assertion: original_num + 12 == num: SUCCESS
line 25 arithmetic overflow on signed + in var_18 + 12: SUCCESS
4 changes: 2 additions & 2 deletions src/test/expected/closure2/expected
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
line 5 attempt to compute `move _3 + move _4`, which would overflow: SUCCESS
line 7 attempt to compute `move _3 + move _4`, which would overflow: SUCCESS
line 8 assertion failed: z == 102: SUCCESS
line 9 assertion failed: g(z) == 206: SUCCESS
line 8 assertion: z == 102: SUCCESS
line 9 assertion: g(z) == 206: SUCCESS
2 changes: 1 addition & 1 deletion src/test/expected/closure3/expected
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
line 16 attempt to compute `move _3 + move _4`, which would overflow: SUCCESS
line 17 attempt to compute `move _11 + const 10_i64`, which would overflow: SUCCESS
line 17 assertion failed: num + 10 == y: SUCCESS
line 17 assertion: num + 10 == y: SUCCESS
8 changes: 4 additions & 4 deletions src/test/expected/comp/expected
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
line 5 attempt to compute `move _6 + move _7`, which would overflow: SUCCESS
line 5 attempt to compute `move _10 + move _11`, which would overflow: SUCCESS
line 5 assertion failed: a + b == b + a: SUCCESS
line 5 assertion: a + b == b + a: SUCCESS
line 6 attempt to compute `move _16 + move _17`, which would overflow: SUCCESS
line 6 attempt to compute `move _21 + move _22`, which would overflow: SUCCESS
line 6 attempt to compute `move _20 + const 1_i32`, which would overflow: SUCCESS
line 6 assertion failed: a + b != a + b + 1: SUCCESS
line 6 assertion: a + b != a + b + 1: SUCCESS
line 11 attempt to compute `move _6 + move _7`, which would overflow: SUCCESS
line 11 assertion failed: a + b > a: SUCCESS
line 11 assertion: a + b > a: SUCCESS
line 12 attempt to compute `move _13 - move _14`, which would overflow: SUCCESS
line 12 assertion failed: a - b < a: SUCCESS
line 12 assertion: a - b < a: SUCCESS
2 changes: 1 addition & 1 deletion src/test/expected/copy/expected
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
memmove source region readable: SUCCESS
memmove destination region writeable: SUCCESS
assertion failed: *dst == expected_val: SUCCESS
assertion: *dst == expected_val: SUCCESS
4 changes: 2 additions & 2 deletions src/test/expected/dynamic-error-trait/expected
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
assertion failed: mm.size == 2: SUCCESS
assertion failed: mm.size == 3: FAILURE
assertion: mm.size == 2: SUCCESS
assertion: mm.size == 3: FAILURE
4 changes: 2 additions & 2 deletions src/test/expected/dynamic-trait-static-dispatch/expected
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
line 25 assertion failed: bar.a() == 3: SUCCESS
line 26 assertion failed: bar.b() == 5: SUCCESS
line 25 assertion: bar.a() == 3: SUCCESS
line 26 assertion: bar.b() == 5: SUCCESS
20 changes: 10 additions & 10 deletions src/test/expected/dynamic-trait/expected
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ line 26 attempt to compute `move _3 * move _7`, which would overflow: SUCCESS
line 32 attempt to compute `move _2 * move _3`, which would overflow: SUCCESS
line 35 attempt to compute `move _4 * move _5`, which would overflow: SUCCESS
line 35 attempt to compute `move _3 * move _7`, which would overflow: SUCCESS
line 52 assertion failed: rec.vol(3) == 150: SUCCESS
line 53 assertion failed: impl_area(rec.clone()) == 50: SUCCESS
line 56 assertion failed: vol == 100: SUCCESS
line 59 assertion failed: square.vol(3) == 27: SUCCESS
line 60 assertion failed: do_vol(&square, 2) == 18: SUCCESS
line 61 assertion failed: impl_area(square.clone()) == 9: SUCCESS
line 63 assertion failed: !square.compare_area(&square): SUCCESS
line 64 assertion failed: !square.compare_area(&rec): SUCCESS
line 65 assertion failed: rec.compare_area(&square): SUCCESS
line 66 assertion failed: !rec.compare_area(&rec): SUCCESS
line 52 assertion: rec.vol(3) == 150: SUCCESS
line 53 assertion: impl_area(rec.clone()) == 50: SUCCESS
line 56 assertion: vol == 100: SUCCESS
line 59 assertion: square.vol(3) == 27: SUCCESS
line 60 assertion: do_vol(&square, 2) == 18: SUCCESS
line 61 assertion: impl_area(square.clone()) == 9: SUCCESS
line 63 assertion: !square.compare_area(&square): SUCCESS
line 64 assertion: !square.compare_area(&rec): SUCCESS
line 65 assertion: rec.compare_area(&square): SUCCESS
line 66 assertion: !rec.compare_area(&rec): SUCCESS
10 changes: 5 additions & 5 deletions src/test/expected/enum/expected
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
line 18 unreachable code: SUCCESS
line 18 assertion failed: false: SUCCESS
line 19 assertion failed: x == 10: SUCCESS
line 18 assertion: false: SUCCESS
line 19 assertion: x == 10: SUCCESS
line 22 unreachable code: SUCCESS
line 22 assertion failed: false: SUCCESS
line 25 assertion failed: x == 30 && y == 60.0: SUCCESS
line 26 assertion failed: x == 31: FAILURE
line 22 assertion: false: SUCCESS
line 25 assertion: x == 30 && y == 60.0: SUCCESS
line 26 assertion: x == 31: FAILURE
10 changes: 5 additions & 5 deletions src/test/expected/float-nan/expected
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
line 11 assertion failed: 1.0 / f != 0.0 / f: SUCCESS
line 13 assertion failed: !(1.0 / f == 0.0 / f): SUCCESS
line 15 assertion failed: 1.0 / f == 0.0 / f: FAILURE
line 17 assertion failed: 0.0 / f == 0.0 / f: FAILURE
line 19 assertion failed: 0.0 / f != 0.0 / f: SUCCESS
line 11 assertion: 1.0 / f != 0.0 / f: SUCCESS
line 13 assertion: !(1.0 / f == 0.0 / f): SUCCESS
line 15 assertion: 1.0 / f == 0.0 / f: FAILURE
line 17 assertion: 0.0 / f == 0.0 / f: FAILURE
line 19 assertion: 0.0 / f != 0.0 / f: SUCCESS
4 changes: 2 additions & 2 deletions src/test/expected/generics/expected
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
line 21 assertion failed: x == y.data: SUCCESS
line 22 assertion failed: z == w.data: SUCCESS
line 21 assertion: x == y.data: SUCCESS
line 22 assertion: z == w.data: SUCCESS
2 changes: 1 addition & 1 deletion src/test/expected/iterator/expected
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
line 5 unreachable code: SUCCESS
line 6 attempt to compute `_1 * move _13`, which would overflow: SUCCESS
line 8 assertion failed: z == 6: SUCCESS
line 8 assertion: z == 6: SUCCESS
6 changes: 3 additions & 3 deletions src/test/expected/niche/expected
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
line 20 assertion failed: false: SUCCESS
line 20 assertion: false: SUCCESS
line 20 unreachable code: SUCCESS
line 25 unreachable code: SUCCESS
line 25 assertion failed: false: SUCCESS
line 27 assertion failed: a == *b: SUCCESS
line 25 assertion: false: SUCCESS
line 27 assertion: a == *b: SUCCESS
8 changes: 4 additions & 4 deletions src/test/expected/niche2/expected
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
line 21 assertion failed: false: SUCCESS
line 21 assertion: false: SUCCESS
line 21 unreachable code: SUCCESS
line 27 assertion failed: x == 10: SUCCESS
line 28 assertion failed: false: SUCCESS
line 33 assertion failed: false: SUCCESS
line 27 assertion: x == 10: SUCCESS
line 28 assertion: false: SUCCESS
line 33 assertion: false: SUCCESS
2 changes: 1 addition & 1 deletion src/test/expected/nondet/expected
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ line 9 attempt to compute `move _12 * move _13`, which would overflow: SUCCESS
line 9 attempt to compute `const 2_i32 * move _16`, which would overflow: SUCCESS
line 9 attempt to compute `move _11 - move _15`, which would overflow: SUCCESS
line 9 attempt to compute `move _10 + const 1_i32`, which would overflow: SUCCESS
line 9 assertion failed: x * x - 2 * x + 1 != 4 || (x == -1 || x == 3): SUCCESS
line 9 assertion: x * x - 2 * x + 1 != 4 || (x == -1 || x == 3): SUCCESS
2 changes: 1 addition & 1 deletion src/test/expected/references/expected
Original file line number Diff line number Diff line change
@@ -1 +1 @@
line 17 assertion failed: z == 2: SUCCESS
line 17 assertion: z == 2: SUCCESS
8 changes: 4 additions & 4 deletions src/test/expected/replace-hashmap/expected
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
line 31 attempt to compute `((*_1).0: usize) + const 1_usize`, which would overflow: SUCCESS
line 31 arithmetic overflow on unsigned + in self->len + 1: SUCCESS
line 56 assertion failed: a.is_some(): FAILURE
line 57 assertion failed: a.is_none(): FAILURE
line 59 assertion failed: b.is_some(): SUCCESS
line 60 assertion failed: b.is_none(): FAILURE
line 56 assertion: a.is_some(): FAILURE
line 57 assertion: a.is_none(): FAILURE
line 59 assertion: b.is_some(): SUCCESS
line 60 assertion: b.is_none(): FAILURE
12 changes: 6 additions & 6 deletions src/test/expected/replace-vec/expected
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
line 25 attempt to compute `((*_1).0: usize) + const 1_usize`, which would overflow: SUCCESS
line 35 attempt to compute `((*_1).0: usize) - const 1_usize`, which would overflow: SUCCESS
line 53 assertion failed: v.len() == 1: SUCCESS
line 54 assertion failed: v.len() == 11: FAILURE
line 56 assertion failed: p != None: SUCCESS
line 57 assertion failed: p == None: FAILURE
line 58 assertion failed: p == Some(to_push): SUCCESS
line 59 assertion failed: p == Some(not_pushed): FAILURE
line 53 assertion: v.len() == 1: SUCCESS
line 54 assertion: v.len() == 11: FAILURE
line 56 assertion: p != None: SUCCESS
line 57 assertion: p == None: FAILURE
line 58 assertion: p == Some(to_push): SUCCESS
line 59 assertion: p == Some(not_pushed): FAILURE
6 changes: 3 additions & 3 deletions src/test/expected/slice/expected
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
line 15 assertion failed: y.len() == 5: SUCCESS
line 15 assertion: y.len() == 5: SUCCESS
line 16 index out of bounds: the length is move _16 but the index is _15: SUCCESS
line 16 assertion failed: y[1] == 2: SUCCESS
line 17 assertion failed: z.len() == 3: SUCCESS
line 16 assertion: y[1] == 2: SUCCESS
line 17 assertion: z.len() == 3: SUCCESS
22 changes: 11 additions & 11 deletions src/test/expected/static-mutable-struct/expected
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
line 23 assertion failed: foo().x == 12: SUCCESS
line 24 assertion failed: foo().y == 12: FAILURE
line 25 assertion failed: foo().x == 14: FAILURE
line 26 assertion failed: foo().y == 14: SUCCESS
line 29 assertion failed: foo().x == 1: SUCCESS
line 30 assertion failed: foo().y == 1: FAILURE
line 31 assertion failed: foo().x == 2: FAILURE
line 32 assertion failed: foo().y == 2: SUCCESS
line 35 assertion failed: foo().x == 1 << 62: SUCCESS
line 36 assertion failed: foo().x == 1 << 31: FAILURE
line 37 assertion failed: foo().y == 1 << 31: SUCCESS
line 23 assertion: foo().x == 12: SUCCESS
line 24 assertion: foo().y == 12: FAILURE
line 25 assertion: foo().x == 14: FAILURE
line 26 assertion: foo().y == 14: SUCCESS
line 29 assertion: foo().x == 1: SUCCESS
line 30 assertion: foo().y == 1: FAILURE
line 31 assertion: foo().x == 2: FAILURE
line 32 assertion: foo().y == 2: SUCCESS
line 35 assertion: foo().x == 1 << 62: SUCCESS
line 36 assertion: foo().x == 1 << 31: FAILURE
line 37 assertion: foo().y == 1 << 31: SUCCESS

8 changes: 4 additions & 4 deletions src/test/expected/static-mutable/expected
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
line 16 assertion failed: 10 == foo(): FAILURE
line 17 assertion failed: 12 == foo(): SUCCESS
line 19 assertion failed: 10 == foo(): SUCCESS
line 20 assertion failed: 12 == foo(): FAILURE
line 16 assertion: 10 == foo(): FAILURE
line 17 assertion: 12 == foo(): SUCCESS
line 19 assertion: 10 == foo(): SUCCESS
line 20 assertion: 12 == foo(): FAILURE
4 changes: 2 additions & 2 deletions src/test/expected/static/expected
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
line 10 assertion failed: 10 == foo(): FAILURE
line 11 assertion failed: 12 == foo(): SUCCESS
line 10 assertion: 10 == foo(): FAILURE
line 11 assertion: 12 == foo(): SUCCESS
6 changes: 3 additions & 3 deletions src/test/expected/test1/expected
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
line 7 attempt to compute `_1 + move _4`, which would overflow: SUCCESS
line 8 attempt to compute `_2 - const 1_i32`, which would overflow: SUCCESS
line 12 assertion failed: a == 54: FAILURE
line 14 assertion failed: a == 55: SUCCESS
line 16 assertion failed: a >= 55: SUCCESS
line 12 assertion: a == 54: FAILURE
line 14 assertion: a == 55: SUCCESS
line 16 assertion: a >= 55: SUCCESS
Loading