Skip to content

Commit

Permalink
Add check-annotations ensuring correct label
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
jfrimmel committed Oct 15, 2024
1 parent da44e3f commit 652ba66
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/assembly/avr-rjmp-offsets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -33,6 +39,7 @@ pub fn pin_toggling() {
}

#[inline(never)]
#[no_mangle]
fn delay(_: u32) {
unsafe { asm!("nop") };
}
Expand Down

0 comments on commit 652ba66

Please sign in to comment.