]> git.lizzy.rs Git - rust.git/blob - src/test/ui/cmse-nonsecure/cmse-nonsecure-call/params-on-stack.rs
Auto merge of #102684 - JhonnyBillM:delete-target-data-layout-errors-wrapper, r=davidtwco
[rust.git] / src / test / ui / cmse-nonsecure / cmse-nonsecure-call / params-on-stack.rs
1 // build-fail
2 // compile-flags: --target thumbv8m.main-none-eabi --crate-type lib
3 // needs-llvm-components: arm
4 #![feature(abi_c_cmse_nonsecure_call, no_core, lang_items, intrinsics)]
5 #![no_core]
6 #[lang="sized"]
7 pub trait Sized { }
8 #[lang="copy"]
9 pub trait Copy { }
10 impl Copy for u32 {}
11
12 extern "rust-intrinsic" {
13     pub fn transmute<T, U>(e: T) -> U;
14 }
15
16 #[no_mangle]
17 pub fn test(a: u32, b: u32, c: u32, d: u32, e: u32) -> u32 {
18     let non_secure_function = unsafe {
19         transmute::<
20             usize,
21             extern "C-cmse-nonsecure-call" fn(u32, u32, u32, u32, u32) -> u32>
22         (
23             0x10000004,
24         )
25     };
26     non_secure_function(a, b, c, d, e)
27 }