aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGravatar Gerd Zellweger <mail@gerdzellweger.com> 2015-11-12 15:13:27 +0100
committerGravatar Gerd Zellweger <mail@gerdzellweger.com> 2015-11-12 15:13:27 +0100
commit79931f13b85faaf6ece1ce4a20f320e79e41fea6 (patch)
tree110ec98da4c5458d588ba9af729eff90df81596e /tests
parentc96f029202155560796851fecf8ce8d1c33e9bd5 (diff)
parente583a89a561a84dbde8e0ab92252eddd06a1b5ea (diff)
downloadrust-x86-79931f13b85faaf6ece1ce4a20f320e79e41fea6.tar.gz
rust-x86-79931f13b85faaf6ece1ce4a20f320e79e41fea6.tar.zst
rust-x86-79931f13b85faaf6ece1ce4a20f320e79e41fea6.zip
Merge pull request #2 from emk/lang_items_link_problems
Add a test to reproduce link errors reported in gz/rust-x86#1
Diffstat (limited to 'tests')
-rw-r--r--tests/no_std_build.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/no_std_build.rs b/tests/no_std_build.rs
new file mode 100644
index 0000000..8a68214
--- /dev/null
+++ b/tests/no_std_build.rs
@@ -0,0 +1,24 @@
+// Verify that we can be linked against an appliction which only uses
+// libcore, which is common in kernel space.
+
+#![feature(no_std, lang_items)]
+#![no_std]
+
+extern crate x86;
+
+fn main() {
+}
+
+// We want to supply these definitions ourselves, and not have them
+// accidentally pulled in via the x86 crate.
+#[lang = "eh_personality"]
+extern "C" fn eh_personality() {
+}
+
+#[lang = "panic_fmt"]
+extern "C" fn panic_fmt(
+ args: ::core::fmt::Arguments, file: &str, line: usize)
+ -> !
+{
+ loop {}
+}