diff options
author | 2015-11-12 15:13:27 +0100 | |
---|---|---|
committer | 2015-11-12 15:13:27 +0100 | |
commit | 79931f13b85faaf6ece1ce4a20f320e79e41fea6 (patch) | |
tree | 110ec98da4c5458d588ba9af729eff90df81596e /tests | |
parent | c96f029202155560796851fecf8ce8d1c33e9bd5 (diff) | |
parent | e583a89a561a84dbde8e0ab92252eddd06a1b5ea (diff) | |
download | rust-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.rs | 24 |
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 {} +} |