summaryrefslogtreecommitdiffstats
path: root/src/test/ui/missing/missing-allocator.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/missing/missing-allocator.rs')
-rw-r--r--src/test/ui/missing/missing-allocator.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/test/ui/missing/missing-allocator.rs b/src/test/ui/missing/missing-allocator.rs
new file mode 100644
index 000000000..2dc509f2c
--- /dev/null
+++ b/src/test/ui/missing/missing-allocator.rs
@@ -0,0 +1,18 @@
+// compile-flags: -C panic=abort
+// no-prefer-dynamic
+
+#![no_std]
+#![crate_type = "staticlib"]
+#![feature(alloc_error_handler)]
+
+#[panic_handler]
+fn panic(_: &core::panic::PanicInfo) -> ! {
+ loop {}
+}
+
+#[alloc_error_handler]
+fn oom(_: core::alloc::Layout) -> ! {
+ loop {}
+}
+
+extern crate alloc;