From 652ba6699c30f036be07fead0df63a1e5f5ddbf8 Mon Sep 17 00:00:00 2001 From: Julian Frimmel Date: Tue, 15 Oct 2024 12:23:35 +0200 Subject: [PATCH] Add check-annotations ensuring correct label The issue was, that the disassembled label was placed one instruction further down than expected. Therefore the test annotations check, that the label is placed above the loop-contents (writing the one value, then writing the other one). --- tests/assembly/avr-rjmp-offsets.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/assembly/avr-rjmp-offsets.rs b/tests/assembly/avr-rjmp-offsets.rs index fafa2b43138da..bf43e016f92b7 100644 --- a/tests/assembly/avr-rjmp-offsets.rs +++ b/tests/assembly/avr-rjmp-offsets.rs @@ -21,6 +21,12 @@ macro_rules! asm { use minicore::ptr; // CHECK-LABEL: pin_toggling +// CHECK: .LBB0_1: +// CHECK-NEXT: out 5, r17 +// CHECK-NEXT: call delay +// CHECK-NEXT: out 5, r16 +// CHECK-NEXT: call delay +// CHECK-NEXT: rjmp .LBB0_1 #[no_mangle] pub fn pin_toggling() { let port_b = 0x25 as *mut u8; // the I/O-address of PORTB @@ -33,6 +39,7 @@ pub fn pin_toggling() { } #[inline(never)] +#[no_mangle] fn delay(_: u32) { unsafe { asm!("nop") }; }