From c749979c458472c8e7e719b17a6d6906c7ddf3e0 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Sat, 23 Feb 2019 21:50:52 +0100 Subject: add some tests --- tests/cfail/used-free-interrupt-2.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 tests/cfail/used-free-interrupt-2.rs (limited to 'tests/cfail') diff --git a/tests/cfail/used-free-interrupt-2.rs b/tests/cfail/used-free-interrupt-2.rs new file mode 100644 index 0000000..f9aab78 --- /dev/null +++ b/tests/cfail/used-free-interrupt-2.rs @@ -0,0 +1,21 @@ +#![no_main] +#![no_std] + +extern crate lm3s6965; +extern crate panic_halt; +extern crate rtfm; + +use rtfm::app; + +#[app(device = lm3s6965)] +const APP: () = { + #[init] + fn init() {} + + #[interrupt(binds = UART0)] + fn foo() {} //~ ERROR free interrupts (`extern { .. }`) can't be used as interrupt handlers + + extern "C" { + fn UART0(); + } +}; -- cgit v1.2.3 From 72f0cc505addf00d493b764418e4207f53434152 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Sat, 23 Feb 2019 21:54:56 +0100 Subject: make cfail test actually fail --- tests/cfail/used-free-interrupt-2.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/cfail') diff --git a/tests/cfail/used-free-interrupt-2.rs b/tests/cfail/used-free-interrupt-2.rs index f9aab78..616d308 100644 --- a/tests/cfail/used-free-interrupt-2.rs +++ b/tests/cfail/used-free-interrupt-2.rs @@ -12,8 +12,8 @@ const APP: () = { #[init] fn init() {} - #[interrupt(binds = UART0)] - fn foo() {} //~ ERROR free interrupts (`extern { .. }`) can't be used as interrupt handlers + #[interrupt(binds = UART0)] //~ ERROR free interrupts (`extern { .. }`) can't be used as interrupt handlers + fn foo() {} extern "C" { fn UART0(); -- cgit v1.2.3