Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

all runtime safety tests passing for stage2 #11674

Closed
Tracked by #89
andrewrk opened this issue May 19, 2022 · 0 comments · Fixed by #12337
Closed
Tracked by #89

all runtime safety tests passing for stage2 #11674

andrewrk opened this issue May 19, 2022 · 0 comments · Fixed by #12337
Labels
enhancement Solving this issue will likely involve adding new logic or components to the codebase. frontend Tokenization, parsing, AstGen, Sema, and Liveness.
Milestone

Comments

@andrewrk
Copy link
Member

andy@ark ~/D/zig (master)> ls test/cases/safety/
'@alignCast misaligned.zig'
'array slice sentinel mismatch.zig'
'@asyncCall with too small a frame.zig'
'awaiting twice.zig'
'bad union field access.zig'
'calling panic.zig'
'cast integer to global error and no code matches.zig'
'cast []u8 to bigger slice of wrong size.zig'
'empty slice with sentinel out of bounds.zig'
'error return trace across suspend points.zig'
'@errSetCast error not present in destination.zig'
'exact division failure - vectors.zig'
'exact division failure.zig'
'@floatToInt cannot fit - negative out of range.zig'
'@floatToInt cannot fit - negative to unsigned.zig'
'@floatToInt cannot fit - positive out of range.zig'
'@intCast to u0.zig'
'integer addition overflow.zig'
'integer division by zero - vectors.zig'
'integer division by zero.zig'
'integer multiplication overflow.zig'
'integer negation overflow.zig'
'integer subtraction overflow.zig'
'@intToEnum - no matching tag value.zig'
'@intToPtr address zero to non-optional byte-aligned pointer.zig'
'@intToPtr address zero to non-optional pointer.zig'
'intToPtr with misaligned address.zig'
'invalid resume of async function.zig'
'nosuspend function call, callee suspends.zig'
'optional unwrap operator on C pointer.zig'
'optional unwrap operator on null pointer.zig'
'out of bounds slice access.zig'
'pointer casting null to non-optional pointer.zig'
'pointer slice sentinel mismatch.zig'
'resuming a function which is awaiting a call.zig'
'resuming a function which is awaiting a frame.zig'
'resuming a non-suspended function which has been suspended and resumed.zig'
'resuming a non-suspended function which never been suspended.zig'
'shift left by huge amount.zig'
'shift right by huge amount.zig'
'signed integer division overflow - vectors.zig'
'signed integer division overflow.zig'
'signed integer not fitting in cast to unsigned integer - widening.zig'
'signed integer not fitting in cast to unsigned integer.zig'
'signed shift left overflow.zig'
'signed shift right overflow.zig'
'signed-unsigned vector cast.zig'
'slice sentinel mismatch - floats.zig'
'slice sentinel mismatch - optional pointers.zig'
'slice slice sentinel mismatch.zig'
'slice with sentinel out of bounds.zig'
'slicing null C pointer.zig'
'switch on corrupted enum value.zig'
'switch on corrupted union value.zig'
'@tagName on corrupted enum value.zig'
'@tagName on corrupted union value.zig'
'truncating vector cast.zig'
'unsigned integer not fitting in cast to signed integer - same bit count.zig'
'unsigned shift left overflow.zig'
'unsigned shift right overflow.zig'
'unsigned-signed vector cast.zig'
'unwrap error.zig'
'value does not fit in shortening cast - u0.zig'
'value does not fit in shortening cast.zig'
'vector integer addition overflow.zig'
'vector integer multiplication overflow.zig'
'vector integer negation overflow.zig'
'vector integer subtraction overflow.zig'

Right now the manifest for these all look like:

// run
// backend=stage1
// target=native

In order to close this issue, we need to make them all look like this:

// run
// backend=stage1,stage2
// target=native

With a simple grep you can see which ones are still left to do:

