Skip to content

aarch64: add focused smoke coverage for multiply-by-constant codegen #2

Description

@bbbbbq

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions