about summary refs log tree commit diff
path: root/tests/ui/consts/const-extern-function.rs
blob: 7629d63266acdb8378f39788e214400430cabc9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//@ run-pass

#![allow(non_upper_case_globals)]
#![allow(unpredictable_function_pointer_comparisons)]

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);
}