aboutsummaryrefslogtreecommitdiff
path: root/test/cases/safety/signed-unsigned vector cast.zig
AgeCommit message (Collapse)Author
2025-09-16test: rename backend=stage2 to backend=selfhosted, and add backend=autoAlex Rønne Petersen
backend=auto (now the default if backend is omitted) means to let the compiler pick whatever backend it wants as the default. This is important for platforms where we don't yet have a self-hosted backend, such as loongarch64. Also purge a bunch of redundant target=native.
2025-07-26aarch64: implement some safety checksJacob Young
Closes #24553
2025-06-01compiler: combine `@intCast` safety checksmlugg
`castTruncatedData` was a poorly worded error (all shrinking casts "truncate bits", it's just that we assume those bits to be zext/sext of the other bits!), and `negativeToUnsigned` was a pointless distinction which forced the compiler to emit worse code (since two separate safety checks were required for casting e.g. 'i32' to 'u16') and wasn't even implemented correctly. This commit combines those safety panics into one function, `integerOutOfBounds`. The name maybe isn't perfect, but that's not hugely important; what matters is the new default message, which is clearer than the old ones: "integer does not fit in destination type".
2025-02-15x86_64: implement error set and enum safetyJacob Young
This is all of the expected 0.14.0 progress on #21530, which can now be postponed once this commit is merged. This required rewriting the (un)wrap operations since the original implementations were extremely buggy. Also adds an easy way to retrigger Sema OPV bugs so that I don't have to keep updating #22419 all the time.
2023-11-19test: update cases to silence 'var is never mutated' errorsmlugg
2023-07-12Update tests to new splat syntaxantlilja
2023-06-24all: migrate code to new cast builtin syntaxmlugg
Most of this migration was performed automatically with `zig fmt`. There were a few exceptions which I had to manually fix: * `@alignCast` and `@addrSpaceCast` cannot be automatically rewritten * `@truncate`'s fixup is incorrect for vectors * Test cases are not formatted, and their error locations change
2022-09-20std: add return address parameter to panic fnVeikka Tuominen
2022-07-23Sema: cast negative to unsigned safetyVeikka Tuominen
2022-05-13runtime safety tests only on the native targetAndrew Kelley
This matches master branch. We can look into adding more target coverage as we switch to stage2. As it stands, this works around having to duplicate the "Executor" logic to figure out when to not run the tests due to them being non-native.
2022-05-13migrate runtime safety tests to the new test harnessAndrew Kelley
* migrate runtime safety tests to the new test harness - this required adding compare output / execution support for stage1 to the test harness. * rename `zig build test-stage2` to `zig build test-cases` since it now does quite a bit of stage1 testing actually. I named it this way since the main directory in the source tree associated with these tests is "test/cases/". * add some documentation for the test manifest format.