FileCheck inline_instruction_set

This commit is contained in:
Ryan Mehri 2023-10-20 18:21:41 -07:00
parent 20e7caa737
commit 19c36a96df

View file

@ -1,4 +1,3 @@
// skip-filecheck
// Checks that only functions with the compatible instruction_set attributes are inlined. // Checks that only functions with the compatible instruction_set attributes are inlined.
// //
// A function is "compatible" when the *callee* has the same attribute or no attribute. // A function is "compatible" when the *callee* has the same attribute or no attribute.
@ -47,16 +46,26 @@ fn inline_always_and_using_inline_asm() {
// EMIT_MIR inline_instruction_set.t32.Inline.diff // EMIT_MIR inline_instruction_set.t32.Inline.diff
#[instruction_set(arm::t32)] #[instruction_set(arm::t32)]
pub fn t32() { pub fn t32() {
// CHECK-LABEL: fn t32(
// CHECK-NOT: (inlined instruction_set_a32)
instruction_set_a32(); instruction_set_a32();
// CHECK: (inlined instruction_set_t32)
instruction_set_t32(); instruction_set_t32();
// CHECK: (inlined instruction_set_default)
instruction_set_default(); instruction_set_default();
// CHECK-NOT: (inlined inline_always_and_using_inline_asm)
inline_always_and_using_inline_asm(); inline_always_and_using_inline_asm();
} }
// EMIT_MIR inline_instruction_set.default.Inline.diff // EMIT_MIR inline_instruction_set.default.Inline.diff
pub fn default() { pub fn default() {
// CHECK-LABEL: fn default(
// CHECK-NOT: (inlined instruction_set_a32)
instruction_set_a32(); instruction_set_a32();
// CHECK-NOT: (inlined instruction_set_t32)
instruction_set_t32(); instruction_set_t32();
// CHECK: (inlined instruction_set_default)
instruction_set_default(); instruction_set_default();
// CHECK: (inlined inline_always_and_using_inline_asm)
inline_always_and_using_inline_asm(); inline_always_and_using_inline_asm();
} }