Skip to content

test(const-param): an empty parameter may take an IR argument, as on Linux arm64 - #238

Closed
SizzleUnrlsd wants to merge 1 commit into
mainfrom
237-parameter-binding-abi
Closed

SizzleUnrlsd wants to merge 1 commit into
mainfrom
237-parameter-binding-abi

Conversation

@SizzleUnrlsd

@SizzleUnrlsd SizzleUnrlsd commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #237

Problem

testParameterDebugBinding lists every IR argument of the base-object constructors of Tagged and TagFirst (test/unit/parameter_binding_input.cpp), which take an empty struct Tag by value. The list assumes that the empty parameter takes no IR argument. That holds on x86-64 and Apple arm64, the platforms CI runs on, but not under AAPCS64 on Linux, which passes the empty class as an i8 argument (tag.coerce). Both checks fail there on main (f846712), although the binding is right: tag is bound to its own declaration, with its type and its source index.

Change

Test only: test/unit/analyzer_module_unit_tests.cpp and the comment of test/unit/parameter_binding_input.cpp (31 lines added, 5 removed).

  • An expected entry written "?name: binding" stands for the parameter of an argument that only some ABIs pass: the argument is absent, or it is at that place with that binding, and its IR name is the parameter's or derived from it (tag.coerce).
  • The other entries stay exact and in order, and every argument must match an entry.
  • Tagged and TagFirst list tag that way, and the comments say which ABIs pass the argument: none on x86-64 or Apple arm64, an i8 under AAPCS64 on Linux.

Tests

The two checks keep checking the type and the source index of every parameter. Mutants, each applied to the expectations and then restored:

Mutant macOS arm64 Linux arm64
x's source index changed in both expectations (required entries) Tagged and TagFirst fail Tagged and TagFirst fail
tag's source index changed in Tagged, its type in TagFirst (optional entries) both pass: no tag argument there Tagged and TagFirst fail

Validation

At d711321, on main at f846712:

  • macOS arm64 (LLVM 20): built without warning; all unit tests pass.
  • Linux arm64 (Docker, Ubuntu 24.04, LLVM 20.1.8): built without warning; all unit tests pass, tag.coerce matched by the optional entries.
  • Linux x86_64 (WSL, LLVM 20.1.2): the unit tests pass on the branch of ConstParameterNotModified suggests a const type that does not compile #217's second version, which carries this commit; tag takes no argument there.

CI and code scanning

  • CI on d711321 (merge ref 2136821, into main at f846712): every check passes, the macOS 14 build and the Linux binaries (amd64, arm64) included.
  • Code scanning: coretrace-stack-analyzer reported 71 results there and coretrace-concurrency-analyzer none, as on main at f846712. New alerts: none. The 66 alerts open on refs/pull/238/merge are the 66 open on main, alert for alert.

@SizzleUnrlsd

Copy link
Copy Markdown
Contributor Author

Closing as superseded by #239, which carries this PR's commit (d711321, merged into 217-t-v2 by 46c036f) and says "Fixes #237". #237 stays open until #239 is delivered.

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ParameterDebugBinding unit tests expect an empty parameter to take no IR argument, which fails on Linux arm64

1 participant