|
| 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