Skip to content

Commit aa9cf6a

Browse files
committed
add test that accepts a C-cmse-nonsecure-call function pointer
1 parent 1d8e458 commit aa9cf6a

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//@ build-pass
2+
//@ compile-flags: --target thumbv8m.main-none-eabi --crate-type lib
3+
//@ needs-llvm-components: arm
4+
#![feature(abi_c_cmse_nonsecure_call, cmse_nonsecure_entry, 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+
#[no_mangle]
13+
pub extern "C-cmse-nonsecure-entry" fn test(
14+
f: extern "C-cmse-nonsecure-call" fn(u32, u32, u32, u32) -> u32,
15+
a: u32,
16+
b: u32,
17+
c: u32,
18+
) -> u32 {
19+
f(a, b, c, 42)
20+
}

0 commit comments

Comments
 (0)