Skip to content

Commit af4c41b

Browse files
folkertdevtdittr
andcommitted
Add assembly test for the cmse unstable features
verifies that the correct return instructions are emitted. Co-authored-by: Tamme Dittrich <[email protected]>
1 parent aa9cf6a commit af4c41b

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

tests/assembly/cmse.rs

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
//@ assembly-output: emit-asm
2+
//@ compile-flags: --target thumbv8m.main-none-eabi --crate-type lib -Copt-level=1
3+
//@ needs-llvm-components: arm
4+
#![crate_type = "lib"]
5+
#![feature(abi_c_cmse_nonsecure_call, cmse_nonsecure_entry, no_core, lang_items)]
6+
#![no_core]
7+
#[lang = "sized"]
8+
pub trait Sized {}
9+
#[lang = "copy"]
10+
pub trait Copy {}
11+
12+
// CHECK-LABEL: __acle_se_entry_point
13+
// CHECK: bxns
14+
#[no_mangle]
15+
pub extern "C-cmse-nonsecure-entry" fn entry_point() -> i64 {
16+
0
17+
}
18+
19+
// CHECK-LABEL: call_nonsecure
20+
// CHECK: blxns
21+
#[no_mangle]
22+
pub fn call_nonsecure(
23+
f: unsafe extern "C-cmse-nonsecure-call" fn(u32, u32, u32, u32) -> u64,
24+
) -> u64 {
25+
unsafe { f(0, 1, 2, 3) }
26+
}

0 commit comments

Comments
 (0)