aboutsummaryrefslogtreecommitdiff
path: root/cortex-m-rt/tests/compile-fail/hard-fault-twice-mixed-trampoline.rs
diff options
context:
space:
mode:
authorGravatar Adam Greig <adam@adamgreig.com> 2023-08-16 22:28:08 +0000
committerGravatar GitHub <noreply@github.com> 2023-08-16 22:28:08 +0000
commit1746a63ca16b68514ea23dcca1543aed00165452 (patch)
treefbed40673119c9a2e1148721e85fcd1449d2b9da /cortex-m-rt/tests/compile-fail/hard-fault-twice-mixed-trampoline.rs
parent4651808e1de360e01b3e734c655aeb5310881b7c (diff)
parentfaf7bd3cf37343dec23f61c185e0ae22f684e991 (diff)
downloadcortex-m-1746a63ca16b68514ea23dcca1543aed00165452.tar.gz
cortex-m-1746a63ca16b68514ea23dcca1543aed00165452.tar.zst
cortex-m-1746a63ca16b68514ea23dcca1543aed00165452.zip
Merge pull request #476 from diondokter/optional-hardfault-trampoline
Hardfault trampoline is now optional
Diffstat (limited to 'cortex-m-rt/tests/compile-fail/hard-fault-twice-mixed-trampoline.rs')
-rw-r--r--cortex-m-rt/tests/compile-fail/hard-fault-twice-mixed-trampoline.rs26
1 files changed, 26 insertions, 0 deletions
diff --git a/cortex-m-rt/tests/compile-fail/hard-fault-twice-mixed-trampoline.rs b/cortex-m-rt/tests/compile-fail/hard-fault-twice-mixed-trampoline.rs
new file mode 100644
index 0000000..3610170
--- /dev/null
+++ b/cortex-m-rt/tests/compile-fail/hard-fault-twice-mixed-trampoline.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(trampoline = false)]
+unsafe fn HardFault() -> ! {
+ loop {}
+}
+
+pub mod reachable {
+ use cortex_m_rt::{exception, ExceptionFrame};
+
+ #[exception] //~ ERROR symbol `_HardFault` is already defined
+ unsafe fn HardFault(_ef: &ExceptionFrame) -> ! {
+ loop {}
+ }
+}