aboutsummaryrefslogtreecommitdiff
path: root/test/runtime_safety.zig
AgeCommit message (Collapse)Author
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.
2022-05-12fix bad runtime safety test casesAndrew Kelley
The "slicing operator with sentinel" runtime safety test cases should all have been compile errors in their current forms. In this commit I adjust them to use runtime-known slices before triggering the runtime safety. Furthermore the test cases did not actually have unique names.
2022-03-30replace other uses of `std.meta.Vector` with `@Vector` (#11346)Meghan
2021-06-23fix unused variable errors in runtime safety test casesAndrew Kelley
2021-05-17update langref, compile-error tests, safety testsAndrew Kelley
for the std.builtin re-arranging
2021-04-24stage1: Require a block after suspendLemonBoy
Closes #8603
2021-01-30Replace @TagType uses, mostly with std.meta.TagTadeo Kondrak
2020-12-05Add some test cases for the previous commitsLemonBoy
2020-11-09stage1: Print correct error message for vector @intCastLemonBoy
2020-11-06Revert "update runtime safety test case - unsigned-signed vector cast"Andrew Kelley
This reverts commit 663f0b399c5f4e2528a969fba6cd58d8f9784f5a. The behavior appears to be inconsistent between running locally and on the CI. I suspect it could be based on what vector CPU features are available.
2020-11-06update runtime safety test case - unsigned-signed vector castAndrew Kelley
now it returns "integer cast truncated bits" instead of "attempt to cast negative value to unsigned integer" which I think is correct.
2020-10-19stage1: Implement `@intCast` between vectorsLemonBoy
Explicit and implicit integer casts on vector types are now supported and follow the same rules as their scalar counterparts. Implicit float casts are accidentally supported, `@floatCast` is still not vector-aware.
2020-10-14stage1: Fix missing runtime safety check for intToPtrLemonBoy
Elide the alignment check if the pointer alignment is one, the null check must be preserved as it depends on the pointer type. Fixes #6667
2020-07-05stage1: add missing runtime safety for @intCast unsigned -> signed of same ↵xackus
bit count
2020-06-24Fixed @asyncCall in runtime safety testAlexandros Naskos
2020-05-05update docs/tests for async/extern fn removalTadeo Kondrak
2020-05-05update tests for nosuspendTadeo Kondrak
2020-04-28@Vector -> std.meta.VectorTadeo Kondrak
2020-04-07fix the new runtime-safety testsAndrew Kelley
Thanks to Vexu's work in e62671f643, compile errors were identified in these test cases! This commit fixes them to use `const` as appropriate.
2020-04-07Merge pull request #4857 from LemonBoy/fix-4777Andrew Kelley
Rewrite the bound checks in slice operator
2020-04-06Add some tests for the runtime safety checksLemonBoy
2020-04-05add runtime safety tests for SIMD integer divisionAndrew Kelley
2020-03-19test & docs fixups to work with new semanticsAndrew Kelley
2020-03-11fix stray warn() in runtime safety testAndrew Kelley
2020-03-10ir: Implement more safety checks for shl/shrLemonBoy
The checks are now valid on types whose size is not a power of two. Closes #2096
2020-02-29C pointer slices are no longer allowzero (#4462)Alexandros Naskos
* Slices from C pointers are no longer allowzero but instead insert a runtime assertion. * Added a test, fixed code for cases with non-allowzero C pointers * Create new type when flipping allow_zero, sometimes we get a cached value back from adjust_ptr_len. * Added comments, changed panic message * Added runtime safety test.
2020-02-23remove @bytesToSlice, @sliceToBytes from tests, docsxackus
2019-12-20fix safety for sentinel-slicing floatsAndrew Kelley
2019-12-20sentinel slicing improvementsAndrew Kelley
* add runtime safety for slicing pointers, arrays, and slices. * slicing without a sentinel value results in non-sentineled slice * improved `std.debug.panic` handling of panic-during-panic
2019-12-15Make sure the address is aligned for intToPtr opsLemonBoy
Closes #773
2019-11-29more test regression fixesAndrew Kelley
2019-10-22implement safety for resuming non-suspended functionAndrew Kelley
closes #3469
2019-09-06runtime safety for noasync function callsAndrew Kelley
See #3157
2019-08-17fix compiler not checking alignment of function framesAndrew Kelley
closes #3086
2019-08-08more debuggable safety for awaiting twiceAndrew Kelley
2019-08-06error return trace across suspend pointsAndrew Kelley
2019-08-03implement `@asyncCall` which supports async function pointersAndrew Kelley
2019-08-03add runtime safety for resuming an awaiting functionAndrew Kelley
2019-07-22fix multiple coroutines existing clobbering each otherAndrew Kelley
2019-06-09different array literal syntax when inferring the sizeAndrew Kelley
old syntax: []i32{1, 2, 3} new syntax: [_]i32{1, 2, 3} closes #1797
2019-05-08C pointers support .? operatorAndrew Kelley
see #1967
2019-03-25implement allowzero pointer attributeAndrew Kelley
closes #1953 only needed for freestanding targets. also adds safety for `@intToPtr` when the address is zero.
2019-03-23add compile error for ignoring errorAndrew Kelley
closes #772
2019-02-22implement vector negationAndrew Kelley
also fix vector behavior tests, they weren't actually testing runtime vectors, but now they are. See #903
2019-02-14runtime safety check for casting null to pointerAndrew Kelley
see #1059
2019-02-09implement vector math safety with ext and truncAndrew Kelley
2019-02-07fix using the result of @intCast to u0Andrew Kelley
closes #1817
2018-11-24fix @intCast not catching negative numbers to unsignedAndrew Kelley
2018-11-13New Zig formal grammar (#1685)Jimmi Holst Christensen
Reverted #1628 and changed the grammar+parser of the language to not allow certain expr where types are expected
2018-10-15Solve the return type ambiguity (#1628)Jimmi Holst Christensen
Changed container and initializer syntax * <container> { ... } -> <container> . { ... } * <exrp> { ... } -> <expr> . { ...}