-
Notifications
You must be signed in to change notification settings - Fork 13.3k
/
Copy pathinstruction-set.rs
53 lines (48 loc) · 1.09 KB
/
instruction-set.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//@ add-core-stubs
//@ revisions: arm-mode thumb-mode
//@ [arm-mode] compile-flags: --target armv5te-none-eabi
//@ [thumb-mode] compile-flags: --target thumbv5te-none-eabi
//@ [arm-mode] needs-llvm-components: arm
//@ [thumb-mode] needs-llvm-components: arm
#![crate_type = "lib"]
#![feature(no_core, lang_items, rustc_attrs)]
#![no_core]
extern crate minicore;
use minicore::*;
// arm-mode: .arm
// thumb-mode: .thumb
// CHECK-LABEL: test_unspecified:
// CHECK: bx lr
// CHECK: .popsection
// arm-mode: .arm
// thumb-mode: .thumb
#[no_mangle]
#[naked]
unsafe extern "C" fn test_unspecified() {
naked_asm!("bx lr");
}
// CHECK: .thumb
// CHECK: .thumb_func
// CHECK-LABEL: test_thumb:
// CHECK: bx lr
// CHECK: .popsection
// arm-mode: .arm
// thumb-mode: .thumb
#[no_mangle]
#[naked]
#[instruction_set(arm::t32)]
unsafe extern "C" fn test_thumb() {
naked_asm!("bx lr");
}
// CHECK: .arm
// CHECK-LABEL: test_arm:
// CHECK: bx lr
// CHECK: .popsection
// arm-mode: .arm
// thumb-mode: .thumb
#[no_mangle]
#[naked]
#[instruction_set(arm::a32)]
unsafe extern "C" fn test_arm() {
naked_asm!("bx lr");
}