os-rust/tests/ui/cross-crate/static-init.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
431 B
Rust
Raw Normal View History

// Regression test for #84455 and #115052.
//@ run-pass
//@ aux-build:static_init_aux.rs
extern crate static_init_aux as aux;
static V: &u32 = aux::V;
static F: fn() = aux::F;
static G: fn() = aux::G;
static H: &(dyn Fn() + Sync) = aux::H;
static I: fn() = aux::I;
2024-06-04 00:00:00 +00:00
static K: fn() -> fn() = aux::K;
fn v() -> *const u32 {
V
}
fn main() {
assert_eq!(aux::v(), crate::v());
F();
G();
H();
I();
2024-06-04 00:00:00 +00:00
K()();
}