about summary refs log tree commit diff
path: root/tests/ui/cross-crate/static-init.rs
blob: f8003856c5c497b49e8c92e1f15b68c48a3edd70 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// 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;
static K: fn() -> fn() = aux::K;

fn v() -> *const u32 {
    V
}

fn main() {
    assert_eq!(aux::v(), crate::v());
    F();
    G();
    H();
    I();
    K()();
}