Skip to content

Add macos-amd64 reference files for darwin x86_64#1215

Merged
marcauberer merged 3 commits into
mainfrom
fix/update-refs
Jun 17, 2026
Merged

Add macos-amd64 reference files for darwin x86_64#1215
marcauberer merged 3 commits into
mainfrom
fix/update-refs

Conversation

@marcauberer

Copy link
Copy Markdown
Member

Summary

The new MacOS/x86_64 CI job (added in #1210) surfaced 22 test cases whose compiler output legitimately differs on darwin + x86_64. This adds specialized macos-amd64 reference variants so those cases pass on the new runner without affecting any other platform.

The refs were reconstructed from the failing job's logged actual output and verified to differ from the existing (Linux x86_64) refs only in the platform-specific lines.

What differs on darwin x86_64

  • 21 × ir-code[-O2]-macos-amd64.ll (irgenerator/*, benchmark/success-pidigits):
    • host C++ stdlib argument-evaluation order (libstdc++ vs libc++) → operand load order in binary ops
    • differing std::hash values → typeid / TBAA / TySan type-id constants
    • ELF vs Mach-O codegen → comdat usage, @llvm.global_ctors, ASAN shadow offset (0x7fff80000x100000000000), dropped __asan_register_elf_globals
  • 2 × exception-macos-amd64.out (typechecker/imports/error-imported-{std,file}-not-existing): the import search-path suffix in the error message (_darwin_x86_64 / _darwin). These cases previously had no macOS x86_64 variant at all (only macos-aarch64).

Notes

  • IR refs are x86Only, so the generic ir-code.ll is the Linux x86_64 ref and AArch64 never compares it — which is why only this new OS+arch combination broke.
  • For the two debug-info tests, the !DIFile(...) lines (erased at compare time) were preserved so the variants stay structurally parallel to the Linux refs.

🤖 Generated with Claude Code

The new MacOS/x86_64 CI job surfaced 22 test cases whose output legitimately
differs on darwin x86_64. Add specialized macos-amd64 ref variants:

- 21 ir-code[-O2]-macos-amd64.ll files (irgenerator/* and benchmark): host
  C++ stdlib argument-evaluation order (libstdc++ vs libc++), differing
  std::hash values for typeid/TBAA/TySan, and ELF-vs-Mach-O codegen (comdat,
  llvm.global_ctors, ASAN shadow offset, __asan_register_elf_globals).
- 2 exception-macos-amd64.out files (typechecker/imports): the import
  search-path suffix in the error message (_darwin_x86_64 / _darwin); these
  cases previously had no macOS x86_64 variant.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@marcauberer marcauberer requested a review from a team as a code owner June 15, 2026 20:33
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@github-actions github-actions Bot added the tests Contains changes to the test cases label Jun 15, 2026
The new MacOS/x86_64 CI job failed IRGeneratorTests.builtins_successSyscall because the import search path (syscall_darwin_x86_64 / syscall_darwin / syscall) had no matching file. Add syscall_darwin_x86_64.spice with the Darwin BSD-class syscall numbers, which are architecture-independent and therefore identical to the existing syscall_darwin_aarch64.spice table.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@marcauberer marcauberer requested a review from a team as a code owner June 16, 2026 12:10
@github-actions github-actions Bot added the std Prs / issues regarding the standard lib label Jun 16, 2026
The macOS x86_64 syscall asm template emitted "movq $(33554432 + 0), %rax". In LLVM inline asm "$(" is a dialect-variant marker (stripped by the parser), and the trailing operand index was a literal instead of an operand reference, producing the invalid "movq 33554432 + 0), %rax" reported by the MC assembler.

Load the syscall number operand into %rax as usual, then add the BSD syscall-class offset (0x2000000) with a properly escaped immediate ($$ -> literal $).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@marcauberer marcauberer merged commit d18de21 into main Jun 17, 2026
9 checks passed
@marcauberer marcauberer deleted the fix/update-refs branch June 17, 2026 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compiler size/XXL std Prs / issues regarding the standard lib tests Contains changes to the test cases

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant