Commit graph

7598 commits

Author SHA1 Message Date
Matthew Lugg
9064907b34
Merge pull request #23907 from mlugg/ref-trace
compiler: reference trace fixes
2025-05-16 22:42:07 +01:00
Alex Rønne Petersen
9279ff888b test: Silence stderr output from test_obj_link_run. 2025-05-16 15:07:25 +01:00
mlugg
16481c8ef3
cases: update to new "called from here" notes 2025-05-16 13:29:55 +01:00
wooster0
56fad6a195 make error messages prettier
Error messages never contain periods or grave accents.
Get rid of the periods and use apostrophes instead in
probably the only two error messages that had them.
2025-05-15 16:39:15 +01:00
Alex Rønne Petersen
5b606d435d
Merge pull request #21882 from alexrp/compiler-fixes
compiler: Fix some real and theoretical miscompilations with `allowzero` and `volatile`
2025-05-13 10:42:05 +02:00
wooster0
a365971a33 std.meta.intToEnum -> std.enums.fromInt
Also use an optional as the return type instead of an error code.
2025-05-13 07:28:41 +02:00
Alex Rønne Petersen
bc3c50c21e
Merge pull request #23700 from sorairolake/rename-trims
chore(std.mem): Rename `trimLeft` and `trimRight` to `trimStart` and `trimEnd`
2025-05-12 17:11:52 +02:00
Alex Rønne Petersen
9d8adb38a1
std.Build: Make no_builtin a property of Module instead of Step.Compile.
This reflects how the compiler actually treats it.

Closes #23424.
2025-05-12 17:08:22 +02:00
Alex Rønne Petersen
74f55175d5
test: Add some basic LLVM IR tests for atomics, volatile, and allowzero. 2025-05-12 17:07:50 +02:00
Alex Rønne Petersen
e63e3f7a7c
test: Add test-llvm-ir step and harness for testing generated LLVM IR. 2025-05-12 17:07:50 +02:00
Alex Rønne Petersen
af55b27d5a
test: Fix incorrect interpretation of -Dtest-filter=... for test-debugger. 2025-05-12 17:07:50 +02:00
Alex Rønne Petersen
833d4c9ce4
Merge pull request #23835 from alexrp/freebsd-libc
Support dynamically-linked FreeBSD libc when cross-compiling
2025-05-12 01:19:23 +02:00
Alex Rønne Petersen
c3906718b3
Merge pull request #23810 from alexrp/more-test-targets 2025-05-11 20:52:47 +02:00
Alex Rønne Petersen
6282129218
test: Add {powerpc64,riscv32}-netbsd-none to llvm_targets. 2025-05-11 11:15:23 +02:00
Alex Rønne Petersen
68cd00497f
update_freebsd_libc: Add tool for updating FreeBSD libc startup code. 2025-05-10 12:19:26 +02:00
Alex Rønne Petersen
ba9f2571b7
test: Remove some nonsensical FreeBSD targets from llvm_targets. 2025-05-10 12:19:26 +02:00
Alex Rønne Petersen
c3734450bc
test: Add MIPS N32 targets to the module test matrix. 2025-05-08 21:32:22 +02:00
Alex Rønne Petersen
473f36d70f
test: Add dynamic musl targets to the module test matrix.
Most of these are gated by -Dtest-extra-targets because:

* We don't really have CI resources to spare at the moment.
* They're relatively niche if you're not on a musl distro.
    * And the few musl distros that exist don't support all these targets.
* Quite a few of them are broken and need investigating.

x86_64-linux-musl and aarch64-linux-musl are not gated as they're the most
common targets that people will be running dynamic musl on, so we'll want to
have some bare minimum coverage of those.
2025-05-08 21:32:22 +02:00
Alex Rønne Petersen
b3f52ae339
test: Disable arrays and vectors with big integers on MIPS N32.
https://github.com/ziglang/zig/issues/23805
2025-05-08 21:32:22 +02:00
xdBronch
10bf6964ed translate-c: fix callconv attribute in macro 2025-05-07 16:15:51 +03:00
Alex Rønne Petersen
f0feda820e
Merge pull request #23727 from tjog/add-libfuzz-standalone-test
add standalone test for libfuzzer initialization
2025-05-05 07:23:18 +02:00
Matthew Lugg
f4e9846bca
Merge pull request #23263 from mlugg/comptime-field-ptr
Sema: fix pointers to comptime fields of comptime-known aggregate pointers
2025-05-03 20:10:42 +01:00
mlugg
f83fe2714b compiler: fix comptime memory store bugs
* When storing a zero-bit type, we should short-circuit almost
  immediately. Zero-bit stores do not need to do any work.
* The bit size computation for arrays is incorrect; the `abiSize` will
  already be appropriately aligned, but the logic to do so here
  incorrectly assumes that zero-bit types have an alignment of 0. They
  don't; their alignment is 1.

Resolves: #21202
Resolves: #21508
Resolves: #23307
2025-05-03 20:10:26 +01:00
tjog
3ed159964a
libfuzzer: add standalone test for libfuzzer initialization 2025-05-03 17:15:59 +02:00
Alex Rønne Petersen
bf9b15ee67 std.Target: Add Cpu.Arch.or1k and basic target info. 2025-05-03 11:22:27 +02:00
Pavel Verigo
a843be44a0 wasm-c-abi: llvm fix struct handling + reorganize
I changed to `wasm/abi.zig`, this design is certainly better than the previous one. Still there is some conflict of interest between llvm and self-hosted backend, better design will appear when abi tests will be tested with self-hosted.

