summary refs log tree commit diff
path: root/tests/ui/panic-handler/weak-lang-item-2.rs
blob: 2acaff3ab712761e5e2d6b45c2b521079bc2c9f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//@ run-pass
//@ aux-build:weak-lang-items.rs

//@ pretty-expanded FIXME #23616

extern crate weak_lang_items as other;

fn main() {
    // The goal of the test is just to make sure other::foo() is referenced at link time. Since
    // the function panics, to prevent it from running we gate it behind an always-false `if` that
    // is not going to be optimized away.
    if std::hint::black_box(false) {
        other::foo();
    }
}