1 // Checks that only functions with the compatible instruction_set attributes are inlined.
3 // A function is "compatible" when the *callee* has the same attribute or no attribute.
5 // compile-flags: --target thumbv4t-none-eabi
6 // needs-llvm-components: arm
9 #![feature(rustc_attrs)]
10 #![feature(no_core, lang_items)]
11 #![feature(isa_attribute)]
14 #[rustc_builtin_macro]
19 $
(options($
(option
),*))?
21 /* compiler built-in */
30 #[instruction_set(arm::a32)]
32 fn instruction_set_a32() {}
34 #[instruction_set(arm::t32)]
36 fn instruction_set_t32() {}
39 fn instruction_set_default() {}
42 fn inline_always_and_using_inline_asm() {
43 unsafe { asm!("/* do nothing */") }
;
46 // EMIT_MIR inline_instruction_set.t32.Inline.diff
47 #[instruction_set(arm::t32)]
49 instruction_set_a32();
50 instruction_set_t32();
51 instruction_set_default();
52 inline_always_and_using_inline_asm();
55 // EMIT_MIR inline_instruction_set.default.Inline.diff
57 instruction_set_a32();
58 instruction_set_t32();
59 instruction_set_default();
60 inline_always_and_using_inline_asm();