7480 Commits

Author SHA1 Message Date
mlugg
4650e5b9fc
Sema: clean up cmpNumeric
There is one minor language change here, which is that comparisons of
the form `comptime_inf < runtime_f32` have their results comptime-known.
This is consistent with comparisons against comptime NaN for instance,
which are always comptime known. A corresponding behavior test is added.

This fixes a bug with int comparison elision which my previous commit
somehow triggered. `Sema.compareIntsOnlyPossibleResult` is much cleaner
now!
2024-09-17 11:00:38 +01:00
mlugg
a5c922179f
Sema: return undefined on comparison of runtime value against undefined
Resolves: #10703
Resolves: #17798
2024-09-16 17:11:47 +01:00
mlugg
1365be5d02
compiler: provide correct result types to += and -=
Resolves: #21341
2024-09-16 16:42:42 +01:00
mlugg
258236ec1b Sema: don't emit instruction when casting @min/@max result to OPV type
Resolves: #21408
2024-09-15 17:52:35 +01:00
mlugg
19924ca289 Sema: give try operand error{} result type in non-errorable functions
Resolves: #21414
2024-09-15 16:51:26 +01:00
David Rubin
bc161430b0 riscv: implement optional_payload_ptr_set 2024-09-12 20:29:10 -04:00
xdBronch
0329b8387c make decl literals work with single item pointers 2024-09-12 20:29:10 -04:00
mlugg
55250a9370 Sema: perform requested coercion when decl literal demoted to enum literal
Resolves: #21392
2024-09-12 23:46:00 +01:00
mlugg
03c363300f AstGen: do not allow unlabeled break to exit a labeled switch
`break`ing from something which isn't a loop should always be opt-in.
This was a bug in #21257.
2024-09-12 22:52:23 +01:00
Matthew Lugg
0001f91e4e
Merge pull request #21287 from linusg/deprecated-default-init
Replace deprecated default initializations with decl literals
2024-09-12 19:50:38 +01:00
Linus Groh
8588964972 Replace deprecated default initializations with decl literals 2024-09-12 16:01:23 +01:00
Alex Rønne Petersen
5cb9668632 test: Re-enable a bunch of behavior tests with LLVM.
Closes #10627.
Closes #12013.
Closes #18034.
2024-09-12 07:28:37 +02:00
Andrew Kelley
4fba7336a9
Merge pull request #21269 from alexrp/soft-float
Fix soft float support, split musl triples by float ABI, and enable CI
2024-09-11 17:41:55 -07:00
Jacob Young
6aa6d088d9 Dwarf: implement and test hash maps 2024-09-10 13:06:08 -04:00
Jacob Young
d5a7fcfc13 Dwarf: implement and test multi array list slices 2024-09-10 13:06:08 -04:00
Jacob Young
e048e78886 Dwarf: implement and test multi array list 2024-09-10 12:27:57 -04:00
Jacob Young
6459212ebe Dwarf: implement and test segmented list 2024-09-10 12:27:57 -04:00
Jacob Young
f34b198251 Dwarf: implement and test decls 2024-09-10 12:27:56 -04:00
Alex Rønne Petersen
75983c692f
test: Switch all arm-linux-* triples for module tests from v8a to v7a.
Broadly speaking, versions 6, 7, and 8 are the ones that are in common use. Of
these, v7 is what you'll typically see for 32-bit Arm today. So let's actually
make sure that that's what we're testing.
2024-09-10 08:53:30 +02:00
Alex Rønne Petersen
a872b61021
test: Add arm, mips, and powerpc soft float targets to module tests.
Prefer `eabi` and `eabihf` over the ambiguous `none` when not using libc.
2024-09-10 08:53:30 +02:00
Alex Rønne Petersen
26119bd98d
test: Skip some floating point tests that fail on arm-linux-(gnu,musl)eabi.
https://github.com/ziglang/zig/issues/21234
2024-09-10 08:53:30 +02:00
Alex Rønne Petersen
5285f41267
test: Disable store vector with memset on soft float arm.
https://github.com/ziglang/zig/issues/16177
2024-09-10 08:53:30 +02:00
xdBronch
d6d09f4ea7 add error for discarding if/while pointer capture 2024-09-10 01:45:48 +03:00
Maciej 'vesim' Kuliński
fb0028a0d7 mips: fix C ABI compatibility 2024-09-07 23:46:30 -07:00
Alex Rønne Petersen
ccf852c31e
test: Re-enable vector reduce operation for most LLVM targets.
mips64 failure is tracked in #21091.

