Commit graph

7108 commits

Author SHA1 Message Date
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
Jacob Young
8c3f6c72c0 Dwarf: fix and test string format 2024-08-27 02:09:59 -04:00
mlugg
93cb44c805 translate-c: support GCC/Clang pointer subtraction extension
Pointer subtraction on `void *` or function pointers is UB by the C
spec, but is permitted by GCC and Clang as an extension. So, avoid
crashing translate-c in such cases, and follow the extension behavior --
there's nothing else that could really be intended.
2024-08-27 06:43:40 +01:00
mlugg
4c0f021c2e
behavior: import unintentionally excluded file from behavior.zig
And remove the now-invalid test for the return value of `@branchHint`.
2024-08-27 00:44:35 +01:00
mlugg
f47f6d766e
behavior,cases: add @branchHint test coverage 2024-08-27 00:44:35 +01:00
mlugg
6808ce27bd
compiler,lib,test,langref: migrate @setCold to @branchHint 2024-08-27 00:44:35 +01:00
mlugg
a3a737e9a6
lib,test,tools,doc: update usages of @export 2024-08-27 00:44:35 +01:00
Andrew Kelley
849c31a6cc
Merge pull request #21177 from alexrp/elf-coff-conv
`std.{coff,elf}`: Remove the `{MachineType,EM}.toTargetCpuArch()` functions.
2024-08-25 14:49:53 -07:00
mlugg
7d54c62c8a incremental: fix adding/removing aggregate fields
I don't recall why I put these checks here -- they aren't correct. We
can freely recreate a type even if its fields have changed, because we
are going to re-do all type resolution.

The only conditions for recreations are (a) the ZIR index must not be
lost and (b) the number of captures must be the same. These conditions
are permissible because if either is violated, we can guarantee that
analysis of a valid `zirStructDecl` (etc) will never reference this
type (since the ZIR index has just been tracked, and the captures have
just been created based on the ZIR).

Adds a corresponding test case.

Resolves: #21185
2024-08-24 20:30:52 +01:00
Alex Rønne Petersen
a69f55a7cc
std.{coff,elf}: Remove the {MachineType,EM}.toTargetCpuArch() functions.
These are fundamentally incapable of producing accurate information for reasons
I've laid out in #20771. Since our only use of these functions is to check that
object files have the correct machine type, and since #21020 made
`std.Target.to{Coff,Elf}Machine()` more accurate, just switch these checks over
to that and compare the machine type tags instead.

Closes #20771.
2024-08-23 19:56:24 +02:00
Jacob Young
c6286eee4b
Merge pull request #21170 from jacobly0/more-dwarf-cleanup
Dwarf: more cleanup
2024-08-22 23:20:53 -04:00
Andrew Kelley
ee84deda98
Merge pull request #21095 from alexrp/mips64-tests
Get `mips64(el)-linux` working and start testing it
2024-08-22 20:09:08 -07:00
Jacob Young
4a132d4bce Type: fix inconsistency between zig fmt and @typeName 2024-08-22 20:08:04 -04:00
Jakub Konka
fa79f53f92 test/macho: simplify testing range extension thunks 2024-08-22 00:36:47 +02:00
Jakub Konka
ca417e1e32 link/elf: simplify how we test thunks 2024-08-21 23:05:28 +02:00
Jakub Konka
b2fad5c58b test/debugger: test emitting relocs by ELF linker 2024-08-21 01:43:21 -04:00
mlugg
a99ad52b36
Sema: register correct dependencies for inline calls
And add a corresponding test case.
2024-08-21 01:30:46 +01:00
mlugg
2fb78430db
test: remove accidental hard tab 2024-08-21 01:30:46 +01:00
mlugg
ceb76b2ba7
test: add incremental compilation test for moving @src() call 2024-08-21 01:30:46 +01:00
Jacob Young
eaa227449c Dwarf: fix issues with inline call sites 2024-08-20 15:08:23 -04:00
Robin Voetter
80999391d9
re-enable emit_asm_and_bin and emit_llvm_no_bin tests
These were fixed during the last few commits too. The emit_llvm_no_bin test
is renamed from the issue_12588 test.

Closes #17484
2024-08-19 19:09:13 +02:00
Robin Voetter
294ca6563e
add standalone test for only dependending on the emitted assembly and not the bin 2024-08-19 19:09:13 +02:00
Matthew Lugg
54e48f7b7d
Merge pull request #21128 from mlugg/incremental
incremental: more progress
2024-08-19 06:30:54 +01:00