]> git.lizzy.rs Git - rust.git/blob - tests/run-make-fulldeps/extern-fn-mangle/test.rs
Rollup merge of #107731 - RalfJung:interpret-discriminant, r=cjgillot
[rust.git] / tests / run-make-fulldeps / extern-fn-mangle / test.rs
1 #[no_mangle]
2 pub extern "C" fn foo() -> i32 {
3     3
4 }
5
6 #[no_mangle]
7 pub extern "C" fn bar() -> i32 {
8     5
9 }
10
11 #[link(name = "test", kind = "static")]
12 extern "C" {
13     fn add() -> i32;
14 }
15
16 fn main() {
17     let back = unsafe { add() };
18     assert_eq!(8, back);
19 }