Commit Graph

2518 Commits

Author SHA1 Message Date
antlilja a0ec2266fe Update tests to new splat syntax 2023-07-12 15:35:57 -07:00
Ian Johnson 3a30f0fa50 Sema: resolve field type layout for anon struct type info
Closes #16148
2023-07-10 19:17:50 +03:00
Andrew Kelley 17890f6b8a Merge pull request #15879 from r00ster91/more_stage1_test_coverage
More stage1 test coverage
2023-07-03 15:59:54 -07:00
r00ster91 2583a39fb6 behavior: test @bitCast of packed struct of bools
This seems to have resolved itself now.
Tested on x86_64 using debug optimize mode.

Closes #9851
2023-07-03 10:59:13 -07:00
Andrew Kelley 309aacfc89 Merge pull request #16284 from Snektron/spirv-internpool-fixes
SPIR-V InternPool aftermath damage control
2023-07-01 14:21:04 -07:00
Robin Voetter 073289d0da spirv: disable new behavior tests that do not pass
Some new behavior tests have recently been added, and not all of these
pass with the SPIR-V backend.
2023-07-01 19:45:09 +02:00
Jacob Young f571438fc0 Unrevert "Sema: preserve extern struct field alignment"
This unreverts commit 1a2468abfc.
2023-06-30 23:24:52 -04:00
Jacob Young 2282c27885 Remerge pull request #15995 from mlugg/fix/union-field-ptr-align
Sema: copy pointer alignment to union field pointers

This is an unrevert of 43c98dc115.
2023-06-30 23:23:26 -04:00
mlugg 730f2e0407 Sema: copy pointer alignment to struct field pointers 2023-06-30 23:23:03 -04:00
mlugg 5b594139d9 Sema: copy pointer alignment to union field pointers
This implements the semantics as discussed in today's compiler meeting,
where the alignment of pointers to fields of default-layout unions
cannot exceed the field's alignment.

Resolves: #15878
2023-06-30 23:23:01 -04:00
Jacob Young 43c98dc115 Revert "Merge pull request #15995 from mlugg/fix/union-field-ptr-align"
This reverts commit 40cf3f7ae5, reversing
changes made to d98147414d.
2023-06-29 00:23:19 -04:00
Jacob Young 1a2468abfc Revert "Sema: preserve extern struct field alignment"
This reverts commit 4620972d08.
2023-06-29 00:23:19 -04:00
Alex Kladov 4620972d08 Sema: preserve extern struct field alignment
In

    extern struct { x: u32, y: u16 }

we actually know that y's alignment is `@alignOf(u32)`, and not just
`@alignOf(u16)`.

closes: #16134
2023-06-28 16:36:32 +02:00
zooster 28f515acd7 behavior: test slicing array of zero-sized values
Closes #15343
2023-06-28 14:00:18 +03:00
r00ster91 adf0718316 behavior: boolean vector with 2 or more elements
Closes #12169
2023-06-27 19:57:23 -04:00
r00ster91 2cc9c99ebf behavior: if-@as-if chain
Closes #8952
2023-06-27 19:57:23 -04:00
r00ster91 413a86f7eb behavior: correct alignment for elements and slices of aligned array
Closes #11751
2023-06-27 19:57:23 -04:00
Jacob Young 9343c31c38 Sema: fix @min/@max type resolution with all runtime args
Closes #16229
2023-06-26 18:46:25 -07:00
mlugg 88284c124a AstGen: fix result locations for elements of typed array init
Resolves: #16226
2023-06-26 16:20:33 -07:00
Jacob Young c036f83fa0 Value: fix incorrect types returned from readFromMemory 2023-06-26 01:30:00 -07:00
jacobly0 cc2daae47e Merge pull request #15771 from jacobly0/x86_64-behavior
x86_64: behavior
2023-06-26 02:45:48 -04:00
Andrew Kelley 40cf3f7ae5 Merge pull request #15995 from mlugg/fix/union-field-ptr-align
Sema: copy pointer alignment to union field pointers
2023-06-25 23:06:53 -07:00
Jacob Young 7013567f8a x86_64: disable failing behavior test 2023-06-25 19:14:03 -04:00
Jacob Young b4b1ad475b x86_64: truncate packed field value 2023-06-25 19:14:03 -04:00
Jacob Young 3f13987a76 x86_64: add missing padding to global unions 2023-06-25 19:14:03 -04:00
Jacob Young 5b74278510 x86_64: fix global pointers to packed struct fields 2023-06-25 19:14:03 -04:00
Jacob Young 614c807702 x86_64: fix packed store crash 2023-06-25 19:14:03 -04:00
Eric Joldasov 0a868dacdd std.cstr: deprecate namespace
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-06-25 14:51:03 -07:00
mlugg 80e493cb36 Sema: copy pointer alignment to struct field pointers 2023-06-25 14:13:52 +01:00
mlugg 2611d97fb0 Sema: copy pointer alignment to union field pointers
This implements the semantics as discussed in today's compiler meeting,
where the alignment of pointers to fields of default-layout unions
cannot exceed the field's alignment.

