aboutsummaryrefslogtreecommitdiff
path: root/cortex-m-rt/tests/compile-fail/hard-fault-twice.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cortex-m-rt/tests/compile-fail/hard-fault-twice.rs')
-rw-r--r--cortex-m-rt/tests/compile-fail/hard-fault-twice.rs26
1 files changed, 26 insertions, 0 deletions
diff --git a/cortex-m-rt/tests/compile-fail/hard-fault-twice.rs b/cortex-m-rt/tests/compile-fail/hard-fault-twice.rs
new file mode 100644
index 0000000..03b79a5
--- /dev/null
+++ b/cortex-m-rt/tests/compile-fail/hard-fault-twice.rs
@@ -0,0 +1,26 @@
+#![no_main]
+#![no_std]
+
+extern crate cortex_m_rt;
+extern crate panic_halt;
+
+use cortex_m_rt::{entry, exception, ExceptionFrame};
+
+#[entry]
+fn foo() -> ! {
+ loop {}
+}
+
+#[exception]
+unsafe fn HardFault(_ef: &ExceptionFrame) -> ! {
+ loop {}
+}
+
+pub mod reachable {
+ use cortex_m_rt::{exception, ExceptionFrame};
+
+ #[exception] //~ ERROR symbol `HardFault` is already defined
+ unsafe fn HardFault(_ef: &ExceptionFrame) -> ! {
+ loop {}
+ }
+}