aboutsummaryrefslogtreecommitdiff
path: root/cortex-m-rt/tests
diff options
context:
space:
mode:
authorGravatar Emil Fresk <emil.fresk@gmail.com> 2019-12-29 13:53:28 +0100
committerGravatar Emil Fresk <emil.fresk@gmail.com> 2019-12-29 13:53:28 +0100
commit1b5da39d9d1c3bc6558585a6ecf8ce2448ff82fd (patch)
tree18d53d7abb6c891b0baaae6de9fc5a4697534b36 /cortex-m-rt/tests
parentec7a1a7fdaa26f686b22fe01b1c0f6387ab260b9 (diff)
downloadcortex-m-1b5da39d9d1c3bc6558585a6ecf8ce2448ff82fd.tar.gz
cortex-m-1b5da39d9d1c3bc6558585a6ecf8ce2448ff82fd.tar.zst
cortex-m-1b5da39d9d1c3bc6558585a6ecf8ce2448ff82fd.zip
Added blacklisted attributes
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() {}