aboutsummaryrefslogtreecommitdiff
path: root/tests/cpass/unsafe.rs
blob: b6996ad115fcfc2d0210a10bdd205a4adb5e0a8a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//! Check code generation of `unsafe` `init` / `idle` / `exception` / `interrupt` / `task`
#![no_main]
#![no_std]

extern crate lm3s6965;
extern crate panic_halt;
extern crate rtfm;

use rtfm::app;

unsafe fn foo() {}

#[app(device = lm3s6965)]
const APP: () = {
    #[init]
    unsafe fn init() {
        foo();
    }

    #[idle]
    unsafe fn idle() -> ! {
        foo();

        loop {}
    }

    #[exception]
    unsafe fn SVCall() {
        foo();
    }

    #[interrupt]
    unsafe fn UART0() {
        foo();
    }

    #[task]
    unsafe fn bar() {
        foo();
    }

    extern "C" {
        fn UART1();
    }
};