Skip to content

Commit 0a69501

Browse files
committed
rewrite raw-dylib-c to rmake
1 parent 03c2d69 commit 0a69501

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
@@ -42,7 +42,6 @@ run-make/pgo-gen-lto/Makefile
4242
run-make/pgo-indirect-call-promotion/Makefile
4343
run-make/print-calling-conventions/Makefile
4444
run-make/print-target-list/Makefile
45-
run-make/raw-dylib-c/Makefile
4645
run-make/raw-dylib-import-name-type/Makefile
4746
run-make/raw-dylib-link-ordinal/Makefile
4847
run-make/raw-dylib-stdcall-ordinal/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)