about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJulian Frimmel <julian@fri-me.de>2024-10-15 12:23:35 +0200
committerJulian Frimmel <julian@fri-me.de>2024-10-15 12:23:35 +0200
commit652ba6699c30f036be07fead0df63a1e5f5ddbf8 (patch)
tree6a48809aedb55fa6b2e5c9785ab351f2131bf93d
parentda44e3fdceb46b8d53b2a6e93bca3b80d4243a17 (diff)
downloadrust-652ba6699c30f036be07fead0df63a1e5f5ddbf8.tar.gz
rust-652ba6699c30f036be07fead0df63a1e5f5ddbf8.zip
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).
-rw-r--r--tests/assembly/avr-rjmp-offsets.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/assembly/avr-rjmp-offsets.rs b/tests/assembly/avr-rjmp-offsets.rs
index fafa2b43138..bf43e016f92 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") };
 }