Skip to content

Commit 5d40df3

Browse files
committed
rewrite pass-non-c-like-enum-to-c to rmake
1 parent bbad12f commit 5d40df3

File tree

3 files changed

+25
-8
lines changed

3 files changed

+25
-8
lines changed

tests/run-make/c-static-dylib/rmake.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
// Reason: the compiled binary is executed
77

88
use run_make_support::{
9-
build_native_static_lib, dynamic_lib_name, fs_wrapper, run, run_fail, rustc, static_lib_name,
9+
build_native_static_lib, dynamic_lib_name, rfs, run, run_fail, rustc, static_lib_name,
1010
};
1111

1212
fn main() {
1313
build_native_static_lib("cfoo");
1414
rustc().input("foo.rs").arg("-Cprefer-dynamic").run();
1515
rustc().input("bar.rs").run();
16-
fs_wrapper::remove_file(static_lib_name("cfoo"));
16+
rfs::remove_file(static_lib_name("cfoo"));
1717
run("bar");
18-
fs_wrapper::remove_file(dynamic_lib_name("foo"));
18+
rfs::remove_file(dynamic_lib_name("foo"));
1919
run_fail("bar");
2020
}

tests/run-make/c-static-rlib/rmake.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,13 @@
55
//@ ignore-cross-compile
66
// Reason: the compiled binary is executed
77

8-
use run_make_support::{
9-
build_native_static_lib, fs_wrapper, run, rust_lib_name, rustc, static_lib_name,
10-
};
8+
use run_make_support::{build_native_static_lib, rfs, run, rust_lib_name, rustc, static_lib_name};
119

1210
fn main() {
1311
build_native_static_lib("cfoo");
1412
rustc().input("foo.rs").run();
1513
rustc().input("bar.rs").run();
16-
fs_wrapper::remove_file(rust_lib_name("foo"));
17-
fs_wrapper::remove_file(static_lib_name("cfoo"));
14+
rfs::remove_file(rust_lib_name("foo"));
15+
rfs::remove_file(static_lib_name("cfoo"));
1816
run("bar");
1917
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Similar to the `return-non-c-like-enum-from-c` test, where
2+
// the C code is the library, and the Rust code compiles
3+
// into the executable. Once again, enum variants should be treated
4+
// like an union of structs, which should prevent segfaults or
5+
// unexpected results. The only difference with the aforementioned
6+
// test is that the structs are passed into C directly through the
7+
// `tt_add` and `t_add` function calls.
8+
// See https://github.com/rust-lang/rust/issues/68190
9+
10+
//@ ignore-cross-compile
11+
// Reason: the compiled binary is executed
12+
13+
use run_make_support::{build_native_static_lib, run, rustc};
14+
15+
fn main() {
16+
build_native_static_lib("test");
17+
rustc().input("nonclike.rs").arg("-ltest").run();
18+
run("nonclike");
19+
}

0 commit comments

Comments
 (0)