2024-07-17 10:42:24 +02:00
|
|
|
//@ compile-flags: --target armv5te-unknown-linux-gnueabi
|
|
|
|
//@ needs-llvm-components: arm
|
|
|
|
//@ needs-asm-support
|
|
|
|
//@ build-pass
|
|
|
|
|
|
|
|
#![crate_type = "lib"]
|
|
|
|
#![feature(no_core, lang_items, rustc_attrs, naked_functions)]
|
|
|
|
#![no_core]
|
|
|
|
|
|
|
|
#[rustc_builtin_macro]
|
2024-08-04 16:45:48 +02:00
|
|
|
macro_rules! naked_asm {
|
2024-07-17 10:42:24 +02:00
|
|
|
() => {};
|
|
|
|
}
|
|
|
|
|
|
|
|
#[lang = "sized"]
|
|
|
|
trait Sized {}
|
|
|
|
|
|
|
|
#[no_mangle]
|
|
|
|
#[naked]
|
|
|
|
#[instruction_set(arm::t32)]
|
|
|
|
unsafe extern "C" fn test_thumb() {
|
2024-09-05 13:45:26 +02:00
|
|
|
naked_asm!("bx lr");
|
2024-07-17 10:42:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#[no_mangle]
|
|
|
|
#[naked]
|
|
|
|
#[instruction_set(arm::t32)]
|
|
|
|
unsafe extern "C" fn test_arm() {
|
2024-09-05 13:45:26 +02:00
|
|
|
naked_asm!("bx lr");
|
2024-07-17 10:42:24 +02:00
|
|
|
}
|