rust/tests
许杰友 Jieyou Xu (Joe) ebff167966
Rollup merge of #131755 - jfrimmel:avr-rjmp-offset-regression-test, r=jieyouxu
Regression test for AVR `rjmp` offset

This adds a regression test for #129301 by minimizing the code in the linked issue and putting it into a `#![no_core]`-compatible format, so that it can easily be used within an `rmake`-test. This needs to be a `rmake` test (opposed to a `tests/assembly` one), since the linked issue describes, that the problem only occurs if the code is directly compiled. Note, that `lld` is used instead of `avr-gcc`; see the [comments](https://github.com/rust-lang/rust/pull/131755#issuecomment-2416469675) [below](https://github.com/rust-lang/rust/pull/131755#issuecomment-2417160045).
Closes #129301.

To show, that the test actually catches the wrong behavior, this can be tested with a faulty rustc:
```bash
$ rustup install nightly-2024-08-19
$ rustc +nightly-2024-08-19 -C opt-level=s -C panic=abort --target avr-unknown-gnu-atmega328 -Clinker=build/x86_64-unknown-linux-gnu/ci-llvm/bin/lld -Clink-arg='--entry=main' -o compiled tests/run-make/avr-rjmp-offset/avr-rjmp-offsets.rs
$ llvm-objdump -d compiled | grep '<main>' -A 6
000110b4 <main>:
   110b4: 81 e0         ldi     r24, 0x1
   110b6: 92 e0         ldi     r25, 0x2
   110b8: 85 b9         out     0x5, r24
   110ba: 95 b9         out     0x5, r25
   110bc: fe cf         rjmp    .-4
```
One can see, that the wrong label offset (`4` instead of `6`) is produced, which would trigger an assertion in the test case.

This would be a good candidate for using the `minicore` proposed in #130693. Since this is not yet merged, there is a FIXME.

r? Patryk27
I think, you are the yet-to-be official target maintainer, hence I'll assign to you.

`@rustbot` label +O-AVR
2024-10-18 12:00:50 +01:00
..
assembly Convert to a rmake-test 2024-10-16 18:58:17 +02:00
auxiliary
codegen Auto merge of #131572 - cuviper:ub-index_range, r=thomcc 2024-10-17 22:18:24 +00:00
codegen-units Fix and enable disabled codegen-units tests 2024-08-10 14:03:27 -04:00
coverage coverage: Include the highest counter ID seen in .cov-map dumps 2024-10-11 21:04:37 +11:00
coverage-run-rustdoc coverage: Extract hole spans from HIR instead of MIR 2024-07-08 21:22:56 +10:00
crashes Don't check unsize goal in MIR validation when opaques remain 2024-10-15 21:01:42 -04:00
debuginfo Rollup merge of #131521 - jdonszelmann:rc, r=joboet 2024-10-15 12:33:36 -04:00
incremental Bless incremental tests. 2024-10-04 23:50:01 +00:00
mir-opt bless mir-opt tests 2024-10-17 10:22:55 +02:00
pretty Add pretty, ui, and feature-gate tests for the enzyme/autodiff frontend 2024-10-11 20:38:43 +02:00
run-make Rollup merge of #131755 - jfrimmel:avr-rjmp-offset-regression-test, r=jieyouxu 2024-10-18 12:00:50 +01:00
rustdoc Auto merge of #131797 - matthiaskrgr:rollup-lzpze2k, r=matthiaskrgr 2024-10-16 20:50:53 +00:00
rustdoc-gui Strengthen some GUI tests 2024-10-09 21:23:20 +02:00
rustdoc-js rustdoc-search: allow trailing Foo -> arg search 2024-09-05 17:58:05 -07:00
rustdoc-js-std Fix rustdoc-js-std path-ordering test due to API removal 2024-10-02 11:15:48 +02:00
rustdoc-json rustdoc-JSON: Rename "object safe" to "dyn compatible" 2024-10-16 23:00:49 +02:00
rustdoc-ui Rollup merge of #131691 - GuillaumeGomez:intra-doc-link-filter-out-2, r=notriddle 2024-10-16 20:15:53 +02:00
ui Rollup merge of #131857 - WaffleLapkin:dyn-drop-principal-3, r=compiler-errors 2024-10-18 06:59:07 +02:00
ui-fulldeps update bootstrap configs 2024-10-15 20:30:23 -07:00
COMPILER_TESTS.md