aboutsummaryrefslogtreecommitdiff
path: root/cortex-m-rt/tests
diff options
context:
space:
mode:
authorGravatar Jorge Aparicio <jorge@japaric.io> 2018-09-06 01:24:01 +0200
committerGravatar Jorge Aparicio <jorge@japaric.io> 2018-09-06 01:24:01 +0200
commit19fcb13d22a56e01fd2fa5d34051196f59c9511b (patch)
tree8cec0b0edef2b5e29a348d7fb7b1437fef133bf3 /cortex-m-rt/tests
parentbc526b8d74cb548c9da8d5c10d6013008e164ba5 (diff)
downloadcortex-m-19fcb13d22a56e01fd2fa5d34051196f59c9511b.tar.gz
cortex-m-19fcb13d22a56e01fd2fa5d34051196f59c9511b.tar.zst
cortex-m-19fcb13d22a56e01fd2fa5d34051196f59c9511b.zip
relax checks of the signatures of `entry` and the exceptions
Diffstat (limited to 'cortex-m-rt/tests')
-rw-r--r--cortex-m-rt/tests/compile-fail/default-handler-bad-signature-1.rs2
-rw-r--r--cortex-m-rt/tests/compile-fail/default-handler-bad-signature-2.rs16
-rw-r--r--cortex-m-rt/tests/compile-fail/default-handler-bad-signature-3.rs18
-rw-r--r--cortex-m-rt/tests/compile-fail/entry-bad-signature-1.rs2
-rw-r--r--cortex-m-rt/tests/compile-fail/entry-bad-signature-2.rs2
-rw-r--r--cortex-m-rt/tests/compile-fail/entry-bad-signature-3.rs4
-rw-r--r--cortex-m-rt/tests/compile-fail/entry-bad-signature-4.rs13
-rw-r--r--cortex-m-rt/tests/compile-fail/exception-bad-signature-1.rs2
-rw-r--r--cortex-m-rt/tests/compile-fail/exception-bad-signature-2.rs16
-rw-r--r--cortex-m-rt/tests/compile-fail/exception-bad-signature-3.rs18
-rw-r--r--cortex-m-rt/tests/compile-fail/hard-fault-bad-signature-1.rs2
-rw-r--r--cortex-m-rt/tests/compile-fail/hard-fault-bad-signature-2.rs18
12 files changed, 7 insertions, 106 deletions
diff --git a/cortex-m-rt/tests/compile-fail/default-handler-bad-signature-1.rs b/cortex-m-rt/tests/compile-fail/default-handler-bad-signature-1.rs
index a2c16c1..037e9c8 100644
--- a/cortex-m-rt/tests/compile-fail/default-handler-bad-signature-1.rs
+++ b/cortex-m-rt/tests/compile-fail/default-handler-bad-signature-1.rs
@@ -12,5 +12,5 @@ fn foo() -> ! {
}
#[exception] //~ ERROR custom attribute panicked
-//~^ HELP `DefaultHandler` exception must have signature `fn(i16)`
+//~^ HELP `DefaultHandler` exception must have signature `[unsafe] fn(i16) [-> !]`
fn DefaultHandler(_irqn: i16, undef: u32) {}
diff --git a/cortex-m-rt/tests/compile-fail/default-handler-bad-signature-2.rs b/cortex-m-rt/tests/compile-fail/default-handler-bad-signature-2.rs
deleted file mode 100644
index ec74993..0000000
--- a/cortex-m-rt/tests/compile-fail/default-handler-bad-signature-2.rs
+++ /dev/null
@@ -1,16 +0,0 @@
-#![no_main]
-#![no_std]
-
-extern crate cortex_m_rt;
-extern crate panic_semihosting;
-
-use cortex_m_rt::{entry, exception};
-
-#[entry]
-fn foo() -> ! {
- loop {}
-}
-
-#[exception] //~ ERROR custom attribute panicked
-//~^ HELP `DefaultHandler` exception must have signature `fn(i16)`
-unsafe fn DefaultHandler(_irqn: i16) {}
diff --git a/cortex-m-rt/tests/compile-fail/default-handler-bad-signature-3.rs b/cortex-m-rt/tests/compile-fail/default-handler-bad-signature-3.rs
deleted file mode 100644
index c827b6a..0000000
--- a/cortex-m-rt/tests/compile-fail/default-handler-bad-signature-3.rs
+++ /dev/null
@@ -1,18 +0,0 @@
-#![no_main]
-#![no_std]
-
-extern crate cortex_m_rt;
-extern crate panic_semihosting;
-
-use cortex_m_rt::{entry, exception};
-
-#[entry]
-fn foo() -> ! {
- loop {}
-}
-
-#[exception] //~ ERROR custom attribute panicked
-//~^ HELP `DefaultHandler` exception must have signature `fn(i16)`
-fn DefaultHandler(_irqn: i16) -> ! {
- loop {}
-}
diff --git a/cortex-m-rt/tests/compile-fail/entry-bad-signature-1.rs b/cortex-m-rt/tests/compile-fail/entry-bad-signature-1.rs
index c4914db..5eeb49f 100644
--- a/cortex-m-rt/tests/compile-fail/entry-bad-signature-1.rs
+++ b/cortex-m-rt/tests/compile-fail/entry-bad-signature-1.rs
@@ -7,5 +7,5 @@ extern crate panic_semihosting;
use cortex_m_rt::entry;
#[entry] //~ ERROR custom attribute panicked
-//~^ HELP `#[entry]` function must have signature `fn() -> !`
+//~^ HELP `#[entry]` function must have signature `[unsafe] fn() -> !`
fn foo() {}
diff --git a/cortex-m-rt/tests/compile-fail/entry-bad-signature-2.rs b/cortex-m-rt/tests/compile-fail/entry-bad-signature-2.rs
index 88ffd34..18bbaed 100644
--- a/cortex-m-rt/tests/compile-fail/entry-bad-signature-2.rs
+++ b/cortex-m-rt/tests/compile-fail/entry-bad-signature-2.rs
@@ -7,5 +7,5 @@ extern crate panic_semihosting;
use cortex_m_rt::entry;
#[entry] //~ ERROR custom attribute panicked
-//~^ HELP `#[entry]` function must have signature `fn() -> !`
+//~^ HELP `#[entry]` function must have signature `[unsafe] fn() -> !`
fn foo(undef: i32) -> ! {}
diff --git a/cortex-m-rt/tests/compile-fail/entry-bad-signature-3.rs b/cortex-m-rt/tests/compile-fail/entry-bad-signature-3.rs
index 0f2ddca..09b75e9 100644
--- a/cortex-m-rt/tests/compile-fail/entry-bad-signature-3.rs
+++ b/cortex-m-rt/tests/compile-fail/entry-bad-signature-3.rs
@@ -7,7 +7,7 @@ extern crate panic_semihosting;
use cortex_m_rt::entry;
#[entry] //~ ERROR custom attribute panicked
-//~^ HELP `#[entry]` function must have signature `fn() -> !`
-unsafe fn foo() -> ! {
+//~^ HELP `#[entry]` function must have signature `[unsafe] fn() -> !`
+extern "C" fn foo() -> ! {
loop {}
}
diff --git a/cortex-m-rt/tests/compile-fail/entry-bad-signature-4.rs b/cortex-m-rt/tests/compile-fail/entry-bad-signature-4.rs
deleted file mode 100644
index 2077f41..0000000
--- a/cortex-m-rt/tests/compile-fail/entry-bad-signature-4.rs
+++ /dev/null
@@ -1,13 +0,0 @@
-#![no_main]
-#![no_std]
-
-extern crate cortex_m_rt;
-extern crate panic_semihosting;
-
-use cortex_m_rt::entry;
-
-#[entry] //~ ERROR custom attribute panicked
-//~^ HELP `#[entry]` function must have signature `fn() -> !`
-extern "C" fn foo() -> ! {
- loop {}
-}
diff --git a/cortex-m-rt/tests/compile-fail/exception-bad-signature-1.rs b/cortex-m-rt/tests/compile-fail/exception-bad-signature-1.rs
index 1f4b707..966493e 100644
--- a/cortex-m-rt/tests/compile-fail/exception-bad-signature-1.rs
+++ b/cortex-m-rt/tests/compile-fail/exception-bad-signature-1.rs
@@ -12,5 +12,5 @@ fn foo() -> ! {
}
#[exception] //~ ERROR custom attribute panicked
-//~^ HELP `#[exception]` functions other than `DefaultHandler` and `HardFault` must have signature `fn()`
+//~^ HELP `#[exception]` functions other than `DefaultHandler` and `HardFault` must have signature `[unsafe] fn() [-> !]`
fn SysTick(undef: u32) {}
diff --git a/cortex-m-rt/tests/compile-fail/exception-bad-signature-2.rs b/cortex-m-rt/tests/compile-fail/exception-bad-signature-2.rs
deleted file mode 100644
index 8b1011d..0000000
--- a/cortex-m-rt/tests/compile-fail/exception-bad-signature-2.rs
+++ /dev/null
@@ -1,16 +0,0 @@
-#![no_main]
-#![no_std]
-
-extern crate cortex_m_rt;
-extern crate panic_semihosting;
-
-use cortex_m_rt::{entry, exception};
-
-#[entry]
-fn foo() -> ! {
- loop {}
-}
-
-#[exception] //~ ERROR custom attribute panicked
-//~^ HELP `#[exception]` functions other than `DefaultHandler` and `HardFault` must have signature `fn()`
-unsafe fn SysTick() {}
diff --git a/cortex-m-rt/tests/compile-fail/exception-bad-signature-3.rs b/cortex-m-rt/tests/compile-fail/exception-bad-signature-3.rs
deleted file mode 100644
index 546ef90..0000000
--- a/cortex-m-rt/tests/compile-fail/exception-bad-signature-3.rs
+++ /dev/null
@@ -1,18 +0,0 @@
-#![no_main]
-#![no_std]
-
-extern crate cortex_m_rt;
-extern crate panic_semihosting;
-
-use cortex_m_rt::{entry, exception};
-
-#[entry]
-fn foo() -> ! {
- loop {}
-}
-
-#[exception] //~ ERROR custom attribute panicked
-//~^ HELP `#[exception]` functions other than `DefaultHandler` and `HardFault` must have signature `fn()`
-fn SysTick() -> ! {
- loop {}
-}
diff --git a/cortex-m-rt/tests/compile-fail/hard-fault-bad-signature-1.rs b/cortex-m-rt/tests/compile-fail/hard-fault-bad-signature-1.rs
index 7c61240..83fda5f 100644
--- a/cortex-m-rt/tests/compile-fail/hard-fault-bad-signature-1.rs
+++ b/cortex-m-rt/tests/compile-fail/hard-fault-bad-signature-1.rs
@@ -12,7 +12,7 @@ fn foo() -> ! {
}
#[exception] //~ ERROR custom attribute panicked
-//~^ HELP `HardFault` exception must have signature `fn(&ExceptionFrame) -> !`
+//~^ HELP `HardFault` exception must have signature `[unsafe] fn(&ExceptionFrame) -> !`
fn HardFault(_ef: &ExceptionFrame, undef: u32) -> ! {
loop {}
}
diff --git a/cortex-m-rt/tests/compile-fail/hard-fault-bad-signature-2.rs b/cortex-m-rt/tests/compile-fail/hard-fault-bad-signature-2.rs
deleted file mode 100644
index add6943..0000000
--- a/cortex-m-rt/tests/compile-fail/hard-fault-bad-signature-2.rs
+++ /dev/null
@@ -1,18 +0,0 @@
-#![no_main]
-#![no_std]
-
-extern crate cortex_m_rt;
-extern crate panic_semihosting;
-
-use cortex_m_rt::{entry, exception, ExceptionFrame};
-
-#[entry]
-fn foo() -> ! {
- loop {}
-}
-
-#[exception] //~ ERROR custom attribute panicked
-//~^ HELP `HardFault` exception must have signature `fn(&ExceptionFrame) -> !`
-unsafe fn HardFault(_ef: &ExceptionFrame) -> ! {
- loop {}
-}