7916 Commits

Author SHA1 Message Date
Alex Rønne Petersen
17f9a25924
test: remove -Dskip-translate-c from test-standalone
No longer necessary since we've stopped using Clang for this.
2025-09-26 01:33:26 +02:00
Andrew Kelley
2a88a6a456
Merge pull request #24497 from ziglang/aro-translate-c
compiler: update aro and translate-c to latest; delete clang translate-c
2025-09-25 14:18:49 -07:00
Alex Rønne Petersen
dd4be26f53 libc-test: disable daemon-failure.c
It's flaky in that systems with a high FD limit will get an unexpected ENOMEM
error from daemon(), failing the test.
2025-09-25 12:57:56 +02:00
Jacob Young
6257f4abb7 x86_64: improve support for large enums
Closes #25247
2025-09-24 21:20:27 -07:00
Andrew Kelley
01132e0cf8 remove behavior test that depended on std.zig.c_translation
behavior tests may not depend on this namespace.
2025-09-24 20:01:19 -07:00
Andrew Kelley
79d9997d22 delete @cImport tests
These are now maintained in a separate repository: ziglang/translate-c
2025-09-24 20:01:19 -07:00
Andrew Kelley
1bdcdbd996 delete all the translate-c tests
the ziglang/translate-c package has its own test suite, so these are
redundant
2025-09-24 20:01:17 -07:00
rpkak
9b3b7aa911 Integrate libc-test cases into the build system
zig build test-libc -Dlibc-test-path=/path/to/libc-test
2025-09-24 16:05:18 -07:00
Andrew Kelley
ba137783ed
forbid trivial local address returned from functions (#25333)
progress towards #25312
2025-09-23 23:37:53 +00:00
Alex Rønne Petersen
7b92d5f405
std.pie: fix register constraint in getDynamicSymbol() for s390x (#25327)
If the compiler happens to pick `ret = r0`, then this will assemble to
`ag r0, 0` which is obviously not what we want. Using `a` instead of `r` will
ensure that we get an appropriate address register, i.e. `r1` through `r15`.

Re-enable pie_linux for s390x-linux which was disabled in
ed7ff0b693037078f451a7c6c1124611060f4892.
2025-09-22 18:36:47 +02:00
Alex Rønne Petersen
26825e9506
Merge pull request #25324 from alexrp/freebsd
Some changes to prepare for FreeBSD CI
2025-09-22 05:04:31 +02:00
alexrp
b3432c2796
test: disable some stack trace tests on FreeBSD 2025-09-22 01:37:32 +02:00
alexrp
b2d2b441b2
test: disable test-link on FreeBSD
https://github.com/ziglang/zig/issues/25323
2025-09-22 01:37:32 +02:00
alexrp
0700ec35bd
compiler: don't use self-hosted backend on any BSD yet
There are some blocking bugs in the self-hosted ELF linker.
2025-09-22 01:37:32 +02:00
Jacob Young
f58200e3f2 Elf2: create a new linker from scratch
This iteration already has significantly better incremental support.

Closes #24110
2025-09-21 14:09:14 -07:00
Andrew Kelley
633162eb0c add behavior test: comptime C pointer to optional pointer 2025-09-20 18:58:32 -07:00
Andrew Kelley
1c9ac9dbb7 add behavior test: avoid unused field function body compile error 2025-09-20 18:51:43 -07:00
Andrew Kelley
500afbf076 add behavior test: resist alias of explicit copy...
...of array passed as arg

closes #22906
2025-09-20 18:51:26 -07:00
Andrew Kelley
ed7ff0b693 allow some test cases to regress
tracked by #24061 - these should be re-enabled once that is solved.
2025-09-20 18:33:01 -07:00
mlugg
0e16d933be fix rebase error 2025-09-20 18:33:01 -07:00
mlugg
20925f2957 Revert "frontend: another packedStructFieldPtrInfo fix"
This reverts commit dedccecda944f88a5278c12c24ffbea46126de63.
2025-09-20 18:33:01 -07:00
Jacob Young
f81a721e41 standalone: fix misaligned stack crash 2025-09-20 18:33:01 -07:00
Jacob Young
5144f10ec9 aarch64: fix behavior failures 2025-09-20 18:33:01 -07:00
Andrew Kelley
2ba03e98c8 disable failing stage2_aarch64 behavior tests 2025-09-20 18:33:01 -07:00
Andrew Kelley
5d8c1fb6ab frontend: another packedStructFieldPtrInfo fix
it was calculating host integer size in a wrong way. just use integer
abi size
2025-09-20 18:33:01 -07:00
mlugg
baaf715d21 cases: update for new error
The latest bugfix reverted this case to its old behavior (which is a
reasonable behavior to have).
2025-09-20 18:33:01 -07:00
mlugg
fcc7e378f8 Revert "delete failing test case"
This reverts commit ba4d4602ab9bb0dc17fc0d57141d9324bdbb356d.
2025-09-20 18:33:01 -07:00
Andrew Kelley
725dec6aa7 Sema: add missed logic to checkPtrAttributes
It wasn't checking bit pointer data.
2025-09-20 18:33:01 -07:00
Andrew Kelley
7ffe068a79 delete failing test case
Matthew can revert this commit when he's ready to tackle the assertion
failure
2025-09-20 18:33:01 -07:00
Andrew Kelley
0681bf06ab frontend: packed struct field ptr no longer finds byte borders
technically breaking, but I doubt anyone will notice.
2025-09-20 18:33:01 -07:00
Andrew Kelley
e1a750655e disable wasm backend coverage
Disabled due to no active maintainer (feel free to fix the failures and
then re-enable at any time). The failures occur due to backend
miscompilation of different AIR from the frontend.
2025-09-20 18:33:01 -07:00
Andrew Kelley
c369def08e disable spirv64-vulkan coverage
Disabled due to no active maintainer (feel free to fix the failures and
then re-enable at any time). The failures occur due to changing AIR from
the frontend, and backend being incomplete.
2025-09-20 18:33:00 -07:00
Andrew Kelley
aacff8c800 add compile error coverage for dependency loop 2025-09-20 18:33:00 -07:00
Jacob Young
2fdf0e29b3 aarch64: enable fixed behavior 2025-09-20 18:33:00 -07:00
Andrew Kelley
e5adfd87bc translate-c: remove cases associated with runtime vector indexing
C translation is in the process of switching to be aro-based
(see #24497)

That codebase will need to gain some kind of helper for translating C
code that uses runtime vector indexing.
2025-09-20 18:33:00 -07:00
Andrew Kelley
5ec0a7d8a5 coerce vectors to arrays rather than inline for 2025-09-20 18:33:00 -07:00
Andrew Kelley
3bd62e1bb6 Sema: fix source location of "declared here" note
point at the var not at the init expression
2025-09-20 18:33:00 -07:00
Andrew Kelley
426af68b7d compiler: require comptime vector indexes 2025-09-20 18:33:00 -07:00
Andrew Kelley
0e47bd16da add behavior test: return undefined pointer from function
This clarifies that it is legal to return an invalid pointer from a
function, provided that such pointer is not dereferenced.

This matches current status quo of the language. Any change to this
should be a proposal that argues for different semantics.

It is also legal in C to return a pointer to a local. The C backend
lowers such thing directly, so the corresponding warning in C must be
disabled (`-Wno-return-stack-address`).
2025-09-20 17:49:00 -07:00
Andrew Kelley
4d1b15bd9d
Merge pull request #25298 from ziglang/SegmentedList-orphaned-again
std: delete SegmentedList again
2025-09-20 10:29:02 -07:00
Justus Klausecker
be571f32c3 std.Build.Step.Run: Enable passing (generated) file content as args
Adds `addFileContentArg` and `addPrefixedFileContentArg` to pass the content
of a file with a lazy path as an argument to a `std.Build.Step.Run`.
This enables replicating shell `$()` / cmake `execute_process` with `OUTPUT_VARIABLE`
as an input to another `execute_process` in conjuction with `captureStdOut`/`captureStdErr`.

To also be able to replicate `$()` automatically trimming trailing newlines and cmake
`OUTPUT_STRIP_TRAILING_WHITESPACE`, this patch adds an `options` arg to those functions
which allows specifying the desired handling of surrounding whitespace.

The `options` arg also allows to specify a custom `basename` for the output. e.g.
to add a file extension (concrete use case: Zig `@import()` requires files to have a
`.zig`/`.zon` extension to recognize them as valid source files).
2025-09-19 17:38:40 -07:00
Andrew Kelley
1eeb8fabe5 std: delete SegmentedList again
The data structure was originally added in
41e1cd185b82a518c58c92544c45f0348c03ef74 and then removed in
50a336fff899ebd8a687c453ec6beb18a5a9baf9, but brought back in
711bf55eaa643c3d05640bebbf3e4315477b8ed8 for Decl in the compiler
frontend, and then the last reference to it was eliminated in
548a087fafeda5b07d2237d5137906b8d07da699 which removed Decl in favor of
Nav and Cau.
2025-09-19 16:40:00 -07:00
Andrew Kelley
164c598cd8
Merge pull request #23416 from gooncreeper/improved-fuzzer
greatly improve capabilities of the fuzzer
2025-09-19 09:27:25 -07:00
Kendall Condon
e66b269333 greatly improve capabilities of the fuzzer
This PR significantly improves the capabilities of the fuzzer.

The changes made to the fuzzer to accomplish this feat mostly include
tracking memory reads from .rodata to determine fresh inputs, new
mutations (especially the ones that insert const values from .rodata
reads and __sanitizer_conv_const_cmp), and minimizing found inputs.
Additionally, the runs per second has greatly been increased due to
generating smaller inputs and avoiding clearing the 8-bit pc counters.

An additional feature added is that the length of the input file is now
stored and the old input file is rerun upon start.

Other changes made to the fuzzer include more logical initialization,
using one shared file `in` for inputs, creating corpus files with
proper sizes, and using hexadecimal-numbered corpus files for
simplicity.

Furthermore, I added several new fuzz tests to gauge the fuzzer's
efficiency. I also tried to add a test for zstandard decompression,
which it crashed within 60,000 runs (less than a second.)

Bug fixes include:
* Fixed a race conditions when multiple fuzzer processes needed to use
the same coverage file.
* Web interface stats now update even when unique runs is not changing.
* Fixed tokenizer.testPropertiesUpheld to allow stray carriage returns
since they are valid whitespace.
2025-09-18 18:56:10 -04:00
Alex Rønne Petersen
f1c2ae271c
test: disable some SIMD ABI tests on LoongArch 2025-09-18 12:42:24 +02:00
Alex Rønne Petersen
beb25b0430
test: disable some vector ctz/clz behavior tests on LoongArch with LSX
https://github.com/llvm/llvm-project/issues/159529
2025-09-18 12:42:24 +02:00
Alex Rønne Petersen
9095a7fefd
test: respect -Dskip-translate-c in test-standalone 2025-09-18 12:42:24 +02:00
Alex Rønne Petersen
4e9b8aec2c
test: remove unnecessary @cImport usage in some standalone tests 2025-09-18 12:42:24 +02:00
Alex Rønne Petersen
abd73083e4
test: skip dumpCurrentStackTrace test on architectures with no unwind support 2025-09-18 12:42:24 +02:00
Alex Rønne Petersen
e06bcd74c3
test: re-enable test-std for loongarch64-linux 2025-09-18 12:42:24 +02:00