aboutsummaryrefslogtreecommitdiff
path: root/cortex-m-rt/tests/compile-fail/pre-init-args.rs
diff options
context:
space:
mode:
authorGravatar Jorge Aparicio <jorge@japaric.io> 2018-09-06 01:04:39 +0200
committerGravatar Jorge Aparicio <jorge@japaric.io> 2018-09-06 01:04:39 +0200
commitbc526b8d74cb548c9da8d5c10d6013008e164ba5 (patch)
treeff1097f2fd427ae20c3ddb4a53db9d29c5bc649c /cortex-m-rt/tests/compile-fail/pre-init-args.rs
parent306c3fbb7e9f186a43c0a82c43b6a1f16b88df98 (diff)
downloadcortex-m-bc526b8d74cb548c9da8d5c10d6013008e164ba5.tar.gz
cortex-m-bc526b8d74cb548c9da8d5c10d6013008e164ba5.tar.zst
cortex-m-bc526b8d74cb548c9da8d5c10d6013008e164ba5.zip
add compile-fail tests for passing arguments to the attributes
Diffstat (limited to 'cortex-m-rt/tests/compile-fail/pre-init-args.rs')
-rw-r--r--cortex-m-rt/tests/compile-fail/pre-init-args.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/cortex-m-rt/tests/compile-fail/pre-init-args.rs b/cortex-m-rt/tests/compile-fail/pre-init-args.rs
new file mode 100644
index 0000000..716b211
--- /dev/null
+++ b/cortex-m-rt/tests/compile-fail/pre-init-args.rs
@@ -0,0 +1,16 @@
+#![no_main]
+#![no_std]
+
+extern crate cortex_m_rt;
+extern crate panic_semihosting;
+
+use cortex_m_rt::{entry, pre_init};
+
+#[pre_init(foo)] //~ ERROR custom attribute panicked
+//~^ HELP `pre_init` attribute must have no arguments
+unsafe fn foo() {}
+
+#[entry]
+fn baz() -> ! {
+ loop {}
+}