run_examples.sh now supports an optional `tests/expected/<name>.ir` sibling to `.txt`/`.exit`. When present, the runner also captures `sx ir <file>` output, normalizes target-/host-specific noise (module ID, target triple/datalayout, attribute groups, LLVM's auto-suffixed %temp numbering), and diffs against the snapshot. `--update` regenerates it alongside the runtime output. Catches lowering changes that don't affect what the program prints — exactly the shape Phase 1.5's selector interning will produce (same runtime output, very different IR). First snapshot: `ffi-objc-call-03-selector-sharing.ir`. Today the test emits four `call ptr @sel_registerName(ptr @str.N)` lines for its four call sites; after 1.5 we expect two static `@OBJC_SELECTOR_REFERENCES_<sel>` globals + loads at each call site. The diff between the two snapshots will be the visible artifact of the optimization.
3.7 KiB
Executable File
3.7 KiB
Executable File