Skip to content

Commit

Permalink
Add assembly test for the cmse unstable features
Browse files Browse the repository at this point in the history
verifies that the correct return instructions are emitted.

Co-authored-by: Tamme Dittrich <tamme@tweedegolf.com>
  • Loading branch information
folkertdev and tdittr committed Jul 18, 2024
1 parent aa9cf6a commit af4c41b
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/assembly/cmse.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//@ assembly-output: emit-asm
//@ compile-flags: --target thumbv8m.main-none-eabi --crate-type lib -Copt-level=1
//@ needs-llvm-components: arm
#![crate_type = "lib"]
#![feature(abi_c_cmse_nonsecure_call, cmse_nonsecure_entry, no_core, lang_items)]
#![no_core]
#[lang = "sized"]
pub trait Sized {}
#[lang = "copy"]
pub trait Copy {}

// CHECK-LABEL: __acle_se_entry_point
// CHECK: bxns
#[no_mangle]
pub extern "C-cmse-nonsecure-entry" fn entry_point() -> i64 {
0
}

// CHECK-LABEL: call_nonsecure
// CHECK: blxns
#[no_mangle]
pub fn call_nonsecure(
f: unsafe extern "C-cmse-nonsecure-call" fn(u32, u32, u32, u32) -> u64,
) -> u64 {
unsafe { f(0, 1, 2, 3) }
}

0 comments on commit af4c41b

Please sign in to comment.