aboutsummaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2024-11-04test: Disable some vector behavior tests on aarch64_be.Alex Rønne Petersen
See: https://github.com/ziglang/zig/issues/21893
2024-11-04test: Remove some unsupported ohos triples from llvm_targets.Alex Rønne Petersen
2024-11-04test: Disable `reinterpret packed union` on all big endian targets.Alex Rønne Petersen
See: https://github.com/ziglang/zig/issues/21050
2024-11-03Merge pull request #21843 from alexrp/callconv-followupAlex Rønne Petersen
Some follow-up work for #21697
2024-11-03Merge pull request #21599 from alexrp/thumb-portingAlex Rønne Petersen
2024-11-03test: Add thumb-linux-(musl)eabi(hf) target triples for module tests.Alex Rønne Petersen
2024-11-03test: Add the ability to skip specific modules for a target.Alex Rønne Petersen
2024-11-03std.Target: Replace isARM() with isArmOrThumb() and rename it to isArm().Alex Rønne Petersen
The old isARM() function was a portability trap. With the name it had, it seemed like the obviously correct function to use, but it didn't include Thumb. In the vast majority of cases where someone wants to ask "is the target Arm?", Thumb *should* be included. There are exactly 3 cases in the codebase where we do actually need to exclude Thumb, although one of those is in Aro and mirrors a check in Clang that is itself likely a bug. These rare cases can just add an extra isThumb() check.
2024-11-02Sema: Disallow calling functions with certain special calling conventions.Alex Rønne Petersen
2024-11-02std.zig.target: Change mips64(el)-linux-musl triples to -muslabi64.Alex Rønne Petersen
With this, MIPS triples for musl are in line with glibc triples.
2024-11-02std.Target: Add muslabin32 and muslabi64 tags to Abi.Alex Rønne Petersen
Once we upgrade to LLVM 20, these should be lowered verbatim rather than to simply musl. Similarly, the special case in llvmMachineAbi() should go away.
2024-11-02Merge pull request #21617 from alexrp/target-dyld-stuffAlex Rønne Petersen
Improve the `DynamicLinker` API and fix `detectAbiAndDynamicLinker()` for non-Linux/Hurd ELF hosts
2024-10-31compiler: remove anonymous struct types, unify all tuplesmlugg
This commit reworks how anonymous struct literals and tuples work. Previously, an untyped anonymous struct literal (e.g. `const x = .{ .a = 123 }`) was given an "anonymous struct type", which is a special kind of struct which coerces using structural equivalence. This mechanism was a holdover from before we used RLS / result types as the primary mechanism of type inference. This commit changes the language so that the type assigned here is a "normal" struct type. It uses a form of equivalence based on the AST node and the type's structure, much like a reified (`@Type`) type. Additionally, tuples have been simplified. The distinction between "simple" and "complex" tuple types is eliminated. All tuples, even those explicitly declared using `struct { ... }` syntax, use structural equivalence, and do not undergo staged type resolution. Tuples are very restricted: they cannot have non-`auto` layouts, cannot have aligned fields, and cannot have default values with the exception of `comptime` fields. Tuples currently do not have optimized layout, but this can be changed in the future. This change simplifies the language, and fixes some problematic coercions through pointers which led to unintuitive behavior. Resolves: #16865
2024-10-29link/Elf: ensure we always sort all relocations by r_offset in -r modeJakub Konka
According to a comment in mold, this is the expected (and desired) condition by the linkers, except for some architectures (RISCV and Loongarch) where this condition does not have to upheld. If you follow the changes in this patch and in particular doc comments I have linked the comment/code in mold that explains and implements this. I have also modified `testEhFrameRelocatable` test to now test both cases such that `zig ld -r a.o b.o -o c.o` and `zig ld -r b.o a.o -o d.o`. In both cases, `c.o` and `d.o` should produce valid object files which was not the case before this patch.
2024-10-29Merge pull request #21826 from Snektron/spirv-vulkanRobin Voetter
spirv: vulkan setup
2024-10-28Sema: add missing coercion to bool for condbr_inlinemlugg
Also, start using labeled switch statements when dispatching maybe-runtime instructions like condbr to comptime-only variants like condbr_inline. This can't be merged until we get a zig1.wasm update due to #21385. Resolves: #21405
2024-10-27fix compile error tests with unstable error setsRobin Voetter
The print order of error sets depends on the order that the compiler adds names to its internal state. These names can be anything, and do not necessarily need to be from the same error set or be errors at all. When the last remaining reference to builtin.cpu.arch was removed in start.zig in 9b42bc1ce5, this order changed. Likely there is something that has the name 'C' that is referenced somewhere recursively from builtin.cpu.arch. This all causes these few tests to fail, and hence the expected order is simply updated now. Perhaps there is a better way to add this.
2024-10-27spirv: forbid merging logical pointersRobin Voetter
Under some architecture/operating system combinations it is forbidden to return a pointer from a merge, as these pointers must point to a location at compile time. This adds a check for those cases when returning a pointer from a block merge.
2024-10-26test: Add some missing android, haiku, illumos, solaris triples to llvm_targets.Alex Rønne Petersen
2024-10-25Merge pull request #21710 from alexrp/function-alignmentAlex Rønne Petersen
Some improvements to the compiler's handling of function alignment
2024-10-24Sema: fix check for whether current AnalUnit is a test functionVeikka Tuominen
Closes #21159
2024-10-23more helpful message when testTlsOffsetAlignment failsAndrew Kelley
2024-10-23use deterministic order in relocatable-eh-frame testsAndrew Kelley
This test does not pass in master branch either if you flip the object order around.
2024-10-23split a fat test caseAndrew Kelley
2024-10-23better error messagesAndrew Kelley
2024-10-23introduce a CLI flag to enable .so scripts; default offAndrew Kelley
The compiler defaults this value to off so that users whose system shared libraries are all ELF files don't have to pay the cost of checking every file to find out if it is a text file instead. When a GNU ld script is encountered, the error message instructs users about the CLI flag that will immediately solve their problem.
2024-10-23move ld script processing to the frontendAndrew Kelley
along with the relevant logic, making the libraries within subject to the same search criteria as all the other libraries. this unfortunately means doing file system access on all .so files when targeting ELF to determine if they are linker scripts, however, I have a plan to address this.
2024-10-23Merge pull request #21758 from kcbanner/dll_storage_classAndrew Kelley
Add `is_dll_import` to @extern, to support `__declspec(dllimport)` with the MSVC ABI
2024-10-23Merge pull request #21697 from mlugg/callconvMatthew Lugg
Replace `std.builtin.CallingConvention` with a tagged union, eliminating `@setAlignStack`
2024-10-22tests: add tests for is_dll_import externskcbanner
- tests/standalone/extern wasn't running its test step - add compile error tests for thread local / dll import @extern in a comptime scope
2024-10-22tests: re-enable tests that now pass on aarch64-windowskcbanner
2024-10-21coff: fix incorrect default `image_base` values and re-enable shared library ↵kcbanner
tests on Windows This was the cause of aarch64-windows shared libraries causing "bad image" errors during load-time linking. I also re-enabled the tests that were surfacing this bug.
2024-10-20compiler: Disallow function alignment for nvptx and spirv.Alex Rønne Petersen
2024-10-19riscv: disable failing testmlugg
Looks like the self-hosted riscv64 backend can't handle `std.meta.eql` involving the new `CallingConvention` right now.
2024-10-19Sema: add and improve some callconv compile errorsmlugg
2024-10-19test: update for `CallingConvention` changesmlugg
This also includes some compiler and std changes to correct error messages which weren't properly updated before.
2024-10-18incremental: disable flaky testmlugg
2024-10-18compiler: implement `@FieldType`mlugg
Resolves: #21702
2024-10-17Merge pull request #21610 from alexrp/riscv-abisAndrew Kelley
Fix some RISC-V ABI issues and add ILP32/LP64 (soft float) to module tests
2024-10-16incremental: disable failing testmlugg
The previous commit exposed a linker bug.
2024-10-16incremental: introduce `file` dependencies to handle AstGen failuresmlugg
The re-analysis here is a little coarse; it'd be nice in the future to have a way for an AstGen failure to preserve *all* analysis which depends on the last success, and just hide the compile errors which depend on it somehow. But I'm not sure how we'd achieve that, so this works fine for now. Resolves: #21223
2024-10-16incremental: add new test casemlugg
This isn't exactly the case provided in #11290, but is a slightly simpler case which I know would have triggered the same bug in the old implementation of incremental compilation. Resolves: #11290
2024-10-16test: Remove some loongarch32 triples that were erroneously added to ↵Alex Rønne Petersen
llvm_targets. glibc and musl do not support loongarch32 yet.
2024-10-15test: Add riscv(32,64)-linux-(none,musl) with soft float to module tests.Alex Rønne Petersen
2024-10-14Sema: fail if analyzing return in `noreturn`-declared function before ↵gabeuehlein
coercing `undefined` Just switches logic around in coerceExtra to check for returning in a noreturn function before coercing undefined to anything
2024-10-13Merge pull request #21688 from Snektron/spirv-fixRobin Voetter
spirv: fix some bitrot
2024-10-12implement packed struct equality (#21679)David Rubin
2024-10-13spirv: skip range switch testsRobin Voetter
This is not yet implemented
2024-10-10link.Elf tests: update for new static lib behaviorAndrew Kelley
the new code in this branch correctly only stores basenames in the static archive; update the test to reflect that.
2024-10-10linker tests: avoid trivially unnecessary allocationAndrew Kelley