aboutsummaryrefslogtreecommitdiff
path: root/cortex-m-rt/tests
diff options
context:
space:
mode:
Diffstat (limited to 'cortex-m-rt/tests')
-rw-r--r--cortex-m-rt/tests/compile-fail/blacklist-1.rs26
-rw-r--r--cortex-m-rt/tests/compile-fail/blacklist-2.rs26
-rw-r--r--cortex-m-rt/tests/compile-fail/blacklist-3.rs26
-rw-r--r--cortex-m-rt/tests/compile-fail/blacklist-4.rs26
4 files changed, 104 insertions, 0 deletions
diff --git a/cortex-m-rt/tests/compile-fail/blacklist-1.rs b/cortex-m-rt/tests/compile-fail/blacklist-1.rs
new file mode 100644
index 0000000..57d90e3
--- /dev/null
+++ b/cortex-m-rt/tests/compile-fail/blacklist-1.rs
@@ -0,0 +1,26 @@
+#![no_main]
+#![no_std]
+
+extern crate cortex_m_rt;
+extern crate panic_halt;
+
+use cortex_m_rt::{entry, exception, interrupt};
+
+#[inline] //~ ERROR This attribute is not allowed [blacklisted]
+#[entry]
+fn foo() -> ! {
+ loop {}
+}
+
+#[inline] //~ ERROR This attribute is not allowed [blacklisted]
+#[exception]
+fn SysTick() {}
+
+#[allow(non_camel_case_types)]
+enum interrupt {
+ USART1,
+}
+
+#[inline] //~ ERROR This attribute is not allowed [blacklisted]
+#[interrupt]
+fn USART1() {}
diff --git a/cortex-m-rt/tests/compile-fail/blacklist-2.rs b/cortex-m-rt/tests/compile-fail/blacklist-2.rs
new file mode 100644
index 0000000..ab30235
--- /dev/null
+++ b/cortex-m-rt/tests/compile-fail/blacklist-2.rs
@@ -0,0 +1,26 @@
+#![no_main]
+#![no_std]
+
+extern crate cortex_m_rt;
+extern crate panic_halt;
+
+use cortex_m_rt::{entry, exception, interrupt};
+
+#[export_name = "not_allowed"] //~ ERROR This attribute is not allowed [blacklisted]
+#[entry]
+fn foo() -> ! {
+ loop {}
+}
+
+#[export_name = "not_allowed"] //~ ERROR This attribute is not allowed [blacklisted]
+#[exception]
+fn SysTick() {}
+
+#[allow(non_camel_case_types)]
+enum interrupt {
+ USART1,
+}
+
+#[export_name = "not_allowed"] //~ ERROR This attribute is not allowed [blacklisted]
+#[interrupt]
+fn USART1() {}
diff --git a/cortex-m-rt/tests/compile-fail/blacklist-3.rs b/cortex-m-rt/tests/compile-fail/blacklist-3.rs
new file mode 100644
index 0000000..c0990bb
--- /dev/null
+++ b/cortex-m-rt/tests/compile-fail/blacklist-3.rs
@@ -0,0 +1,26 @@
+#![no_main]
+#![no_std]
+
+extern crate cortex_m_rt;
+extern crate panic_halt;
+
+use cortex_m_rt::{entry, exception, interrupt};
+
+#[no_mangle] //~ ERROR This attribute is not allowed [blacklisted]
+#[entry]
+fn foo() -> ! {
+ loop {}
+}
+
+#[no_mangle] //~ ERROR This attribute is not allowed [blacklisted]
+#[exception]
+fn SysTick() {}
+
+#[allow(non_camel_case_types)]
+enum interrupt {
+ USART1,
+}
+
+#[no_mangle] //~ ERROR This attribute is not allowed [blacklisted]
+#[interrupt]
+fn USART1() {}
diff --git a/cortex-m-rt/tests/compile-fail/blacklist-4.rs b/cortex-m-rt/tests/compile-fail/blacklist-4.rs
new file mode 100644
index 0000000..d0753e0
--- /dev/null
+++ b/cortex-m-rt/tests/compile-fail/blacklist-4.rs
@@ -0,0 +1,26 @@
+#![no_main]
+#![no_std]
+
+extern crate cortex_m_rt;
+extern crate panic_halt;
+
+use cortex_m_rt::{entry, exception, interrupt};
+
+#[must_use] //~ ERROR This attribute is not allowed [blacklisted]
+#[entry]
+fn foo() -> ! {
+ loop {}
+}
+
+#[must_use] //~ ERROR This attribute is not allowed [blacklisted]
+#[exception]
+fn SysTick() {}
+
+#[allow(non_camel_case_types)]
+enum interrupt {
+ USART1,
+}
+
+#[must_use] //~ ERROR This attribute is not allowed [blacklisted]
+#[interrupt]
+fn USART1() {}