Commit graph

490 commits

Author SHA1 Message Date
Ali Cheraghi
1df79ab895 remove spirv cpu arch 2025-06-23 06:03:03 +02:00
Jacob Young
1f98c98fff x86_64: increase passing test coverage on windows
Now that codegen has no references to linker state this is much easier.

Closes #24153
2025-06-19 18:41:12 -04:00
Jacob Young
917640810e Target: pass and use locals by pointer instead of by value
This struct is larger than 256 bytes and code that copies it
consistently shows up in profiles of the compiler.
2025-06-19 11:45:06 -04:00
Jacob Young
df4068cabd Build: change how the target is printed in step names
e.g. `x86_64-windows.win10...win11_dt-gnu` -> `x86_64-windows-gnu`

When the OS version is the default this is redundant with checking the
default in the standard library.
2025-06-19 11:45:06 -04:00
Andrew Kelley
5a52da1b7a CI: skip llvm backend tests in the script for testing x86 backend 2025-06-06 23:42:15 -07:00
Andrew Kelley
125a9aa82b restore debug llvm CI coverage
and reduce redundant coverage in slow runs to save time
2025-06-06 23:42:15 -07:00
Jacob Young
0bf8617d96 x86_64: add support for pie executables 2025-06-06 23:42:14 -07:00
Jacob Young
5986bdf868 Compilation: enable the x86_64 backend by default for debug builds
Closes #22257
2025-06-06 23:42:14 -07:00
Alex Rønne Petersen
98cf81d51c test: Expand target coverage for C ABI tests. 2025-06-05 21:50:56 +02:00
Alex Rønne Petersen
aeebb131c8
test: Add NetBSD targets to module test matrix. 2025-05-29 16:48:28 +02:00
Alex Rønne Petersen
c9ee69712a
test: Add FreeBSD targets to module test matrix.
std tests are temporarily disabled for arm-freebsd-eabihf due to #23949.

I omitted x86-freebsd-none and powerpc-freebsd-none because these will be
dropped in FreeBSD 15.0 anyway, so there's no point in us spending resources on
those now.
2025-05-29 16:48:28 +02:00
Alex Rønne Petersen
3d2b0a53fe
test: Improve Windows module test coverage.
There's not really any point in targeting *-windows-(gnu,msvc) when not linking
libc, so add entries for *-windows-(gnu,msvc) that actually link libc, and
change the old non-libc entries to *-windows-none.

Also add missing aarch64-windows-(none,msvc) and thumb-windows-(none,msvc)
entries. thumb-windows-gnu is disabled for now due to #24016.
2025-05-29 16:47:54 +02:00
Alex Rønne Petersen
7cae6b8fa7
test: Skip *-windows-msvc + libc module tests on non-Windows.
We can't provide MSVC libc when cross-compiling (yet?).
2025-05-29 15:35:30 +02:00
Alex Rønne Petersen
c8ea81bf96
test: Sort module test and C ABI test target tables.
I removed the commented-out entries for backends that are bitrotted. Can add
these back later when we reboot those backends.
2025-05-29 15:01:45 +02:00
Robin Voetter
dc6ffc28b5
Merge pull request #23815 from alichraghi/master
spirv: unroll all vector operations
2025-05-25 12:36:53 +02:00
Ali Cheraghi
dacd70fbe4 spirv: super basic composite int support 2025-05-21 13:01:20 +03:30
Jacob Young
cdba1d591a test-cli: port build options test to new build system API
Since we need testing for passing `--build-file` and `--cache-dir`
together anyway, use it to test the disabled build options test.
2025-05-20 23:02:51 -04:00
Alex Rønne Petersen
b0c10e2262
test: Enable x86-linux-musl with dynamic linkage in the module test matrix.
Building upstream musl for this target works now that we use hidden visibility
for compiler-rt symbols.
2025-05-19 00:22:22 +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
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
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
8f8f37fb0f test: Add powerpc-linux-gnueabi(hf) to the module test matrix.
Skips std tests for now: https://github.com/ziglang/zig/issues/2256
2025-04-17 17:32:33 +02:00
Alex Rønne Petersen
9352f379e8
Merge pull request #23529 from alexrp/2879-groundwork
Introduce libzigc for libc function implementations in Zig
2025-04-12 18:14:17 +02:00
Alex Rønne Petersen
1f896c1bf8
Introduce libzigc for libc function implementations in Zig.
This lays the groundwork for #2879. This library will be built and linked when a
static libc is going to be linked into the compilation. Currently, that means
musl, wasi-libc, and MinGW-w64. As a demonstration, this commit removes the musl
C code for a few string functions and implements them in libzigc. This means
that those libzigc functions are now load-bearing for musl and wasi-libc.

Note that if a function has an implementation in compiler-rt already, libzigc
should not implement it. Instead, as we recently did for memcpy/memmove, we
should delete the libc copy and rely on the compiler-rt implementation.

