summaryrefslogtreecommitdiffstats
path: root/tests/run-make/raw-dylib-cross-compilation/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run-make/raw-dylib-cross-compilation/lib.rs')
-rw-r--r--tests/run-make/raw-dylib-cross-compilation/lib.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/run-make/raw-dylib-cross-compilation/lib.rs b/tests/run-make/raw-dylib-cross-compilation/lib.rs
new file mode 100644
index 000000000..51bf2ec6b
--- /dev/null
+++ b/tests/run-make/raw-dylib-cross-compilation/lib.rs
@@ -0,0 +1,20 @@
+#![feature(raw_dylib)]
+#![feature(no_core, lang_items)]
+#![no_std]
+#![no_core]
+#![crate_type = "lib"]
+
+// This is needed because of #![no_core]:
+#[lang = "sized"]
+trait Sized {}
+
+#[link(name = "extern_1", kind = "raw-dylib")]
+extern {
+ fn extern_fn();
+}
+
+pub fn extern_fn_caller() {
+ unsafe {
+ extern_fn();
+ }
+}