andy@ark ~/D/zig (master)> grep backend test/cases/safety/* | grep -v stage2 
test/cases/safety/@alignCast misaligned.zig:// backend=stage1
test/cases/safety/@asyncCall with too small a frame.zig:    if (builtin.zig_backend == .stage1 and builtin.os.tag == .wasi) {
test/cases/safety/@asyncCall with too small a frame.zig:// backend=stage1
test/cases/safety/@errSetCast error not present in destination.zig:// backend=stage1
test/cases/safety/@floatToInt cannot fit - negative out of range.zig:// backend=stage1
test/cases/safety/@floatToInt cannot fit - negative to unsigned.zig:// backend=stage1
test/cases/safety/@floatToInt cannot fit - positive out of range.zig:// backend=stage1
test/cases/safety/@intCast to u0.zig:// backend=stage1
test/cases/safety/@intToEnum - no matching tag value.zig:// backend=stage1
test/cases/safety/@intToPtr address zero to non-optional byte-aligned pointer.zig:// backend=stage1
test/cases/safety/@intToPtr address zero to non-optional pointer.zig:// backend=stage1
test/cases/safety/@tagName on corrupted enum value.zig:// backend=stage1
test/cases/safety/@tagName on corrupted union value.zig:// backend=stage1
test/cases/safety/array slice sentinel mismatch.zig:// backend=stage1
test/cases/safety/awaiting twice.zig:// backend=stage1
test/cases/safety/bad union field access.zig:// backend=stage1
test/cases/safety/calling panic.zig:// backend=stage1
test/cases/safety/cast []u8 to bigger slice of wrong size.zig:// backend=stage1
test/cases/safety/cast integer to global error and no code matches.zig:// backend=stage1
test/cases/safety/empty slice with sentinel out of bounds.zig:// backend=stage1
test/cases/safety/error return trace across suspend points.zig:// backend=stage1
test/cases/safety/exact division failure - vectors.zig:// backend=stage1
test/cases/safety/exact division failure.zig:// backend=stage1
test/cases/safety/integer addition overflow.zig:// backend=stage1
test/cases/safety/integer division by zero - vectors.zig:// backend=stage1
test/cases/safety/integer division by zero.zig:// backend=stage1
test/cases/safety/integer multiplication overflow.zig:// backend=stage1
test/cases/safety/integer negation overflow.zig:// backend=stage1
test/cases/safety/integer subtraction overflow.zig:// backend=stage1
test/cases/safety/intToPtr with misaligned address.zig:// backend=stage1
test/cases/safety/invalid resume of async function.zig:// backend=stage1
test/cases/safety/nosuspend function call, callee suspends.zig:// backend=stage1
test/cases/safety/optional unwrap operator on C pointer.zig:// backend=stage1
test/cases/safety/optional unwrap operator on null pointer.zig:// backend=stage1
test/cases/safety/out of bounds slice access.zig:// backend=stage1
test/cases/safety/pointer casting null to non-optional pointer.zig:// backend=stage1
test/cases/safety/pointer slice sentinel mismatch.zig:// backend=stage1
test/cases/safety/resuming a function which is awaiting a call.zig:// backend=stage1
test/cases/safety/resuming a function which is awaiting a frame.zig:// backend=stage1
test/cases/safety/resuming a non-suspended function which has been suspended and resumed.zig:// backend=stage1
test/cases/safety/resuming a non-suspended function which never been suspended.zig:// backend=stage1
test/cases/safety/shift left by huge amount.zig:// backend=stage1
test/cases/safety/shift right by huge amount.zig:// backend=stage1
test/cases/safety/signed integer division overflow - vectors.zig:// backend=stage1
test/cases/safety/signed integer division overflow.zig:// backend=stage1
test/cases/safety/signed integer not fitting in cast to unsigned integer - widening.zig:// backend=stage1
test/cases/safety/signed integer not fitting in cast to unsigned integer.zig:// backend=stage1
test/cases/safety/signed shift left overflow.zig:// backend=stage1
test/cases/safety/signed shift right overflow.zig:// backend=stage1
test/cases/safety/signed-unsigned vector cast.zig:// backend=stage1
test/cases/safety/slice sentinel mismatch - floats.zig:// backend=stage1
test/cases/safety/slice sentinel mismatch - optional pointers.zig:// backend=stage1
test/cases/safety/slice slice sentinel mismatch.zig:// backend=stage1
test/cases/safety/slice with sentinel out of bounds.zig:// backend=stage1
test/cases/safety/slicing null C pointer.zig:// backend=stage1
test/cases/safety/switch on corrupted enum value.zig:// backend=stage1
test/cases/safety/switch on corrupted union value.zig:// backend=stage1
test/cases/safety/truncating vector cast.zig:// backend=stage1
test/cases/safety/unsigned integer not fitting in cast to signed integer - same bit count.zig:// backend=stage1
test/cases/safety/unsigned shift left overflow.zig:// backend=stage1
test/cases/safety/unsigned shift right overflow.zig:// backend=stage1
test/cases/safety/unsigned-signed vector cast.zig:// backend=stage1
test/cases/safety/unwrap error.zig:// backend=stage1
test/cases/safety/value does not fit in shortening cast - u0.zig:// backend=stage1
test/cases/safety/value does not fit in shortening cast.zig:// backend=stage1
test/cases/safety/vector integer addition overflow.zig:// backend=stage1
test/cases/safety/vector integer multiplication overflow.zig:// backend=stage1
test/cases/safety/vector integer negation overflow.zig:// backend=stage1
test/cases/safety/vector integer subtraction overflow.zig:// backend=stage1

You can run the safety tests like this:

stage1/bin/zig build test-cases -Denable-llvm -Dtest-filter=safety
@andrewrk andrewrk added enhancement Solving this issue will likely involve adding new logic or components to the codebase. frontend Tokenization, parsing, AstGen, Sema, and Liveness. labels May 19, 2022
@andrewrk andrewrk added this to the 0.10.0 milestone May 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Solving this issue will likely involve adding new logic or components to the codebase. frontend Tokenization, parsing, AstGen, Sema, and Liveness.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant