-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Since the `tests/assembly` use `emit=asm`, the issue is not observable as reported in the linked issue. Therefore the existing test case is converted and a simple `rmake`-test is added. The test only checks, if the correct `rjmp`-offset is used.
- Loading branch information
Showing
2 changed files
with
40 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
//@ needs-llvm-components: avr | ||
//! Regression test for #129301/llvm-project#106722 within `rustc`. | ||
//! | ||
//! Some LLVM-versions had wrong offsets in the local labels, causing the first | ||
//! loop instruction to be missed. This test therefore contains a simple loop | ||
//! with trivial instructions in it, to see, where the label is placed. | ||
//! | ||
//! This must be a `rmake`-test and cannot be a `tests/assembly`-test, since the | ||
//! wrong output is only produced with direct assembly generation, but not when | ||
//! "emit-asm" is used, as described in the issue description of #129301: | ||
//! https://github.com/rust-lang/rust/issues/129301#issue-2475070770 | ||
use run_make_support::{llvm_objdump, rustc}; | ||
|
||
fn main() { | ||
rustc() | ||
.input("avr-rjmp-offsets.rs") | ||
.opt_level("s") | ||
.panic("abort") | ||
.target("avr-unknown-gnu-atmega328") | ||
.output("compiled") | ||
.run(); | ||
|
||
llvm_objdump() | ||
.disassemble() | ||
.input("compiled") | ||
.run() | ||
.assert_stdout_contains_regex(r"rjmp.*\.-14"); | ||
} |