diff options
| author | Folkert <folkert@folkertdev.nl> | 2024-08-01 16:30:04 +0200 |
|---|---|---|
| committer | Folkert de Vries <folkert@folkertdev.nl> | 2024-09-21 13:05:23 +0200 |
| commit | 4d75a4f0f223a5bff18d9e1c43a18929178bf0fc (patch) | |
| tree | fa5084c201a97f713a76f609cd2d96ae8769526c /tests/ui/cmse-nonsecure | |
| parent | a41c209ef30508d58a25dcfe39fb7c7f5f3bf6a2 (diff) | |
| download | rust-4d75a4f0f223a5bff18d9e1c43a18929178bf0fc.tar.gz rust-4d75a4f0f223a5bff18d9e1c43a18929178bf0fc.zip | |
disallow cmse ABIs on unsupported platforms
Diffstat (limited to 'tests/ui/cmse-nonsecure')
| -rw-r--r-- | tests/ui/cmse-nonsecure/cmse-nonsecure-entry/trustzone-only.aarch64.stderr (renamed from tests/ui/cmse-nonsecure/cmse-nonsecure-entry/trustzone-only.stderr) | 2 | ||||
| -rw-r--r-- | tests/ui/cmse-nonsecure/cmse-nonsecure-entry/trustzone-only.rs | 21 | ||||
| -rw-r--r-- | tests/ui/cmse-nonsecure/cmse-nonsecure-entry/trustzone-only.thumb7.stderr | 9 | ||||
| -rw-r--r-- | tests/ui/cmse-nonsecure/cmse-nonsecure-entry/trustzone-only.x86.stderr | 9 |
4 files changed, 37 insertions, 4 deletions
diff --git a/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/trustzone-only.stderr b/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/trustzone-only.aarch64.stderr index 77379f7049d..26409279fbe 100644 --- a/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/trustzone-only.stderr +++ b/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/trustzone-only.aarch64.stderr @@ -1,5 +1,5 @@ error[E0570]: `"C-cmse-nonsecure-entry"` is not a supported ABI for the current target - --> $DIR/trustzone-only.rs:5:1 + --> $DIR/trustzone-only.rs:20:1 | LL | pub extern "C-cmse-nonsecure-entry" fn entry_function(input: u32) -> u32 { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/trustzone-only.rs b/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/trustzone-only.rs index b1275a78ad7..a4ea7a1757d 100644 --- a/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/trustzone-only.rs +++ b/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/trustzone-only.rs @@ -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() {} diff --git a/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/trustzone-only.thumb7.stderr b/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/trustzone-only.thumb7.stderr new file mode 100644 index 00000000000..26409279fbe --- /dev/null +++ b/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/trustzone-only.thumb7.stderr @@ -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`. diff --git a/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/trustzone-only.x86.stderr b/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/trustzone-only.x86.stderr new file mode 100644 index 00000000000..26409279fbe --- /dev/null +++ b/tests/ui/cmse-nonsecure/cmse-nonsecure-entry/trustzone-only.x86.stderr @@ -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`. |
