0
Fork 0
mirror of https://codeberg.org/ziglang/zig synced 2026-11-18 07:05:05 +00:00
zig/test/behavior
Andrew Kelley a3104a4a78 stage2: fix comptime stores and sentinel-terminated arrays
* ZIR: the `array_type_sentinel` now has a source node attached to it
   for proper error reporting.
 * Refactor: move `Module.arrayType` to `Type.array`
 * Value: the `bytes` and `array` tags now include the sentinel, if the
   type has one. This simplifies comptime evaluation logic.
 * Sema: fix `zirStructInitEmpty` to properly handle when the type is
   void or a sentinel-terminated array. This handles the syntax `void{}`
   and `[0:X]T{}`.
 * Sema: fix the logic for reporting "cannot store runtime value in
   compile time variable" as well as for emitting a runtime store when a
   pointer value is comptime known but it is a global variable.
 * Sema: implement elemVal for double pointer to array. This can happen
   with this code for example: `var a: *[1]u8 = undefined; _ = a[0];`
 * Sema: Rework the `storePtrVal` function to properly handle nested
   structs and arrays.
   - Also it now handles comptime stores through a bitcasted pointer.
     When the pointer element type and the type according to the Decl
     don't match, the element value is bitcasted before storage.
History 2021-10-12 21:38:46 -07:00
..
bugs stage2: support nested structs and arrays and sret 2021-10-11 11:39:12 -07:00
hasdecl move behavior tests from test/stage1/ to test/ 2021-04-29 15:54:04 -07:00
import move behavior tests from test/stage1/ to test/ 2021-04-29 15:54:04 -07:00
namespace_depends_on_compile_var move behavior tests from test/stage1/ to test/ 2021-04-29 15:54:04 -07:00
pub_enum move behavior tests from test/stage1/ to test/ 2021-04-29 15:54:04 -07:00
usingnamespace std: fix regressions from this branch 2021-09-01 17:54:07 -07:00
align.zig fix code broken from previous commit 2021-06-21 17:03:03 -07:00
alignof.zig Merge remote-tracking branch 'origin/master' into stage2-whole-file-astgen 2021-05-08 14:45:21 -07:00
array.zig stage2: fix comptime stores and sentinel-terminated arrays 2021-10-12 21:38:46 -07:00
array_stage1.zig stage2: fix comptime stores and sentinel-terminated arrays 2021-10-12 21:38:46 -07:00
asm.zig migrate from std.Target.current to @import("builtin").target 2021-10-04 23:48:55 -07:00
async_fn.zig fix code broken from previous commit 2021-06-21 17:03:03 -07:00
atomics.zig migrate from std.Target.current to @import("builtin").target 2021-10-04 23:48:55 -07:00
await_struct.zig std, src, doc, test: remove unused variables 2021-06-21 17:03:03 -07:00
basic.zig stage2: implement @memset and @memcpy builtins 2021-09-24 17:33:06 -07:00
bit_shifting.zig std, src, doc, test: remove unused variables 2021-06-21 17:03:03 -07:00
bitcast.zig stage2: fix comptime @bitCast 2021-10-04 23:30:04 -07:00
bitcast_stage1.zig stage2: fix comptime @bitCast 2021-10-04 23:30:04 -07:00
bitreverse.zig Merge remote-tracking branch 'origin/master' into stage2-whole-file-astgen 2021-05-08 14:45:21 -07:00
bool.zig Sema: implement comptime variables 2021-08-01 12:36:04 -07:00
byteswap.zig re-enable mips behavior tests for vectors 2021-09-01 15:41:29 -07:00
byval_arg_var.zig Merge remote-tracking branch 'origin/master' into stage2-whole-file-astgen 2021-05-08 14:45:21 -07:00
call.zig AstGen: fix while and for with unreachable bodies 2021-10-02 20:15:03 -07:00
call_stage1.zig AstGen: fix while and for with unreachable bodies 2021-10-02 20:15:03 -07:00
cast.zig AstGen: fix while and for with unreachable bodies 2021-10-02 20:15:03 -07:00
cast_stage1.zig AstGen: fix while and for with unreachable bodies 2021-10-02 20:15:03 -07:00
comptime_memory.zig Add comptime memory tests 2021-08-30 18:50:07 -04:00
const_slice_child.zig AstGen: fix while and for with unreachable bodies 2021-10-02 20:15:03 -07:00
defer.zig AstGen: fix while and for with unreachable bodies 2021-10-02 20:15:03 -07:00
defer_stage1.zig AstGen: fix while and for with unreachable bodies 2021-10-02 20:15:03 -07:00
enum.zig stage2: implement runtime @intToEnum 2021-10-05 21:38:47 -07:00
enum_stage1.zig stage2: enum fixes 2021-10-05 23:05:14 -07:00
error.zig stage1: remove incorrect compile error for var redeclaration 2021-08-24 22:35:37 -07:00
eval.zig stage2: fix comptime_float negation 2021-10-07 17:11:27 -07:00
eval_stage1.zig stage2: fix comptime_float negation 2021-10-07 17:11:27 -07:00
field_parent_ptr.zig Merge remote-tracking branch 'origin/master' into stage2-whole-file-astgen 2021-05-08 14:45:21 -07:00
floatop.zig Merge remote-tracking branch 'origin/master' into stage2-whole-file-astgen 2021-05-08 14:45:21 -07:00
fn.zig fix code broken from previous commit 2021-06-21 17:03:03 -07:00
fn_delegation.zig Merge remote-tracking branch 'origin/master' into stage2-whole-file-astgen 2021-05-08 14:45:21 -07:00
fn_in_struct_in_comptime.zig Merge remote-tracking branch 'origin/master' into stage2-whole-file-astgen 2021-05-08 14:45:21 -07:00
for.zig AstGen: fix while and for with unreachable bodies 2021-10-02 20:15:03 -07:00
for_stage1.zig AstGen: fix while and for with unreachable bodies 2021-10-02 20:15:03 -07:00
generics.zig Stage 2: Support inst.func() syntax (#9827) 2021-09-28 12:00:35 -05:00
generics_stage1.zig Stage 2: Support inst.func() syntax (#9827) 2021-09-28 12:00:35 -05:00
hasdecl.zig Merge remote-tracking branch 'origin/master' into stage2-whole-file-astgen 2021-05-08 14:45:21 -07:00
hasfield.zig Merge remote-tracking branch 'origin/master' into stage2-whole-file-astgen 2021-05-08 14:45:21 -07:00
if.zig AstGen: fix while and for with unreachable bodies 2021-10-02 20:15:03 -07:00
if_stage1.zig AstGen: fix while and for with unreachable bodies 2021-10-02 20:15:03 -07:00
import.zig std, src, doc, test: remove unused variables 2021-06-21 17:03:03 -07:00
incomplete_struct_param_tld.zig Merge remote-tracking branch 'origin/master' into stage2-whole-file-astgen 2021-05-08 14:45:21 -07:00
inttoptr.zig std, src, doc, test: remove unused variables 2021-06-21 17:03:03 -07:00
ir_block_deps.zig std, src, doc, test: remove unused variables 2021-06-21 17:03:03 -07:00
math.zig stage2: implement @clz and @ctz 2021-09-28 22:38:51 -07:00
math_stage1.zig stage2: implement @clz and @ctz 2021-09-28 22:38:51 -07:00
maximum_minimum.zig minimum/maximum builtins 2021-07-26 20:41:00 -04:00
member_func.zig Stage 2: Support inst.func() syntax (#9827) 2021-09-28 12:00:35 -05:00
merge_error_sets.zig move behavior tests from test/stage1/ to test/ 2021-04-29 15:54:04 -07:00
misc.zig stage2: implement @memset and @memcpy builtins 2021-09-24 17:33:06 -07:00
muladd.zig freestanding libc: export fmal 2021-10-05 16:56:46 -07:00
namespace_depends_on_compile_var.zig migrate from std.Target.current to @import("builtin").target 2021-10-04 23:48:55 -07:00
null.zig fix code broken from previous commit 2021-06-21 17:03:03 -07:00
optional.zig fix code broken from previous commit 2021-06-21 17:03:03 -07:00
pointers.zig stage2: pass some pointer tests 2021-08-07 15:46:53 -07:00
pointers_stage1.zig stage2: pass some pointer tests 2021-08-07 15:46:53 -07:00
popcount.zig re-enable mips behavior tests for vectors 2021-09-01 15:41:29 -07:00
ptrcast.zig Merge remote-tracking branch 'origin/master' into stage2-whole-file-astgen 2021-05-08 14:45:21 -07:00
pub_enum.zig Merge remote-tracking branch 'origin/master' into stage2-whole-file-astgen 2021-05-08 14:45:21 -07:00
ref_var_in_if_after_if_2nd_switch_prong.zig Merge remote-tracking branch 'origin/master' into stage2-whole-file-astgen 2021-05-08 14:45:21 -07:00
reflection.zig fix code broken from previous commit 2021-06-21 17:03:03 -07:00
saturating_arithmetic.zig stage2: fix Type max/min int calculation 2021-10-04 12:23:49 -07:00
select.zig Add @select 2021-07-26 20:05:48 -04:00
shuffle.zig re-enable mips behavior tests for vectors 2021-09-01 15:41:29 -07:00
sizeof_and_typeof.zig migrate from std.Target.current to @import("builtin").target 2021-10-04 23:48:55 -07:00
sizeof_and_typeof_stage1.zig migrate from std.Target.current to @import("builtin").target 2021-10-04 23:48:55 -07:00
slice.zig std, src, doc, test: remove unused variables 2021-06-21 17:03:03 -07:00
slice_sentinel_comptime.zig std, src, doc, test: remove unused variables 2021-06-21 17:03:03 -07:00
src.zig Merge remote-tracking branch 'origin/master' into stage2-whole-file-astgen 2021-05-08 14:45:21 -07:00
struct.zig stage2: support nested structs and arrays and sret 2021-10-11 11:39:12 -07:00
struct_contains_null_ptr_itself.zig Merge remote-tracking branch 'origin/master' into stage2-whole-file-astgen 2021-05-08 14:45:21 -07:00
struct_contains_slice_of_itself.zig Merge remote-tracking branch 'origin/master' into stage2-whole-file-astgen 2021-05-08 14:45:21 -07:00
struct_stage1.zig stage2: support nested structs and arrays and sret 2021-10-11 11:39:12 -07:00
switch.zig AstGen: fix while and for with unreachable bodies 2021-10-02 20:15:03 -07:00
switch_prong_err_enum.zig Merge remote-tracking branch 'origin/master' into stage2-whole-file-astgen 2021-05-08 14:45:21 -07:00
switch_prong_implicit_cast.zig Merge remote-tracking branch 'origin/master' into stage2-whole-file-astgen 2021-05-08 14:45:21 -07:00
switch_stage1.zig AstGen: fix while and for with unreachable bodies 2021-10-02 20:15:03 -07:00
this.zig Stage2: Implement comptime closures and the This builtin (#9823) 2021-09-23 13:17:06 -04:00
translate_c_macros.h translate-c: handle macros that cast to cv void 2021-08-06 09:10:50 +03:00
translate_c_macros.zig stage2: various fixes to cImport, sizeOf and types to get tests passing 2021-09-20 20:51:31 -07:00
translate_c_macros_stage1.zig stage2: various fixes to cImport, sizeOf and types to get tests passing 2021-09-20 20:51:31 -07:00
truncate.zig Fix unexpected truncation behavior with comptime_int larger than u64 range (#9303) 2021-07-06 12:42:18 +03:00
try.zig Merge remote-tracking branch 'origin/master' into stage2-whole-file-astgen 2021-05-08 14:45:21 -07:00
tuple.zig std, src, doc, test: remove unused variables 2021-06-21 17:03:03 -07:00
type.zig Address Spaces: Pointer and function info in @Type 2021-09-20 02:29:04 +02:00
type_info.zig fix code broken from previous commit 2021-06-21 17:03:03 -07:00
typename.zig stage1: fix anon struct naming in certain cases 2021-07-28 18:17:11 -04:00
undefined.zig Merge remote-tracking branch 'origin/master' into stage2-whole-file-astgen 2021-05-08 14:45:21 -07:00
underscore.zig AstGen: fix while and for with unreachable bodies 2021-10-02 20:15:03 -07:00
union.zig stage2: implement union coercion to its own tag 2021-09-27 23:11:00 -07:00
union_stage1.zig move tagged union behavior tests to the appropriate place 2021-10-05 21:07:36 -07:00
union_with_members.zig AstGen: fix while and for with unreachable bodies 2021-10-02 20:15:03 -07:00
usingnamespace.zig stage2: first pass at implementing usingnamespace 2021-09-01 17:54:06 -07:00
usingnamespace_stage1.zig std: fix regressions from this branch 2021-09-01 17:54:07 -07:00
var_args.zig fix code broken from previous commit 2021-06-21 17:03:03 -07:00
vector.zig migrate from std.Target.current to @import("builtin").target 2021-10-04 23:48:55 -07:00
void.zig std, src, doc, test: remove unused variables 2021-06-21 17:03:03 -07:00
wasm.zig Merge remote-tracking branch 'origin/master' into stage2-whole-file-astgen 2021-05-08 14:45:21 -07:00
while.zig AstGen: fix while and for with unreachable bodies 2021-10-02 20:15:03 -07:00
while_stage1.zig AstGen: fix while and for with unreachable bodies 2021-10-02 20:15:03 -07:00
widening.zig stage2: enum fixes 2021-10-05 23:05:14 -07:00