-
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.
disallow cmse ABIs on unsupported platforms
- Loading branch information
1 parent
0e8c9cd
commit 9be420a
Showing
5 changed files
with
41 additions
and
6 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
2 changes: 1 addition & 1 deletion
2
...mse-nonsecure-entry/trustzone-only.stderr → ...ecure-entry/trustzone-only.aarch64.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
21 changes: 18 additions & 3 deletions
21
tests/ui/cmse-nonsecure/cmse-nonsecure-entry/trustzone-only.rs
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,10 +1,25 @@ | ||
//@ ignore-thumbv8m.main-none-eabi | ||
#![feature(cmse_nonsecure_entry)] | ||
//@ revisions: x86 aarch64 thumb7 | ||
// | ||
//@[x86] compile-flags: --target x86_64-unknown-linux-gnu | ||
//@[x86] needs-llvm-components: x86 | ||
//@[aarch64] compile-flags: --target aarch64-unknown-linux-gnu | ||
//@[aarch64] needs-llvm-components: aarch64 | ||
//@[thumb7] compile-flags: --target thumbv7em-none-eabi | ||
//@[thumb7] needs-llvm-components: arm | ||
#![feature(no_core, lang_items, rustc_attrs, cmse_nonsecure_entry)] | ||
#![no_core] | ||
|
||
#[lang = "sized"] | ||
trait Sized {} | ||
#[lang = "copy"] | ||
trait Copy {} | ||
|
||
impl Copy for u32 {} | ||
|
||
#[no_mangle] | ||
pub extern "C-cmse-nonsecure-entry" fn entry_function(input: u32) -> u32 { | ||
//~^ ERROR [E0570] | ||
input + 6 | ||
input | ||
} | ||
|
||
fn main() {} |
9 changes: 9 additions & 0 deletions
9
tests/ui/cmse-nonsecure/cmse-nonsecure-entry/trustzone-only.thumb7.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,9 @@ | ||
error[E0570]: `"C-cmse-nonsecure-entry"` is not a supported ABI for the current target | ||
--> $DIR/trustzone-only.rs:20:1 | ||
| | ||
LL | pub extern "C-cmse-nonsecure-entry" fn entry_function(input: u32) -> u32 { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0570`. |
9 changes: 9 additions & 0 deletions
9
tests/ui/cmse-nonsecure/cmse-nonsecure-entry/trustzone-only.x86.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,9 @@ | ||
error[E0570]: `"C-cmse-nonsecure-entry"` is not a supported ABI for the current target | ||
--> $DIR/trustzone-only.rs:20:1 | ||
| | ||
LL | pub extern "C-cmse-nonsecure-entry" fn entry_function(input: u32) -> u32 { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0570`. |