Resolves: #23304
Resolves: #23305
2025-05-01 18:10:36 -04:00
Pat Tullmann
120c4789c3 sigset_t: sigemptyset() and sigfillset() are functions that return sigset_t
By returning an initialized sigset (instead of taking the set as an output
parameter), these functions can be used to directly initialize the `mask`
parameter of a `Sigaction` instance.
2025-04-30 20:32:04 -07:00
Pat Tullmann
f0aefa625b posix: remove empty_sigset
When linking a libc, Zig should defer to the C library for sigset
operations.  The pre-filled constants signal sets (empty_sigset,
filled_sigset) are not compatible with C library initialization, so remove
them and use the runtime `sigemptyset` and `sigfillset` methods to
initialize any sigset.
2025-04-30 20:32:04 -07:00
Robin Voetter
cc381d56a6
Merge pull request #23654 from alichraghi/continue
Compilation: don't build compiler_rt or ubsan_rt for amdgcn and ptx
2025-04-30 20:46:12 +02:00
Alex Rønne Petersen
399da543e5
Merge pull request #23720 from alexrp/sparc-stuff 2025-04-29 00:34:01 +02:00
Andrew Kelley
8facd99d41
Merge pull request #23708 from ziglang/memmove-followups
`@memmove` followups
2025-04-28 15:06:18 -04:00
mlugg
d038676a1f Sema: fix a few indexing bugs
* Indexing zero-bit types should not produce AIR indexing instructions
* Getting a runtime-known element pointer from a many-pointer should
  check that the many-pointer is not comptime-only

Resolves: #23405
2025-04-28 19:43:58 +01:00
dweiller
365ed0ed68 sema: do checked cast when resolving aggregate size 2025-04-28 16:48:45 +01:00
Alex Rønne Petersen
12f56b8740
test: Disable vector reduce operation for sparc.
https://github.com/ziglang/zig/issues/23719
2025-04-28 12:05:19 +02:00
Alex Rønne Petersen
fd4fcefe8a
test: Disable some varargs behavior tests on sparc.
https://github.com/ziglang/zig/issues/23718
2025-04-28 12:05:19 +02:00
Ali Cheraghi
9bd8f8ed56 test: skip "struct fields get automatically reordered" for spirv64 backend 2025-04-28 10:49:19 +03:30
Andrew Kelley
7bd3207921 make @memcpy and @memmove share panic handlers 2025-04-27 23:30:00 -07:00
Alex Rønne Petersen
fc55c1b7a1
Merge pull request #23698 from alexrp/goff-xcoff-stubs
`link`: Stub out GOFF/XCOFF linker code based on LLVM
2025-04-28 07:50:37 +02:00
xdBronch
410298271e Sema: fix memcpy with C pointers 2025-04-28 05:09:12 +01:00
Alex Rønne Petersen
78df3c9301
Merge pull request #23663 from alexrp/emit-asm-only 2025-04-28 02:18:45 +02:00
mlugg
95932e98e5
Sema: fix alignment of runtime field pointer of underaligned tuple 2025-04-28 01:14:24 +01:00
mlugg
d4c5396646
Sema: fix pointers to comptime fields of comptime-known aggregate pointers
Resolves: #23190
2025-04-28 01:14:22 +01:00
Alex Rønne Petersen
5ed8bd5c85 Sema: Fix some ptr alignment checks to handle a potential ISA tag bit.
Closes #23570.
2025-04-27 23:54:54 +01:00
Alex Rønne Petersen
e7b46363ae std.Target: Remove Os.Tag.elfiamcu.
The last Intel Quark MCU was released in 2015. Quark was announced to be EOL in
2019, and stopped shipping entirely in 2022.

The OS tag was only meaningful for Intel's weird fork of Linux 3.8.7 with a
special ABI that differs from the regular i386 System V ABI; beyond that, the
CPU itself is just a plain old P54C (i586). We of course keep support for the
CPU itself, just not Intel's Linux fork.
2025-04-28 00:24:09 +02:00
Andrew Kelley
1b76d4c53a
Merge pull request #22605 from dweiller/memmove
add `@memmove` builtin
2025-04-27 14:39:21 -04:00
Alex Rønne Petersen
711e055f18
test: Uncomment a bunch of targets in llvm_targets. 2025-04-27 14:09:32 +02:00
Alex Rønne Petersen
b31b309b53
test: Configure emit_asm/emit_bin correctly for some targets in llvm_targets. 2025-04-27 14:09:05 +02:00
Alex Rønne Petersen
5411358956
test: Allow cases to set emit_asm (defaults to false). 2025-04-27 14:09:05 +02:00
Alex Rønne Petersen
b16c094926
Merge pull request #23691 from alexrp/llvm-targets-updates 2025-04-27 11:50:06 +02:00
Shun Sakai
5fc4448e45 chore(std.mem): Rename trimLeft and trimRight
Rename `trimLeft` to `trimStart`, and `trimRight` to `trimEnd`.
`trimLeft` and `trimRight` functions remain as deprecated aliases for
these new names.
2025-04-27 18:03:59 +09:00