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).
This commit is contained in:
Julian Frimmel 2024-10-15 12:23:35 +02:00
parent da44e3fdce
commit 652ba6699c
No known key found for this signature in database

View File

@ -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") };
}