2018-12-16 18:37:36 +01:00
|
|
|
//! Compile-pass test that checks that `#[cfg]` attributes are respected
|
|
|
|
|
|
|
|
#![deny(unsafe_code)]
|
|
|
|
#![deny(warnings)]
|
|
|
|
#![no_main]
|
|
|
|
#![no_std]
|
|
|
|
|
|
|
|
extern crate lm3s6965;
|
|
|
|
extern crate panic_semihosting;
|
|
|
|
extern crate rtfm;
|
|
|
|
|
|
|
|
use rtfm::app;
|
|
|
|
|
|
|
|
#[app(device = lm3s6965)]
|
|
|
|
const APP: () = {
|
|
|
|
#[cfg(never)]
|
|
|
|
static mut FOO: u32 = 0;
|
|
|
|
|
|
|
|
#[init]
|
|
|
|
fn init() {
|
|
|
|
#[cfg(never)]
|
|
|
|
static mut BAR: u32 = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
#[idle]
|
|
|
|
fn idle() -> ! {
|
|
|
|
#[cfg(never)]
|
|
|
|
static mut BAR: u32 = 0;
|
|
|
|
|
|
|
|
loop {}
|
|
|
|
}
|
|
|
|
|
2018-12-16 19:10:36 +01:00
|
|
|
#[task(resources = [FOO], schedule = [quux], spawn = [quux])]
|
2018-12-16 18:37:36 +01:00
|
|
|
fn foo() {
|
|
|
|
#[cfg(never)]
|
|
|
|
static mut BAR: u32 = 0;
|
|
|
|
}
|
|
|
|
|
2018-12-16 19:10:36 +01:00
|
|
|
#[task(priority = 3, resources = [FOO], schedule = [quux], spawn = [quux])]
|
2018-12-16 18:37:36 +01:00
|
|
|
fn bar() {
|
|
|
|
#[cfg(never)]
|
|
|
|
static mut BAR: u32 = 0;
|
|
|
|
}
|
|
|
|
|
2018-12-16 19:10:36 +01:00
|
|
|
#[cfg(never)]
|
|
|
|
#[task]
|
|
|
|
fn quux() {}
|
|
|
|
|
2018-12-16 18:37:36 +01:00
|
|
|
extern "C" {
|
|
|
|
fn UART0();
|
|
|
|
fn UART1();
|
|
|
|
}
|
|
|
|
};
|