Skip to content

Commit f31f8c4

Browse files
committed
rewrite raw-dylib-c to rmake
1 parent 131d453 commit f31f8c4

File tree

3 files changed

+29
-29
lines changed

3 files changed

+29
-29
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ run-make/no-alloc-shim/Makefile
2323
run-make/pdb-buildinfo-cl-cmd/Makefile
2424
run-make/pgo-gen-lto/Makefile
2525
run-make/pgo-indirect-call-promotion/Makefile
26-
run-make/raw-dylib-c/Makefile
2726
run-make/redundant-libs/Makefile
2827
run-make/remap-path-prefix-dwarf/Makefile
2928
run-make/reproducible-build-2/Makefile

tests/run-make/raw-dylib-c/Makefile

-28
This file was deleted.

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

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// `raw-dylib` is a Windows-specific attribute which emits idata sections for the items in the
2+
// attached extern block,
3+
// so they may be linked against without linking against an import library.
4+
// To learn more, read https://github.com/rust-lang/rfcs/blob/master/text/2627-raw-dylib-kind.md
5+
// This test is the simplest of the raw-dylib tests, simply smoke-testing that the feature
6+
// can be used to build an executable binary with an expected output with native C files
7+
// compiling into dynamic libraries.
8+
// See https://github.com/rust-lang/rust/pull/86419
9+
10+
//@ only-windows
11+
12+
use run_make_support::{build_native_dynamic_lib, diff, run, rustc};
13+
14+
fn main() {
15+
rustc().crate_type("lib").crate_name("raw_dylib_test").input("lib.rs").run();
16+
rustc().crate_type("bin").input("driver.rs").run();
17+
rustc().crate_type("bin").crate_name("raw_dylib_test_bin").input("lib.rs").run();
18+
build_native_dynamic_lib("extern_1");
19+
build_native_dynamic_lib("extern_2");
20+
let out_driver = run("driver").stdout_utf8();
21+
let out_raw = run("raw_dylib_test_bin").stdout_utf8();
22+
23+
diff()
24+
.expected_file("output.txt")
25+
.actual_text("actual", out_driver)
26+
.normalize(r#"\r"#, "")
27+
.run();
28+
diff().expected_file("output.txt").actual_text("actual", out_raw).run();
29+
}

0 commit comments

Comments
 (0)