Andrew Kelley
a193ec432d
Merge pull request #14058 from jacobly0/concat
2022-12-24 13:55:42 -05:00
Jacob Young
6f288051c1
behavior: disable tests on failing backends
2022-12-24 02:54:21 -05:00
Jacob Young
6cd8004213
Sema: relax undefined checks for concat
...
Closes #14037
2022-12-24 02:40:33 -05:00
Jacob Young
0559cdb554
Sema: support concat of tuple and array
...
Closes #14041
2022-12-24 02:40:33 -05:00
Jacob Young
fc0789f8e7
behavior: disable tests that trigger an llvm 15 bug and assertion
...
```
LLVM Emit Object... zig: llvm/include/llvm/ADT/APInt.h:840: void llvm::APInt::lshrInPlace(unsigned int): Assertion `ShiftAmt <= BitWidth && "Invalid shift amount"' failed.
Aborted
```
Tracked by #13782
2022-12-24 02:23:05 -05: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
Jacob Young
a52dcdd3c5
CBE: fix bitwise not
...
Closes #13911
2022-12-21 03:04:59 -05:00
Veikka Tuominen
e1345fd0a0
Merge pull request #14004 from Vexu/packed-struct-vector
...
llvm: handle vectors in packed structs
2022-12-20 23:13:36 +02:00
Veikka Tuominen
6da070c5ac
Sema: fix crash with generic function with generic function parameter
...
Closes #12810
2022-12-20 17:32:04 +02:00
Andrew Kelley
0fb53bd245
Merge pull request #14000 from jacobly0/zero-bit-fields
...
codegen: fix taking the address of a field in a zero-bit struct
2022-12-19 15:47:31 -05:00
Veikka Tuominen
6511afcfe0
Sema: fix coercion from [:0]T to [*c]T
2022-12-19 20:45:53 +02:00
Veikka Tuominen
22d46e1d77
value: use int tag type when querying for tag value
...
Closes #13757
2022-12-19 15:08:49 +02:00
Jacob Young
0768115b01
behavior: disable failing test
...
Also add an assert to catch this issue earlier. For future reference,
the decl without a type and value is the string literal "GET".
2022-12-19 05:59:45 -05:00
Veikka Tuominen
2926d95e6a
llvm: handle vectors in packed structs
...
Closes #13201
2022-12-19 12:19:52 +02:00
Jacob Young
0e3feebb04
codegen: fix taking the address of a zero-bit field in a zero-bit struct
...
Normally when we want a pointer to the end of a struct we just add 1 to
the struct pointer. However, when it is a zero-bit struct, the pointer
type being used during lowering is often a dummy pointer type that
actually points to a non-zero-bit type, so we actually want to add 0
instead, since a zero-bit struct begins and ends at the same address.
2022-12-18 22:11:26 -05:00
Jacob Young
e96f65db77
llvm: fix lowering pointer to final zero-width field of a comptime value
...
* Handle a `null` return from `llvmFieldIndex`.
* Add a behavior test to test this code path.
* Reword this test name, which incorrectly described how pointers to
zero-bit fields behave, and instead describe the actual test.
2022-12-18 22:11:26 -05:00
Andrew Kelley
6018a3ad39
add behavior test for empty error set inference
...
closes #1386
closes #7541
2022-12-18 18:37:12 -07:00
Andrew Kelley
09ee887e9f
add behavior test for comptime pointer casting
...
closes #1150
closes #1292
closes #4093
2022-12-18 18:37:12 -07:00
Andrew Kelley
aca9c74e80
Merge pull request #13914 from Vexu/variadic
...
implement defining C variadic functions
2022-12-18 16:24:13 -05:00
Andrew Kelley
6ed0910d6d
Revert "llvm: fix lowering pointer to final zero-width field of a comptime value"
...
This reverts commit e0bc5f65b98d154b4318027d56f780b55605e33c.
Caused an assertion failure when running the behavior tests:
```
zig: llvm/lib/IR/Type.cpp:729: static llvm::PointerType* llvm::PointerType::get(llvm::Type*, unsigned int): Assertion `isValidElementType(EltTy) && "Invalid type for pointer element!"' failed.
Aborted (core dumped)
```
2022-12-18 13:51:15 -07:00
Veikka Tuominen
40ed6ae846
Merge pull request #13930 from r00ster91/renamings
...
std.builtin: renamings
2022-12-18 19:33:15 +02:00
r00ster91
ceff03f3e9
std.builtin: remove layout field from Type.Enum
2022-12-18 13:31:38 +01:00
Jacob Young
e0bc5f65b9
llvm: fix lowering pointer to final zero-width field of a comptime value
...
* Handle a `null` return from `llvmFieldIndex`.
* Add a behavior test to test this code path.
* Reword this test name, which incorrectly described how pointers to
zero-bit fields behave, and instead describe the actual test.
2022-12-18 02:17:11 -05: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
r00ster91
aac2d6b56f
std.builtin: rename Type.UnionField and Type.StructField's field_type to type
2022-12-17 14:11:33 +01:00
r00ster91
7350ea3e2d
std.builtin: rename Type.Fn's args to params
...
This was a poor naming choice; these are parameters, not arguments.
Parameters specify what kind of arguments are expected, whereas the arguments are the actual values passed.
2022-12-17 14:11:33 +01:00
r00ster91
20d3fd901e
std.builtin: rename Type.Fn.Param's arg_type to type
...
It's the type of a parameter, not an argument, but the prefix is redundant either way.
2022-12-17 14:11:33 +01:00
Veikka Tuominen
9bb1104e37
implement defining C variadic functions
2022-12-17 13:22:09 +02:00
Veikka Tuominen
728dd29f1a
Type: fix incorrect usage of hasRuntimeBits
...
Closes #13962
2022-12-17 13:22:09 +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
Veikka Tuominen
8a0a6b7387
port packed vector elem ptr logic from stage1
...
Closes #12812
Closes #13925
2022-12-15 21:06:35 -05:00
Stevie Hryciw
e57e835904
Sema: elide integer comparisons with guaranteed outcomes
2022-12-15 00:56:27 -08:00
Veikka Tuominen
e6588857df
Sema: fix memory management of union enum tag int tag
...
This likely went unnoticed due to all power of two integer types being special cased.
Closes #13812
2022-12-14 14:08:21 +02:00
IntegratedQuantum
0b4461d97b
Fix tautological big_int tests.
2022-12-14 00:29:25 +00:00
Andrew Kelley
6378644d4e
Merge pull request #13907 from Vexu/call-merge
...
Remove `stack` option from `@call`
2022-12-13 18:15:18 -05:00
Andrew Kelley
2e66b3be6e
Merge pull request #13910 from Luukdegram/wasm-simd
2022-12-13 14:11:22 -05:00
Meghan
3318611618
re-enable "signed zeros are represented properly" beahvior tests for f80 and c_longdouble
2022-12-13 13:33:16 +02:00
Veikka Tuominen
08b2d491bc
update usages of @call
2022-12-13 13:14:20 +02:00
Luuk de Gram
37561a920b
wasm: enable passing vector tests
2022-12-12 17:42:09 +01:00
Andrew Kelley
74718a1183
disable failing CBE behavior tests failing on aarch64-windows
...
Also start to move redundant tests next to each other to make them
slightly more obvious that they need to be cleaned up.
See tracking issue #13876
2022-12-10 16:28:49 -07:00
Andrew Kelley
cffbb32d31
Merge pull request #13872 from koachan/sparc64-codegen
...
stage2: sparc64: Some Air lowerings + skip unbuildable tests
2022-12-10 15:10:21 -05:00
Koakuma
f9e9ba784f
stage2: sparc64: Skip unimplemented tests
2022-12-10 21:51:46 +07:00
Koakuma
fb9357f06c
stage2: sparc64: Implement atomic ops
2022-12-10 21:11:14 +07: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