diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/cfail/used-free-interrupt-2.rs | 21 | ||||
| -rw-r--r-- | tests/cpass/binds.rs | 27 |
2 files changed, 48 insertions, 0 deletions
diff --git a/tests/cfail/used-free-interrupt-2.rs b/tests/cfail/used-free-interrupt-2.rs new file mode 100644 index 0000000..616d308 --- /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)] //~ ERROR free interrupts (`extern { .. }`) can't be used as interrupt handlers + fn foo() {} + + extern "C" { + fn UART0(); + } +}; diff --git a/tests/cpass/binds.rs b/tests/cpass/binds.rs new file mode 100644 index 0000000..7cb9174 --- /dev/null +++ b/tests/cpass/binds.rs @@ -0,0 +1,27 @@ +//! Check that `binds` works as advertised +#![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() {} + + #[exception(binds = SVCall)] + fn foo() {} + + #[interrupt(binds = UART0)] + fn bar() {} +}; + +#[allow(dead_code)] +fn foo_trampoline(_: foo::Context) {} + +#[allow(dead_code)] +fn bar_trampoline(_: bar::Context) {} |
