The checker allowed a scale equal to the bit width for signed
types, such as 32 for i32. LLVM requires a smaller scale for a
signed type, because the sign bit cannot hold a fraction bit. The
build then failed in LLVM with "scale must be less than the width"
instead of an Odin error at the call.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
LLVM only adds evex512 by itself for the generic x86 CPUs, so with the
default x86-64-v2 microarch, -target-features:avx512f left 512-bit
vectors split into ymm pairs and C got garbage lanes back from Odin
(and the other way round). Clang adds it whenever an AVX-512 feature is
on and evex512 isn't named, do the same for the global features and for
@(enable_target_feature).
Every other test in tests/issues/run.sh passes -microarch:native
through $COMMON. These two lines spell their flags out, as the test is
a directory and $COMMON has -file, and left it off. On a CI virtual
machine whose CPU is older than the default x86-64-v2, `odin test`
refuses to run without it, which fails the NetBSD job at random.
The debug compile unit was made from the first file of the initial
package. When build tags exclude all of its files, as for the
Windows-only tests/issues/test_issue_7547.odin on other targets, there
is none, and `odin test -debug` crashed on an out-of-bounds index.
Without `-debug` such a test builds and reports that there are no
tests to run, which `tests/issues/run.sh` relies on.
Fall back to the package's path for the compile unit's file.
A procedure with `@(disabled=true)` adds no dependency where it is
used, so that the calls to it, which are removed, do not pull it in.
Taking its value, e.g. `rawptr(assert)` with `-disable-assert`, then
referenced a procedure that was never generated, and LLVM asserted
"missing procedure 'assert'".
Add the dependency for every use that is not the callee of a call.
Casting a polymorphic procedure to `rawptr`, or to a procedure type
it cannot be specialized to, was accepted. There is no procedure to
take the address of, so the value came out nil, or the build hung, as
with `x := rawptr(avl.init_cmp)`. Assigning one to `rawptr` already
errors; make `cast` and `transmute` match. Casting to a procedure type
that specializes it still works, as assignment does.