aboutsummaryrefslogtreecommitdiff
path: root/cortex-m-rt/examples/cfg-static.rs
blob: 2ffee1388b8113c4c4e49e0b5fc80bf979598297 (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
//! using `#[cfg]` on `static` shouldn't cause compile errors

#![deny(unsafe_code)]
#![deny(warnings)]
#![no_main]
#![no_std]

extern crate cortex_m_rt as rt;
extern crate panic_halt;

use rt::{entry, exception};

#[entry]
fn main() -> ! {
    #[cfg(never)]
    static mut COUNT: u32 = 0;

    loop {}
}

#[exception]
fn SysTick() {
    #[cfg(never)]
    static mut FOO: u32 = 0;
}