Background
We recently fixed an AArch64 codegen regression around multiply-by-constant / move-forwarding patterns. The broader AArch64 suites contain real programs that may hit similar code, but there is no small focused smoke test that directly covers multiply-by-constant correctness.
This is a good first issue because it is mostly test work: the goal is to learn the AArch64 test runner and add a tight regression case without touching register allocation or ABI code.
Scope
- Add a focused AArch64 backend smoke test under the existing AArch64 test structure, for example
tests/aarch64_backend_single_source/ or an appropriate tests/run/ smoke directory.
- Cover integer expressions using
x * 2, x * 3, x * 4, x * 5, x * 7.
- Include negative inputs so sign handling is exercised.
- Compile with
compiler -S and run the linked result under qemu.
- Run both
-O0 and -O1 if the local runner supports both modes.
- The test should validate program output or exit code.
- Do not require a specific instruction sequence such as
add x, x, lsl #1; correctness is the important part.
Suggested Validation
make test-aarch64-single-source-smoke
# or run the new test script directly
Acceptance Criteria
- The new smoke test fails clearly if generated AArch64 code computes a wrong multiply-by-constant result.
- The test covers at least
2, 3, 4, 5, and 7 multipliers plus negative input values.
- The test passes on the current AArch64 backend.
- No backend implementation changes are required unless the new test exposes a real bug.
Background
We recently fixed an AArch64 codegen regression around multiply-by-constant / move-forwarding patterns. The broader AArch64 suites contain real programs that may hit similar code, but there is no small focused smoke test that directly covers multiply-by-constant correctness.
This is a good first issue because it is mostly test work: the goal is to learn the AArch64 test runner and add a tight regression case without touching register allocation or ABI code.
Scope
tests/aarch64_backend_single_source/or an appropriatetests/run/smoke directory.x * 2,x * 3,x * 4,x * 5,x * 7.compiler -Sand run the linked result under qemu.-O0and-O1if the local runner supports both modes.add x, x, lsl #1; correctness is the important part.Suggested Validation
make test-aarch64-single-source-smoke # or run the new test script directlyAcceptance Criteria
2,3,4,5, and7multipliers plus negative input values.