Resolves: #15878
2023-06-25 14:05:18 +01:00
mlugg fec7565da6 behavior: add tests for cast builtins coercing to optional and error union 2023-06-25 13:28:32 +01:00
Andrew Kelley a31ba25a3d Merge pull request #16188 from kcbanner/fix_cbe_airErrUnionPayloadPtrSet
cbe: fix crash caused by calling `mod.intValue` on `type_inferred_error_set`
2023-06-24 21:53:59 -07:00
mlugg f26dda2117 all: migrate code to new cast builtin syntax
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
2023-06-24 16:56:39 -07:00
kcbanner baa2b62e88 cbe: fix crash caused by calling mod.intValue on type_inferred_error_set 2023-06-24 13:49:24 -04:00
kcbanner 5fc5e4fbe0 sema: Fix overflow when analyzing an inline switch prong range that ends on the maximum value of the switched type 2023-06-23 18:28:33 -07:00
Jacob Young c60896743d Value: handle more legacy tags when writing extern struct to memory
Closes #16130
2023-06-22 08:07:02 -07:00
Jacob Young a257e33fff Type: remove arbitrary restrictions on param and return types
Opaque and `noreturn` makes sense since they don't represent real
values, but `null` and `undefined` are perfectly normal
comptime-only values.

Closes #16088
2023-06-20 21:51:01 -07:00
Jacob Young 8875efe548 Sema: fix auto-numbered enums with signed tag types
Closes #16095
2023-06-20 20:09:28 -07:00
IntegratedQuantum 3267eb3a28 Fix @enumToInt and @tagName for auto-numbered enums with signed tag type. 2023-06-20 20:09:28 -07:00
Evan Haas fb9d6b8bd9 codegen: Set c_char signedness based on the target 2023-06-20 00:26:42 -07:00
Andrew Kelley a72d634b73 Merge pull request #16046 from BratishkaErik/issue-6128
Renaming `@xtoy` to `@YfromX`
2023-06-19 22:36:24 -07:00
Jacob Young 8fcc28d302 Module: add support for multiple global asm blocks per decl
Closes #16076
2023-06-19 13:12:04 -07:00
Eric Joldasov 50339f595a all: zig fmt and rename "@XToY" to "@YFromX"
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-06-19 12:34:42 -07:00
Andrew Kelley a10ddba921 Merge pull request #16064 from Luukdegram/wasm-linker
wasm/linker: symbol resolution improvements
2023-06-16 22:03:35 -07:00
mlugg c4cc796695 Sema: consider type bounds when refining result type of @min/@max
I achieved this through a major refactor of the logic of analyzeMinMax.
This change should be compatible with vectors of comptime_int, which
Andrew said are supposed to work (but which currently do not).
2023-06-16 13:33:31 -07:00
Luuk de Gram 44b322ce64 wasm-linker: correctly resolve undefined functions
We now resolve undefined symbols during incremental-compilation
where we discard the current symbol if we detect we found
an existing symbol which is not the one currently being updated.
The symbol will always be discarded in favor of the existing symbol
in such a case.
2023-06-16 17:16:56 +02:00
Luuk de Gram 1cfad29f10 codegen: fix union padding
This regressed during the internpool merges. This commit
reinstates the padding logic for unions.
2023-06-16 17:16:56 +02:00
Andrew Kelley f5043ad6a3 Merge pull request #16042 from mlugg/fix/slice-len-comptime-mutation
Fix comptime mutation of slice len
2023-06-15 09:49:59 -07:00
mlugg 11d0dfb882 Sema: fix @intToPtr of zero value to optional pointer
Calling into coercion logic here is a little opaque, and more to the
point wholly unnecessary. Instead, the (very short) logic is now
implemented directly in Sema.

Resolves: #16033
2023-06-15 02:43:06 -07:00
mlugg ce88c43a4e Sema: allow indexing tuple and vector pointers
Resolves: #13852
Resolves: #14705
2023-06-14 22:07:25 -07:00