summary refs log tree commit diff
path: root/tests/run-make/panic-impl-transitive/rmake.rs
blob: 86308f593b31412b38cd7a65bfb9ef85075f8b2b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// In Rust programs where the standard library is unavailable (#![no_std]), we may be interested
// in customizing how panics are handled. Here, the provider specifies that panics should be handled
// by entering an infinite loop. This test checks that this panic implementation can be transitively
// provided by an external crate.
// --emit=llvm-ir is used to avoid running the linker, as linking will fail due to the lack of main
// function in the crate.
// See https://github.com/rust-lang/rust/pull/50338

use run_make_support::{rustc, tmp_dir};

fn main() {
    rustc().input("panic-impl-provider.rs").run();
    rustc()
        .input("panic-impl-consumer.rs")
        .panic("abort")
        .emit("llvm-ir")
        .library_search_path(tmp_dir())
        .run();
}