Skip to content

Commit 9c92a78

Browse files
adpaco-awstedinski
authored andcommitted
Suite for "fixme" tests (rust-lang#660)
* Enable `rmc-fixme` suite in `compiletest` * Add "rmc-fixme" suite to regular regression
1 parent 6d2f28a commit 9c92a78

File tree

12 files changed

+30
-7
lines changed

12 files changed

+30
-7
lines changed

scripts/rmc-regression.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ check-cbmc-viewer-version.py --major 2 --minor 5
2525
./scripts/setup/build_rmc_lib.sh
2626

2727
# Standalone rmc tests, expected tests, and cargo tests
28-
./x.py test -i --stage 1 rmc firecracker prusti smack expected cargo-rmc rmc-docs
28+
./x.py test -i --stage 1 rmc firecracker prusti smack expected cargo-rmc rmc-docs rmc-fixme
2929
./x.py test -i --stage 0 compiler/cbmc
3030

3131
# Check codegen for the standard library

src/bootstrap/builder.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,7 @@ impl<'a> Builder<'a> {
474474
test::Dashboard,
475475
test::Stub,
476476
test::RmcDocs,
477+
test::RmcFixme,
477478
// Run run-make last, since these won't pass without make on Windows
478479
test::RunMake,
479480
),

src/bootstrap/test.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,6 +1231,8 @@ default_test!(Dashboard { path: "src/test/dashboard", mode: "rmc", suite: "dashb
12311231

12321232
default_test!(RmcDocs { path: "src/test/rmc-docs", mode: "rmc", suite: "rmc-docs" });
12331233

1234+
default_test!(RmcFixme { path: "src/test/rmc-fixme", mode: "rmc-fixme", suite: "rmc-fixme" });
1235+
12341236
default_test!(Stub { path: "src/test/stub-tests", mode: "stub-tests", suite: "stub-tests" });
12351237

12361238
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]

src/test/rmc-fixme

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
rmc

src/test/rmc/Strings/fixme_boxed_str.rs renamed to src/test/rmc/Strings/boxed_str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
// SPDX-License-Identifier: Apache-2.0 OR MIT
3-
// Fails with a type safety error - see TODO in rvalue.rs::codegen_misc_cast()
3+
44
fn main() {
55
let s = String::from("hello");
66
let _b = s.into_boxed_str();

src/test/rmc/Strings/fixme_main.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ fn test2() {
66
assert!(s.chars().nth(1) == Some('o'));
77
}
88

9-
/// Runs forever
109
fn test3() {
1110
let s: &str = &("f".to_string() + "o");
1211
assert!(s.len() == 2);
@@ -20,7 +19,7 @@ fn test4() {
2019

2120
unsafe {
2221
assert!(!ptr.is_null());
23-
//assert!(*ptr.offset(1) as char == '2'); // u8 to char not handled yet
22+
assert!(*ptr.offset(1) as char == '2'); // u8 to char not handled yet
2423
}
2524
}
2625
fn main() {
File renamed without changes.

src/test/rmc/Vectors/fixme_main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
// SPDX-License-Identifier: Apache-2.0 OR MIT
3+
// rmc-flags: --unwind 0
34
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd)]
45
pub struct GuestAddress(pub u64);
56

src/tools/compiletest/src/common.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ pub enum Mode {
2424
MirOpt,
2525
Assembly,
2626
RMC,
27+
RmcFixme,
2728
CargoRMC,
2829
Expected,
2930
Stub,
@@ -58,6 +59,7 @@ impl FromStr for Mode {
5859
"mir-opt" => Ok(MirOpt),
5960
"assembly" => Ok(Assembly),
6061
"rmc" => Ok(RMC),
62+
"rmc-fixme" => Ok(RmcFixme),
6163
"cargo-rmc" => Ok(CargoRMC),
6264
"expected" => Ok(Expected),
6365
"stub-tests" => Ok(Stub),
@@ -83,6 +85,7 @@ impl fmt::Display for Mode {
8385
MirOpt => "mir-opt",
8486
Assembly => "assembly",
8587
RMC => "rmc",
88+
RmcFixme => "rmc-fixme",
8689
CargoRMC => "cargo-rmc",
8790
Expected => "expected",
8891
Stub => "stub-tests",

0 commit comments

Comments
 (0)