about summary refs log tree commit diff
path: root/tests/rustdoc
diff options
context:
space:
mode:
Diffstat (limited to 'tests/rustdoc')
-rw-r--r--tests/rustdoc/auxiliary/panic-item.rs17
-rw-r--r--tests/rustdoc/unused-extern-crate.rs2
2 files changed, 19 insertions, 0 deletions
diff --git a/tests/rustdoc/auxiliary/panic-item.rs b/tests/rustdoc/auxiliary/panic-item.rs
new file mode 100644
index 00000000000..ccf784f7284
--- /dev/null
+++ b/tests/rustdoc/auxiliary/panic-item.rs
@@ -0,0 +1,17 @@
+//@ no-prefer-dynamic
+#![crate_type = "lib"]
+#![no_std]
+#![feature(lang_items)]
+
+use core::panic::PanicInfo;
+use core::sync::atomic::{self, Ordering};
+
+#[panic_handler]
+fn panic(_info: &PanicInfo) -> ! {
+    loop {
+        atomic::compiler_fence(Ordering::SeqCst);
+    }
+}
+
+#[lang = "eh_personality"]
+fn foo() {}
diff --git a/tests/rustdoc/unused-extern-crate.rs b/tests/rustdoc/unused-extern-crate.rs
new file mode 100644
index 00000000000..cdc00fd313a
--- /dev/null
+++ b/tests/rustdoc/unused-extern-crate.rs
@@ -0,0 +1,2 @@
+//@ aux-crate:panic_item=panic-item.rs
+//@ has unused_extern_crate/index.html