summary refs log tree commit diff
path: root/tests/run-make/invalid-staticlib/rmake.rs
blob: ba9e07dd07b8fb7304ef6f18df8435d2982b9c49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// If the static library provided is not valid (in this test,
// created as an empty file),
// rustc should print a normal error message and not throw
// an internal compiler error (ICE).
// See https://github.com/rust-lang/rust/pull/28673

use run_make_support::{rfs, rustc, static_lib_name};

fn main() {
    rfs::create_file(static_lib_name("foo"));
    rustc()
        .arg("-")
        .crate_type("rlib")
        .arg("-lstatic=foo")
        .run_fail()
        .assert_stderr_contains("failed to add native library");
}