2018-08-30 14:18:55 +02:00
|
|
|
//@ run-pass
|
2013-08-21 09:27:48 -04:00
|
|
|
// Test direct calls to extern fns.
|
|
|
|
|
|
2015-03-22 13:13:15 -07:00
|
|
|
|
2020-09-01 17:28:11 -04:00
|
|
|
extern "C" fn f(x: usize) -> usize { x * 2 }
|
2012-02-10 15:34:23 -08:00
|
|
|
|
2013-09-25 00:43:37 -07:00
|
|
|
pub fn main() {
|
2013-08-21 09:27:48 -04:00
|
|
|
let x = f(22);
|
|
|
|
|
assert_eq!(x, 44);
|
2013-02-14 11:47:00 -08:00
|
|
|
}
|