Jacob Young
8d1805f81c
behavior: add coverage for no longer reproducing issue
...
Closes #14305
2023-07-29 09:00:23 -07:00
Andrew Kelley
87961237cf
add behavior test for tail calls
...
closes #9703
2023-07-26 19:02:02 -07:00
Jacob G-W
3c08fe931a
make @typeInfo not return private decls
...
fixes #10731
Thanks @nektro for previous work in #14878
This change creates a small breaking change:
It removes the `is_pub` field of a decl in `@typeInfo`
2023-07-25 16:19:08 -07:00
Andrew Kelley
ddd27db362
add comment to discourage using GitHub issue numbers
...
in behavior tests.
closes #16506
2023-07-24 10:54:08 -07:00
Evan Haas
fb9d6b8bd9
codegen: Set c_char signedness based on the target
2023-06-20 00:26:42 -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
Luuk de Gram
e3db210cf1
wasm: support calling alias'd function pointers
...
When lowering a decl value we verify whether its owner decl index
equals to the decl index of the decl being lowered. When this is not
the case, we are lowering an alias. So instead, we will now lower
the owner decl instead and call its symbol to ensure its type
is being correctly generated.
2023-06-16 17:16:56 +02:00
Evin Yulo
235b776d61
fix #15778 : Binary operations on empty vectors crash
2023-05-29 13:01:11 +03:00
Ali Chraghi
ccc490ef68
setup spirv backend in behavior tests
2023-05-11 20:31:52 +02:00
Dominic
5a3eca5d4c
Disallow named test decls with duplicate names
2023-05-08 10:59:06 +03:00
Andrew Kelley
73d3fb9883
C backend: fix ptr comparison of array ptrs when one is null-terminated
2023-04-28 13:24:43 -07:00
Andrew Kelley
00b690540e
llvm backend: fix lowering of memset
...
The bitcast of ABI size 1 elements was problematic for some types.
2023-04-28 13:24:42 -07:00
mlugg
71e873703f
Sema: make @returnAddress return 0 at comptime
...
See also #14938 .
Resolves : #14931
2023-03-17 15:55:02 -04:00
Ian Johnson
adc6dec26b
Sema: avoid panic on callconv(.C) generic return type
...
Fixes #14854
2023-03-13 13:17:13 +02:00
Veikka Tuominen
d284c00fda
Sema: handle lazy values in more places
...
* resolve lazy values in anon structs being passed to anytype params
* use `resolveMaybeUndefValIntable` where appropriate
Closes #14356
2023-01-22 00:12:36 +02:00
Michael Dusan
e0fb4c29cb
llvm codegen: fix f16,f32,f64 nan bitcasts
...
@bitCast from integer NaN representation to float NaN resulted in
changed bits in float. This only happened with signaled NaN.
- added test for signaled NaN
- added tests for quiet NaN (for completeness)
closes #14198
2023-01-05 02:22:30 -07:00
Michael Dusan
ed23615638
behavior: add test for #8277
...
Test `@sizeOf` reified union with zero-size payload fields.
closes #8277
2023-01-04 15:48:00 -05:00
Veikka Tuominen
81443fcde8
Sema: add error for recursive inline call
...
Closes #12973
2022-12-26 16:36:30 +02:00
travisstaloch
581d292381
fix overflow found while fuzzing
...
* allow file level `union {}` to parse as tuple field
this was found while fuzzing zls.
* before this patch the input `union {}` crashed the parser. after
this, it parses correctly just like `struct {}`.
* adds behavior tests for both inputs `struct {}` and `union {}`,
checking that each becomes a file level tuple field.
2022-12-23 23:10:04 +02:00
Andrew Kelley
f211c1559a
Merge pull request #13960 from r00ster91/stage1cruft
...
Close more old stage1 issues
2022-12-22 16:36:55 -05:00
r00ster91
5ecc2b99af
behavior: more test coverage
...
Closes #12450
Closes #13113
Closes #12051
Closes #12092
Closes #12119
Closes #12142
Closes #12450
Closes #13113
Closes #11995
Closes #12000
2022-12-21 23:34:22 +01:00
Veikka Tuominen
901c3e9636
Merge pull request #13552 from hryx/comparus-tautologicus
...
Sema: elide integer comparisons with guaranteed outcomes
2022-12-18 01:57:49 +02:00
Evin Yulo
8c8f6bfa64
Add test for #13366
...
Closes #13366
2022-12-16 18:21:56 +02:00
Evin Yulo
b5d1df091b
Add test for #12571
...
Closes #12571
2022-12-16 18:19:32 +02:00
Travis Staloch
1ebb761244
codegen - lower str_lit to vector
2022-12-16 06:08:10 -05:00
Stevie Hryciw
e57e835904
Sema: elide integer comparisons with guaranteed outcomes
2022-12-15 00:56:27 -08:00
IntegratedQuantum
0b4461d97b
Fix tautological big_int tests.
2022-12-14 00:29:25 +00:00
r00ster91
654e30069d
behavior and cases: more test coverage for old issues
...
Closes #2622
Closes #2727
Closes #6047
Closes #6947
Closes #6656
2022-12-10 12:34:42 +01:00
r00ster91
bf863878ac
behavior: add test coverage for slice and array-related issues
...
Closes #10684
Closes #6905
Closes #8646
2022-12-10 12:34:42 +01:00
r00ster91
7a8f7dcb8c
behavior: add test coverage for corrupted slice in release
...
Closes #7325
2022-12-10 12:34:42 +01:00
r00ster91
75f8c04d6d
behavior: add test coverage for slicing zero length array field of struct
...
Closes #11787
2022-12-10 12:33:17 +01:00
Veikka Tuominen
ee9fc54cd0
TypedValue: fix handling of tuples represented as empty_struct_value
2022-12-08 22:21:49 +02:00
Andrew Kelley
1310ef7577
disable failing behavior tests with -ofmt=c -target x86_64-windows
...
and enable CI checks for the C backend on Windows.
2022-12-07 04:01:04 -05:00
Andrew Kelley
c8aba15c22
remove references to stage1 in behavior tests
...
Good riddance.
2022-12-06 19:06:48 -07:00
Veikka Tuominen
0e38cc16d5
Sema: fix comparisons between lazy and runtime values
...
Closes #12498
2022-12-03 00:09:23 +02:00
Veikka Tuominen
f4afeb3ffd
AstGen: fix incorrect handling of source cursor with shift builtins
...
Closes #13714
2022-11-30 17:11:06 +02:00
Veikka Tuominen
6f9c7e33b9
llvm: implement union_init for packed unions
...
Closes #13664
2022-11-29 15:47:02 +02:00
Veikka Tuominen
8eea73fb92
add tests for tuple declarations
2022-11-23 22:16:31 +02:00
Cody Tapscott
b1357091ae
Add test case for #12043
...
This bug is already resolved, just want to make sure we don't lose
the test case. Closes #12043
2022-11-10 12:23:59 -07:00
Cody Tapscott
8f3880074f
stage2: Be more strict about eliding loads
...
This change makes any of the `*_val` instructions check whether it's
safe to elide copies for by-ref types rather than performing this
elision blindly.
AIR instructions fixed:
- .array_elem_val
- .struct_field_val
- .unwrap_errunion_payload
- .try
- .optional_payload
These now all respect value semantics, as expected.
P.S. Thanks to Andrew for the new way to approach this. Many of the
lines here are from his recommended change, which comes with the
significant advantage that loads are now as small as the intervening
memory access allows.
Co-authored by: Andrew Kelley <andrew@ziglang.org>
2022-11-10 12:22:40 -07:00
Cody Tapscott
ff699722da
stage2: Fix comptime array initialization
...
This is a follow-up to 9dc98fba, which made comptime initialization
patterns for union/struct more robust, especially when storing to
comptime-known pointers (and globals).
Resolves #13063 .
2022-11-10 12:22:37 -07:00
Micah Switzer
ea54c9a375
Sema: resolve lazy align in zirReify for union fields
...
Closes #13435
2022-11-04 15:48:08 +02:00
Jacob Young
48a2783969
cbe: implement optional slice representation change
2022-10-29 05:58:41 -04:00
Veikka Tuominen
4ac8ec4c5c
AstGen: fix refing inferred allocs
...
Closes #13285
2022-10-27 01:31:18 +03:00
Veikka Tuominen
78a7bb108a
llvm: handle namespace like packed structs
...
Closes #13159
Closes #13188
2022-10-27 01:31:18 +03:00
Jacob Young
45c667eb21
behavior: fix redefined exports
2022-10-25 05:11:28 -04:00
Veikka Tuominen
9a52abf3b4
Sema: add missing calls to wip_captures.finalize
...
Closes #13171
2022-10-20 20:11:12 +03:00
Veikka Tuominen
4aaff75c81
Sema: resolve tuple default values before hashing
...
Closes #12488
2022-10-19 01:38:19 +03:00
Veikka Tuominen
6582896ee0
Sema: remove unresolved inferred allocs
...
Closes #2557
2022-10-19 01:38:19 +03:00
Veikka Tuominen
4e134f6dcb
Sema: respect inline call semantics
...
If an argument is comptime-known but shouldn't be create an alloc
to store it in to get a runtime-known value.
2022-10-19 01:38:18 +03:00