Closes #7138.
2024-09-07 02:47:57 +02:00
Alex Rønne Petersen
5c128a8990
test: Re-enable vector shift operators for all LLVM targets.
Closes #4951.
2024-09-07 02:47:57 +02:00
Alex Rønne Petersen
17f54e8274
std.zig.target: Split powerpc-linux-musl triple into powerpc-linux-musleabi(hf). 2024-09-06 20:11:47 +02:00
Alex Rønne Petersen
c1a70acc91
std.zig.target: Split mips(el)-linux-musl triples into mips(el)-linux-musleabi(hf).
Closes #21184.
2024-09-06 20:11:47 +02:00
Andrew Kelley
1511a4171f
Merge pull request #21310 from alexrp/ppc64-tests
Force ELFv2 for PPC64 and add `powerpc64-linux-(none,musl)` to CI
2024-09-06 10:48:21 -07:00
Andrew Kelley
3929cac154
Merge pull request #21257 from mlugg/computed-goto-3
compiler: implement labeled switch/continue
2024-09-04 18:31:28 -07:00
Alex Rønne Petersen
ee3efe8007
test: Add powerpc64-linux-(none,musl) triples to module tests. 2024-09-05 01:15:33 +02:00
Alex Rønne Petersen
40ee682517
test: Disable store vector with memset on powerpc64.
This will be re-enabled with LLVM 19.
2024-09-05 01:15:33 +02:00
Alex Rønne Petersen
2a6eecff3e
test: Disable reinterpret packed union for powerpc64 too.
https://github.com/ziglang/zig/issues/21050
2024-09-05 01:15:33 +02:00
Jakub Konka
6ec8b15918 elf: fix emitting static lib when ZigObject is present 2024-09-04 13:34:26 +02:00
Jakub Konka
8c76a61ef5 test/link/elf: test --gc-sections on Zig input with LLVM too 2024-09-04 13:34:26 +02:00
Michael Dusan
7a4d69983a AstGen: update @errorCast to maybe eval to err
Consequently, `AstGen.ret()` now passes the error code to
`.defer_error_code`. Previously, the error union value was passed.

closes #20371
2024-09-03 22:56:23 +01:00
David Rubin
0d295d7635
riscv: implement switch_dispatch & loop_switch_br 2024-09-01 18:31:01 +01:00
Jacob Young
d5b01df3c8
x86_64: implement loop_switch_br and switch_dispatch 2024-09-01 18:31:01 +01:00
mlugg
2b9af9e825
AstGen: error on unused switch label 2024-09-01 18:31:01 +01:00
mlugg
b7a55cd6c3
AstGen: allow breaking from labeled switch
Also, don't use the special switch lowering for errors if the switch
is labeled; this isn't currently supported. Related: #20627.
2024-09-01 18:31:01 +01:00
mlugg
5e12ca9fe3
compiler: implement labeled switch/continue 2024-09-01 18:30:31 +01:00
mlugg
6e3e23a941
compiler: implement decl literals
Resolves: #9938
2024-09-01 17:34:07 +01:00
mlugg
9e683f0f35
compiler: provide result type to operand of try
This is mainly useful in conjunction with Decl Literals (#9938).

Resolves: #19777
2024-09-01 17:34:07 +01:00
David Rubin
fbac7afa0f
riscv: implement errunion_payload_ptr_set 2024-09-01 17:34:06 +01:00
WillLillis
28383d4d98 fix(Sema): patch segfault in finishStructInit 2024-09-01 17:31:00 +03:00
mlugg
c3fb30803f
behavior: avoid field/decl name conflicts 2024-08-29 23:43:52 +01:00
mlugg
605f2a0978
cases: update for new error wording, add coverage for field/decl name conflict 2024-08-29 23:43:52 +01:00
Jacob Young
6a21875ddb
Merge pull request #21230 from jacobly0/stack-trace
Dwarf: fix self-hosted stack traces
2024-08-28 17:39:35 -04:00
Jacob Young
4cc16fd6f7 Dwarf: fix and test inline function bugs 2024-08-28 04:25:08 -04:00
mlugg
0fe3fd01dd
std: update std.builtin.Type fields to follow naming conventions
The compiler actually doesn't need any functional changes for this: Sema
does reification based on the tag indices of `std.builtin.Type` already!
So, no zig1.wasm update is necessary.

This change is necessary to disallow name clashes between fields and
decls on a type, which is a prerequisite of #9938.
2024-08-28 08:39:59 +01:00