-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add error messages for
C-cmse-nonsecure-entry
- Loading branch information
1 parent
b3a6cd6
commit 87224ba
Showing
9 changed files
with
331 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
//@ compile-flags: --target thumbv8m.main-none-eabi --crate-type lib | ||
//@ needs-llvm-components: arm | ||
#![feature(cmse_nonsecure_entry, no_core, lang_items)] | ||
#![no_core] | ||
#[lang = "sized"] | ||
pub trait Sized {} | ||
#[lang = "copy"] | ||
pub trait Copy {} | ||
impl Copy for u32 {} | ||
|
||
#[repr(C)] | ||
struct Wrapper<T>(T); | ||
|
||
impl<T: Copy> Wrapper<T> { | ||
extern "C-cmse-nonsecure-entry" fn ambient_generic(_: T, _: u32, _: u32, _: u32) -> u64 { | ||
//~^ ERROR [E0798] | ||
0 | ||
} | ||
|
||
extern "C-cmse-nonsecure-entry" fn ambient_generic_nested( | ||
//~^ ERROR [E0798] | ||
_: Wrapper<T>, | ||
_: u32, | ||
_: u32, | ||
_: u32, | ||
) -> u64 { | ||
0 | ||
} | ||
} | ||
|
||
extern "C-cmse-nonsecure-entry" fn introduced_generic<U: Copy>( | ||
//~^ ERROR [E0798] | ||
_: U, | ||
_: u32, | ||
_: u32, | ||
_: u32, | ||
) -> u64 { | ||
0 | ||
} | ||
|
||
extern "C-cmse-nonsecure-entry" fn impl_trait(_: impl Copy, _: u32, _: u32, _: u32) -> u64 { | ||
//~^ ERROR [E0798] | ||
0 | ||
} |
39 changes: 39 additions & 0 deletions
39
tests/ui/cmse-nonsecure/cmse-nonsecure-entry/generics.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
error[E0798]: functions with the `"C-cmse-nonsecure-entry"` ABI cannot contain generics in their type | ||
--> $DIR/generics.rs:31:1 | ||
| | ||
LL | / extern "C-cmse-nonsecure-entry" fn introduced_generic<U: Copy>( | ||
LL | | | ||
LL | | _: U, | ||
LL | | _: u32, | ||
LL | | _: u32, | ||
LL | | _: u32, | ||
LL | | ) -> u64 { | ||
| |________^ | ||
|
||
error[E0798]: functions with the `"C-cmse-nonsecure-entry"` ABI cannot contain generics in their type | ||
--> $DIR/generics.rs:41:1 | ||
| | ||
LL | extern "C-cmse-nonsecure-entry" fn impl_trait(_: impl Copy, _: u32, _: u32, _: u32) -> u64 { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error[E0798]: functions with the `"C-cmse-nonsecure-entry"` ABI cannot contain generics in their type | ||
--> $DIR/generics.rs:15:5 | ||
| | ||
LL | extern "C-cmse-nonsecure-entry" fn ambient_generic(_: T, _: u32, _: u32, _: u32) -> u64 { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error[E0798]: functions with the `"C-cmse-nonsecure-entry"` ABI cannot contain generics in their type | ||
--> $DIR/generics.rs:20:5 | ||
| | ||
LL | / extern "C-cmse-nonsecure-entry" fn ambient_generic_nested( | ||
LL | | | ||
LL | | _: Wrapper<T>, | ||
LL | | _: u32, | ||
LL | | _: u32, | ||
LL | | _: u32, | ||
LL | | ) -> u64 { | ||
| |____________^ | ||
|
||
error: aborting due to 4 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0798`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 41 additions & 2 deletions
43
tests/ui/cmse-nonsecure/cmse-nonsecure-entry/params-via-stack.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,43 @@ | ||
error: <unknown>:0:0: in function f1 void (i32, i32, i32, i32, i32, i32): secure entry function requires arguments on stack | ||
error[E0798]: arguments for `"C-cmse-nonsecure-entry"` function too large to pass via registers | ||
--> $DIR/params-via-stack.rs:16:78 | ||
| | ||
LL | pub extern "C-cmse-nonsecure-entry" fn f1(_: u32, _: u32, _: u32, _: u32, _: u32, _: u32) {} | ||
| ^^^^^^^^^^^ these arguments don't fit in the available registers | ||
| | ||
= note: functions with the `"C-cmse-nonsecure-entry"` ABI must pass all their arguments via the 4 32-bit available argument registers | ||
|
||
error: aborting due to 1 previous error | ||
error[E0798]: arguments for `"C-cmse-nonsecure-entry"` function too large to pass via registers | ||
--> $DIR/params-via-stack.rs:18:78 | ||
| | ||
LL | pub extern "C-cmse-nonsecure-entry" fn f2(_: u32, _: u32, _: u32, _: u16, _: u16) {} | ||
| ^^^ this argument doesn't fit in the available registers | ||
| | ||
= note: functions with the `"C-cmse-nonsecure-entry"` ABI must pass all their arguments via the 4 32-bit available argument registers | ||
|
||
error[E0798]: arguments for `"C-cmse-nonsecure-entry"` function too large to pass via registers | ||
--> $DIR/params-via-stack.rs:20:62 | ||
| | ||
LL | pub extern "C-cmse-nonsecure-entry" fn f3(_: u32, _: u64, _: u32) {} | ||
| ^^^ this argument doesn't fit in the available registers | ||
| | ||
= note: functions with the `"C-cmse-nonsecure-entry"` ABI must pass all their arguments via the 4 32-bit available argument registers | ||
|
||
error[E0798]: arguments for `"C-cmse-nonsecure-entry"` function too large to pass via registers | ||
--> $DIR/params-via-stack.rs:22:64 | ||
| | ||
LL | pub extern "C-cmse-nonsecure-entry" fn f4(_: AlignRelevant, _: u32) {} | ||
| ^^^ this argument doesn't fit in the available registers | ||
| | ||
= note: functions with the `"C-cmse-nonsecure-entry"` ABI must pass all their arguments via the 4 32-bit available argument registers | ||
|
||
error[E0798]: arguments for `"C-cmse-nonsecure-entry"` function too large to pass via registers | ||
--> $DIR/params-via-stack.rs:26:46 | ||
| | ||
LL | pub extern "C-cmse-nonsecure-entry" fn f5(_: [u32; 5]) {} | ||
| ^^^^^^^^ this argument doesn't fit in the available registers | ||
| | ||
= note: functions with the `"C-cmse-nonsecure-entry"` ABI must pass all their arguments via the 4 32-bit available argument registers | ||
|
||
error: aborting due to 5 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0798`. |
Oops, something went wrong.