]> git.lizzy.rs Git - rust.git/blob - src/test/run-make/raw-dylib-link-ordinal/lib.rs
Rollup merge of #100132 - compiler-errors:issue-100103, r=tmiasko
[rust.git] / src / test / run-make / raw-dylib-link-ordinal / lib.rs
1 #![feature(raw_dylib)]
2
3 #[link(name = "exporter", kind = "raw-dylib")]
4 extern {
5     #[link_ordinal(13)]
6     fn imported_function();
7     #[link_ordinal(5)]
8     static mut imported_variable: i32;
9     #[link_ordinal(9)]
10     fn print_imported_variable();
11 }
12
13 pub fn library_function() {
14     unsafe {
15         imported_function();
16         imported_variable = 42;
17         print_imported_variable();
18         imported_variable = -42;
19         print_imported_variable();
20     }
21 }