summaryrefslogtreecommitdiffstats
path: root/src/test/ui/lto/auxiliary/thinlto-dylib.rs
blob: 9d17c35dafc25cfe3168ca4054cc72c5773a8e81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Auxiliary crate for test issue-105637: the LTOed dylib which had duplicate symbols from libstd,
// breaking the panic hook feature.
//
// This simulates the `rustc_driver` crate, and the main crate simulates rustc's main binary hooking
// into this driver.

// compile-flags: -Zdylib-lto -C lto=thin

use std::panic;

pub fn main() {
    // Install the hook we want to see executed
    panic::set_hook(Box::new(|_| {
        eprintln!("LTOed auxiliary crate panic hook");
    }));

    // Trigger the panic hook with an ICE
    run_compiler();
}

fn run_compiler() {
    panic!("ICEing");
}