-
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.
- Loading branch information
1 parent
d3dd34a
commit b1dd190
Showing
22 changed files
with
133 additions
and
14 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
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
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
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
10 changes: 10 additions & 0 deletions
10
tests/ui/cmse-nonsecure/cmse-nonsecure-entry-abi/gate_test.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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// gate-test-cmse_nonsecure_entry | ||
|
||
#[no_mangle] | ||
pub extern "C-cmse-nonsecure-entry" fn entry_function(input: u32) -> u32 { | ||
//~^ ERROR [E0570] | ||
//~| ERROR [E0658] | ||
input + 6 | ||
} | ||
|
||
fn main() {} |
20 changes: 20 additions & 0 deletions
20
tests/ui/cmse-nonsecure/cmse-nonsecure-entry-abi/gate_test.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,20 @@ | ||
error[E0658]: C-cmse-nonsecure-entry ABI is experimental and subject to change | ||
--> $DIR/gate_test.rs:4:12 | ||
| | ||
LL | pub extern "C-cmse-nonsecure-entry" fn entry_function(input: u32) -> u32 { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #75835 <https://github.com/rust-lang/rust/issues/75835> for more information | ||
= help: add `#![feature(cmse_nonsecure_entry)]` to the crate attributes to enable | ||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
|
||
error[E0570]: `"C-cmse-nonsecure-entry"` is not a supported ABI for the current target | ||
--> $DIR/gate_test.rs:4:1 | ||
| | ||
LL | pub extern "C-cmse-nonsecure-entry" fn entry_function(input: u32) -> u32 { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
Some errors have detailed explanations: E0570, E0658. | ||
For more information about an error, try `rustc --explain E0570`. |
15 changes: 15 additions & 0 deletions
15
tests/ui/cmse-nonsecure/cmse-nonsecure-entry-abi/params-on-registers.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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
//@ build-pass | ||
//@ 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"] | ||
trait Sized {} | ||
#[lang = "copy"] | ||
trait Copy {} | ||
impl Copy for u32 {} | ||
|
||
#[no_mangle] | ||
pub extern "C-cmse-nonsecure-entry" fn entry_function(_: u32, _: u32, _: u32, d: u32) -> u32 { | ||
d | ||
} |
21 changes: 21 additions & 0 deletions
21
tests/ui/cmse-nonsecure/cmse-nonsecure-entry-abi/params-on-stack.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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
//@ build-fail | ||
//@ 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"] | ||
trait Sized {} | ||
#[lang = "copy"] | ||
trait Copy {} | ||
impl Copy for u32 {} | ||
|
||
#[no_mangle] | ||
pub extern "C-cmse-nonsecure-entry" fn entry_function( | ||
_: u32, | ||
_: u32, | ||
_: u32, | ||
_: u32, | ||
e: u32, | ||
) -> u32 { | ||
e | ||
} |
4 changes: 4 additions & 0 deletions
4
tests/ui/cmse-nonsecure/cmse-nonsecure-entry-abi/params-on-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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
error: <unknown>:0:0: in function entry_function i32 (i32, i32, i32, i32, i32): secure entry function requires arguments on stack | ||
|
||
error: aborting due to 1 previous error | ||
|
10 changes: 10 additions & 0 deletions
10
tests/ui/cmse-nonsecure/cmse-nonsecure-entry-abi/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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
//@ ignore-thumbv8m.main-none-eabi | ||
#![feature(cmse_nonsecure_entry)] | ||
|
||
#[no_mangle] | ||
pub extern "C-cmse-nonsecure-entry" fn entry_function(input: u32) -> u32 { | ||
//~^ ERROR [E0570] | ||
input + 6 | ||
} | ||
|
||
fn main() {} |
9 changes: 9 additions & 0 deletions
9
tests/ui/cmse-nonsecure/cmse-nonsecure-entry-abi/trustzone-only.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:5: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`. |