diff options
| author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-02-26 22:26:52 +0000 |
|---|---|---|
| committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-02-26 22:26:52 +0000 |
| commit | 6d1d84980a1f3212164dda5a890a90efd3c8583d (patch) | |
| tree | ee9aa60d3c109b4583299cf6a71277507a4be241 /tests | |
| parent | bbdc3221f6a76da5784ca0017a0f5ac1ca875597 (diff) | |
| parent | 8eccef7d9cda8a60594b86d31b656a3680d1ca16 (diff) | |
Merge #158
158: implement RFC #128: #[interrupt(binds = ..)] r=korken89 a=japaric
closes #128
r? @korken89 or @TeXitoi
suggestions for tests are welcome! (2 of the 3 tests I added hit bugs in my implementation)
Co-authored-by: Jorge Aparicio <jorge@japaric.io>
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) {} |
