]> git.proxmox.com Git - rustc.git/blob - tests/ui/lto/auxiliary/thinlto-dylib.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / ui / lto / auxiliary / thinlto-dylib.rs
1 // Auxiliary crate for test issue-105637: the LTOed dylib which had duplicate symbols from libstd,
2 // breaking the panic hook feature.
3 //
4 // This simulates the `rustc_driver` crate, and the main crate simulates rustc's main binary hooking
5 // into this driver.
6
7 // compile-flags: -Zdylib-lto -C lto=thin
8
9 use std::panic;
10
11 pub fn main() {
12 // Install the hook we want to see executed
13 panic::set_hook(Box::new(|_| {
14 eprintln!("LTOed auxiliary crate panic hook");
15 }));
16
17 // Trigger the panic hook with an ICE
18 run_compiler();
19 }
20
21 fn run_compiler() {
22 panic!("ICEing");
23 }