summaryrefslogtreecommitdiffstats
path: root/src/test/ui/consts/const-extern-function.rs
blob: 01f487a7d7558fa703d4756f0c051107a461e139 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// run-pass
#![allow(non_upper_case_globals)]

extern "C" fn foopy() {}

static f: extern "C" fn() = foopy;
static s: S = S { f: foopy };

struct S {
    f: extern "C" fn()
}

pub fn main() {
    assert!(foopy as extern "C" fn() == f);
    assert!(f == s.f);
}