2018-08-30 12:18:55 +00:00
|
|
|
// run-pass
|
2018-08-31 13:02:01 +00:00
|
|
|
#![allow(non_upper_case_globals)]
|
2015-03-22 20:13:15 +00:00
|
|
|
|
2020-09-01 21:28:11 +00:00
|
|
|
extern "C" fn foopy() {}
|
2013-01-18 15:12:07 +00:00
|
|
|
|
2013-08-21 13:27:48 +00:00
|
|
|
static f: extern "C" fn() = foopy;
|
2013-03-22 21:00:15 +00:00
|
|
|
static s: S = S { f: foopy };
|
2013-01-18 15:12:07 +00:00
|
|
|
|
|
|
|
struct S {
|
2013-08-21 13:27:48 +00:00
|
|
|
f: extern "C" fn()
|
2013-01-18 15:12:07 +00:00
|
|
|
}
|
|
|
|
|
2013-02-02 03:43:17 +00:00
|
|
|
pub fn main() {
|
2014-11-26 10:52:16 +00:00
|
|
|
assert!(foopy as extern "C" fn() == f);
|
2014-02-28 09:23:06 +00:00
|
|
|
assert!(f == s.f);
|
2013-02-14 19:47:00 +00:00
|
|
|
}
|