about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-01-24 21:42:46 +0000
committerbors <bors@rust-lang.org>2020-01-24 21:42:46 +0000
commit1ccd284ec645c65e487ae610d91c1943e2a17c6c (patch)
tree796f49a910b1f5ae481b5561723d45e29361b8c3 /tests
parentc48594c6945b37ecffb5608fca617c3a16d4715f (diff)
parent634774b89b446945d62572e86c6d29f2dacc8c76 (diff)
downloadrust-1ccd284ec645c65e487ae610d91c1943e2a17c6c.tar.gz
rust-1ccd284ec645c65e487ae610d91c1943e2a17c6c.zip
Auto merge of #5086 - Areredify:issue-3746, r=phansch
don't fire `empty_loop` in `no_std` crates

closes #3746.
changelog: move no_std detection to utils, don't fire empty_loop in no_std crates
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/issue-3746.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/ui/issue-3746.rs b/tests/ui/issue-3746.rs
new file mode 100644
index 00000000000..879d1d5d916
--- /dev/null
+++ b/tests/ui/issue-3746.rs
@@ -0,0 +1,22 @@
+// ignore-macos
+// ignore-windows
+
+#![warn(clippy::empty_loop)]
+#![feature(lang_items, link_args, start, libc)]
+#![link_args = "-nostartfiles"]
+#![no_std]
+
+use core::panic::PanicInfo;
+
+#[start]
+fn main(argc: isize, argv: *const *const u8) -> isize {
+    loop {}
+}
+
+#[panic_handler]
+fn panic(_info: &PanicInfo) -> ! {
+    loop {}
+}
+
+#[lang = "eh_personality"]
+extern "C" fn eh_personality() {}