I repurposed the existing "universal libc" code to do this. That code hadn't
seen development beyond basic string functions in years, and was only usable-ish
on freestanding. I think that if we want to seriously pursue the idea of Zig
providing a freestanding libc, we should do so only after defining clear goals
(and non-goals) for it. See also #22240 for a similar case.
2025-04-11 17:12:31 +02:00
Alex Rønne Petersen
d01f2aa6e7
test: Add hexagon-linux-(none,musl) to the test matrix.
This skips std tests for now: https://github.com/llvm/llvm-project/pull/111217
2025-04-11 02:29:27 +02:00
imreallybadatnames™️
7733b5dbe6
Merge pull request #23501 from imreallybadatnames/master
Step.Compile: use LtoMode enum for lto option
2025-04-09 05:16:36 +00:00
Alex Rønne Petersen
f8439805d7
test: Add loongarch64-linux-(none,musl,gnu) to the test matrix.
Currently skips std tests which have many issues.
2025-04-07 16:03:22 +02:00
Alex Rønne Petersen
7c5412c7a4
build: Rename -Dtest-slow-targets to -Dtest-extra-targets.
This can be used more broadly for targets that aren't quite ready to be tested
by default yet.
2025-04-04 06:08:10 +02:00
Alex Rønne Petersen
b9456d64d7
test: mips32 is no longer a slow target with LLVM 20.
We can now run these tests as part of test-modules w/o -Dtest-slow-targets.

Closes #21096.
2025-04-04 06:08:10 +02:00
Ali Cheraghi
ee06b2ce76 spirv: require int8/int16 capabilities 2025-03-18 07:05:50 +03:30
Pat Tullmann
8e0a4ca4b3 Enable compiler-rt tests for wasm32-wasi
I think the underlying issue was the same as
https://github.com/ziglang/zig/issues/13258 and that has a work-around in
LLVM 19 (see https://github.com/llvm/llvm-project/issues/58557).

Fixes #15325
2025-03-10 06:15:12 +01:00
Andrew Kelley
6b6c1b1b0e Revert "Merge pull request #22898 from kristoff-it/deprecated-proposal"
This reverts commit dea72d15da, reversing
changes made to ab381933c8.

The changeset does not work as advertised and does not have sufficient
test coverage.

Reopens #22822
2025-02-28 01:37:10 -08:00
Andrew Kelley
f74a856d84 reword deprecated error slightly
"found" -> "reached" to match "reached unreachable code"
2025-02-26 14:41:33 -05:00
Andrew Kelley
7c2649f89d langref: fix whitespace 2025-02-26 14:41:33 -05:00
Loris Cro
25790e95f1 @deprecated: remove per-module flag in Build
This implementation looks at the builder of each
module in the build graph instead of storing a
boolean for each module.
2025-02-26 14:41:33 -05:00
Loris Cro
c75fdd96d2 @deprecated: add tests 2025-02-26 14:41:33 -05:00
Ali Cheraghi
181a89e728
build: add spirv to test matrix
Signed-off-by: Ali Cheraghi <alichraghi@proton.me>
2025-02-24 19:12:38 +01:00
Andrew Kelley
1afa6e260e build: respect -Duse-llvm option when doing behavior tests 2025-01-15 15:11:36 -08:00
Alex Rønne Petersen
23281704dc test: Enable long calls for all thumb/thumbeb module tests.
The relocation range issues will happen eventually as we add more code to the
standard library and test suites, so we may as well just deal with this now.
@MasonRemaley ran into this in #20271, for example.
2025-01-07 08:44:45 +01:00
mlugg
b8472db215
tests.zig: migrate from deprecated std.Build APIs 2024-12-18 01:48:57 +05:00
Eric Joldasov
3d393dba6f
std.Build: remove deprecated APIs
These APIs were all deprecated prior to the release of 0.13.0, so can be
safety removed in the current release cycle.

`std.Build`:
* `host` -> `graph.host`

`std.Build.Step.Compile`:
* `setLinkerScriptPath` -> `setLinkerScript`
* `defineCMacro` -> `root_module.addCMacro`
* `linkFrameworkNeeded`-> `root_module.linkFramework`
* `linkFrameworkWeak`-> `root_module.linkFramework`

`std.Build.Step.ObjCopy`:
* `getOutputSource` -> `getOutput`

`std.Build.Step.Options`:
* `addOptionArtifact` -> `addOptionPath`
* `getSource` -> `getOutput`

`std.Build.Step.Run`:
* `extra_file_dependencies` -> `addFileInput`
* `addDirectorySourceArg` -> `addDirectoryArg`
* `addPrefixedDirectorySourceArg` -> `addPrefixedDirectoryArg`
2024-12-18 01:47:50 +05:00
Alex Rønne Petersen
d5c2f527b4
Merge pull request #22219 from alexrp/arm-big-endian
Add `armeb-linux-*`, `thumbeb-linux-*`, and `aarch64_be-linux-*` to CI
2024-12-15 01:41:46 +01:00
Carl Åstholm
b352595aa2 Add compiler internals tests
There are several test decls inside `/src` that are not currently being
tested and have bitrotted as a result. This commit revives those tests
and adds the `test-compiler-internals` set of tests which tests
everything reachable from `/src/main.zig`.
2024-12-13 08:49:02 -05:00
Alex Rønne Petersen
9aa4cf4f88
test: Add aarch64_be-linux-* to the module test matrix. 2024-12-13 03:13:14 +01:00
Alex Rønne Petersen
fdc0ed92ce
test: Add thumbeb-linux-* to the module test matrix. 2024-12-13 03:13:14 +01:00
Alex Rønne Petersen
df27298aef
test: Add armeb-linux-* to the module test matrix. 2024-12-13 03:13:14 +01:00
Alex Rønne Petersen
1731510933
test: Add x86_64-linux-(gnux32,muslx32) to module tests. 2024-12-01 02:23:55 +01:00
Alex Rønne Petersen
2a29381117
test: Enable -Dtest-target-filter=... to work for test-cases and test-translate-c. 2024-11-24 22:11:17 +01:00
Alex Rønne Petersen
9c7776a938
test: Enable -Dtest-target-filter=... to work for test-c-abi. 2024-11-24 22:11:17 +01:00