wooster0
a221b2fbf2
Sema: fix use of Zcu.LazySrcLoc in error message
...
It currently prints as:
:3:18: error: untagged union 'Zcu.LazySrcLoc{ .base_node_inst = InternPool.TrackedInst.Index(104), .offset = Zcu.LazySrcLoc.Offset{ .node_offset = Zcu.LazySrcLoc.Offset.TracedOffset{ .x = -2, .trace = (value tracing disabled) } } }' cannot be converted to integer
2024-12-08 17:23:57 +00:00
Alex Rønne Petersen
ba37a4369b
std.zig.WindowsSdk: Support cross-arch SDK lookups.
...
This makes e.g. cross-compiling for x86-windows-msvc on a x86_64-windows-msvc
system work properly.
Closes #11926 .
2024-12-08 04:53:28 +01:00
Alex Rønne Petersen
09b39f77b7
std.Target: Remove Os.Tag.bridgeos.
...
It doesn't appear that targeting bridgeOS is meaningfully supported by Apple.
Even LLVM/Clang appear to have incomplete support for it, suggesting that Apple
never bothered to upstream that support. So there's really no sense in us
pretending to support this.
2024-12-03 20:43:15 +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
Pat Tullmann
5e1a83ad29
defaultPanic: @trap on 'other' target
...
The freestanding and other OS targets by default need to just @trap in the
default Panic implementation.
And `isValidMemory` won't work with freestanding or other targets.
Update the unwind_freestanding.zig test case to also run on the 'other' OS
target, too. This should keep the Zig's stacktrace generation from
regressing on the standalone targets.
2024-11-29 15:30:05 -05:00
Andrew Kelley
a47aa9dd9d
Merge pull request #22095 from alexrp/test-llvm-emit
...
Change `llvm_targets` tests to actually emit objects, and fix bugs found as a result
2024-11-29 15:28:54 -05:00
mlugg
c3821fe4ca
compiler: use @Type instead of @TypeOf to print enum literal type
2024-11-29 15:26:58 -05:00
Andrew Kelley
cfdb001a8f
Merge pull request #22099 from Rexicon226/fix-cat-mul
...
change `++` and `**` to not return mutable pointers
2024-11-29 15:05:49 -05:00
David Rubin
77f16d457b
test: adjust behaviour test to new concat/mul semantics
2024-11-28 18:05:36 -08:00
Alex Rønne Petersen
78b8ce5095
test: Change llvm_targets to actually emit an object for each target.
...
Without doing this, we don't actually test whether the data layout string we
generate matches LLVM's.
A number of targets had to be commented out due to this change:
* Some are using a non-working experimental LLVM backend (arc, csky, ...).
* Some don't have working LLD support (lanai, sparc, ...).
* Some don't have working self-hosted linker support (nvptx).
* Some are using ABIs that haven't been standardized (loongarch32).
Finally, all non-x86 uefi targets are hopelessly broken and can't really be
fixed until we change our emit logic to lower *-uefi-* verbatim rather than to
*-windows-*. See: https://github.com/ziglang/zig/issues/21630
2024-11-28 22:04:00 +01:00
Alex Rønne Petersen
0bf054f4c5
test: Remove aarch64(_be)-linux-gnuilp32 from llvm_targets.
...
LLVM doesn't handle this target correctly (pointer size, etc).
2024-11-28 22:04:00 +01:00
Alex Rønne Petersen
abf3032ff1
test: Add m68k-linux-musl to llvm_targets.
2024-11-28 22:04:00 +01:00
Alex Rønne Petersen
322013c648
test: Add aarch64(_be)-linux-musl to llvm_targets.
2024-11-28 22:04:00 +01:00
Alex Rønne Petersen
11d51ea5a2
test: Remove aarch64-rtems-ilp32 from llvm_targets.
...
LLVM can't represent this target at the moment.
2024-11-28 22:04:00 +01:00
Alex Rønne Petersen
4369d3b93d
test: Add *-windows-cygnus triples to llvm_targets.
2024-11-28 22:04:00 +01:00
Alex Rønne Petersen
8594f179f9
Merge pull request #22067 from alexrp/pie-tests
...
Add PIC/PIE tests and fix some bugs + some improvements to the test harness
2024-11-28 14:07:28 +01:00
Jacob Young
c894ac09a3
dwarf: fix stepping through an inline loop containing one statement
...
Previously, stepping from the single statement within the loop would
always exit the loop because all of the code unrolled from the loop is
associated with the same line and treated by the debugger as one line.
2024-11-24 17:28:12 -05:00
Alex Rønne Petersen
5beb5f20d2
test: Set emit_bin=false for some safety tests.
...
This should hopefully be reverted soon with Andrew's work on the self-hosted
wasm linker.
error: thread 171731 panic: integer overflow
/home/alexrp/Source/ziglang/zig/src/link/Wasm.zig:2392:32: 0x22b709e in setupMemory (zig)
break :index sym.index - wasm.imported_globals_count;
^
/home/alexrp/Source/ziglang/zig/src/link/Wasm.zig:2678:25: 0x1ed1be6 in flushModule (zig)
try wasm.setupMemory();
^
/home/alexrp/Source/ziglang/zig/src/link/Wasm.zig:2619:28: 0x1c2e4d4 in flush (zig)
return wasm.flushModule(arena, tid, prog_node);
^
/home/alexrp/Source/ziglang/zig/src/link.zig:874:77: 0x1a55ad7 in flush (zig)
return @as(*tag.Type(), @fieldParentPtr("base", base)).flush(arena, tid, prog_node);
^
/home/alexrp/Source/ziglang/zig/src/Compilation.zig:2411:17: 0x1a553f9 in flush (zig)
lf.flush(arena, tid, prog_node) catch |err| switch (err) {
^
/home/alexrp/Source/ziglang/zig/src/Compilation.zig:2371:22: 0x1a58d60 in update (zig)
try flush(comp, arena, .{
^
/home/alexrp/Source/ziglang/zig/src/main.zig:4114:32: 0x1ae392b in serve (zig)
try comp.update(main_progress_node);
^
/home/alexrp/Source/ziglang/zig/src/main.zig:3555:22: 0x1b05322 in buildOutputType (zig)
try serve(
^
/home/alexrp/Source/ziglang/zig/src/main.zig:265:31: 0x195faca in mainArgs (zig)
return buildOutputType(gpa, arena, args, .{ .build = .Obj });
^
/home/alexrp/Source/ziglang/zig/src/main.zig:200:20: 0x195c995 in main (zig)
return mainArgs(gpa, arena, args);
^
/home/alexrp/Source/ziglang/zig/lib/std/start.zig:617:37: 0x195c49e in main (zig)
const result = root.main() catch |err| {
^
2024-11-24 22:11:17 +01:00
Alex Rønne Petersen
1d1ca84854
test: Set emit_bin=false for spirv_mergable_pointers.zig.
...
/home/alexrp/.cache/zig/b/18236e302af25e3fb99bc6a232ddc447/builtin.zig:6:5: error: TODO (SPIR-V): Implement unsigned composite int type of 64 bits
pub const zig_backend = std.builtin.CompilerBackend.stage2_spirv64;
~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2024-11-24 22:11:17 +01:00
Alex Rønne Petersen
4b16d81318
test: Set emit_bin=false for all nvptx tests.
...
error: thread 165232 panic: TODO: rewrite the NvPtx.flushModule function
/home/alexrp/Source/ziglang/zig/src/link/NvPtx.zig:123:5: 0x1ed99ce in flushModule (zig)
@panic("TODO: rewrite the NvPtx.flushModule function");
^
/home/alexrp/Source/ziglang/zig/src/link/NvPtx.zig:110:28: 0x1c2e7e6 in flush (zig)
return self.flushModule(arena, tid, prog_node);
^
/home/alexrp/Source/ziglang/zig/src/link.zig:874:77: 0x1a55bd3 in flush (zig)
return @as(*tag.Type(), @fieldParentPtr("base", base)).flush(arena, tid, prog_node);
^
/home/alexrp/Source/ziglang/zig/src/Compilation.zig:2411:17: 0x1a553f9 in flush (zig)
lf.flush(arena, tid, prog_node) catch |err| switch (err) {
^
/home/alexrp/Source/ziglang/zig/src/Compilation.zig:2348:22: 0x1a595ba in update (zig)
try flush(comp, arena, .{
^
/home/alexrp/Source/ziglang/zig/src/main.zig:4114:32: 0x1ae392b in serve (zig)
try comp.update(main_progress_node);
^
/home/alexrp/Source/ziglang/zig/src/main.zig:3555:22: 0x1b05322 in buildOutputType (zig)
try serve(
^
/home/alexrp/Source/ziglang/zig/src/main.zig:265:31: 0x195faca in mainArgs (zig)
return buildOutputType(gpa, arena, args, .{ .build = .Obj });
^
/home/alexrp/Source/ziglang/zig/src/main.zig:200:20: 0x195c995 in main (zig)
return mainArgs(gpa, arena, args);
^
/home/alexrp/Source/ziglang/zig/lib/std/start.zig:617:37: 0x195c49e in main (zig)
const result = root.main() catch |err| {
^
2024-11-24 22:11:17 +01:00
Alex Rønne Petersen
2298108daf
test: Allow tests to set emit_bin=false.
2024-11-24 22:11:17 +01:00
Alex Rønne Petersen
c4cd3c0541
test: Force compile test cases to be codegen'd if requested.
2024-11-24 22:11:17 +01:00
Alex Rønne Petersen
ad2be71514
test: Add test cases for PIC/PIE on various supported platforms.
...
Closes #22052 .
2024-11-24 22:11:17 +01:00
Alex Rønne Petersen
fefcdc5673
test: Allow setting PIC/PIE in test cases.
2024-11-24 22:11:17 +01:00
Alex Rønne Petersen
9d10246a80
test: Enable -Dtest-target-filter=... to work for test-debugger.
2024-11-24 22:11:17 +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
Alex Rønne Petersen
24ecf45569
std.Target: Add Os.HurdVersionRange for Os.Tag.hurd.
...
This is necessary since isGnuLibC() is true for hurd, so we need to be able to
represent a glibc version for it.
Also add an Os.TaggedVersionRange.gnuLibCVersion() convenience function.
2024-11-24 22:11:16 +01:00
Jacob Young
70ad7dcd48
lldb: implement tuple types
2024-11-23 23:51:35 -05:00
Alex Rønne Petersen
aef5c75602
compiler: Disallow align(0) everywhere in the language.
...
Thus leaving the design space for this alignment value open, e.g. for packing.
2024-11-23 18:44:07 -05:00
xdBronch
5f3a70ed5f
Fix peer type resolution with allowzero pointers
2024-11-20 02:09:50 +02:00
Jacob Young
a8ec306b49
Sema: fix peer resolution alignment between slice and empty struct
...
An empty struct that coerces to an empty array should not force
`align(1)` on the resulting slice type.
2024-11-16 21:22:57 -05:00
Jacob Young
11e54a3559
link: fix failing incremental test cases
2024-11-16 14:03:31 -05:00
mlugg
bbbc95afd0
AstGen: add missing rvalue call to labeledBlockExpr
...
...and fix a minor x86_64 backend bug exposed by this fix.
Resolves : #21974
2024-11-12 14:51:10 +00:00
mlugg
6e56bc1096
test: add new incremental case
...
This is similar to the old `llvm/shift_right_plus_left` case, which was
disabled by 1b1c78c. The case is not enabled on the LLVM backend, since
incremental compilation support for this backend is a work in progress
and is tracked by #21165 . It passes on the x86_64-linux target with the
self-hosted backend.
Resolves : #12288
2024-11-11 12:22:55 +00:00
mlugg
ca12e4f33e
test: remove old-style incremental cases, add a few new incremental cases
...
These cases have been disabled for a while, and we have transitioned to
using a compact file format for incremental test cases.
I was originally planning to port all of these cases, but the vast
majority aren't testing anything interesting, so it wasn't worth the
effort. I did look through each one; anything interesting being tested
has been extracted into a new case in `test/incremental/`.
Two of the new tests are currently failing with the self-hosted ELF
linker, and thus are currently only enabled with the C backend.
Resolves : #12844
2024-11-11 12:22:48 +00:00
Wooster
35201e9d93
Sema: fix wording in error message
...
It's an FQN, not an actual file name.
2024-11-09 20:21:32 +00:00
Alex Rønne Petersen
f25ea264b7
Revert "test: Add aarch64_be-linux-(none,gnu,musl) to module tests."
...
This reverts commit 4049be90de6a557c1ab522363fddbb71d3ccdb18.
See: https://github.com/ziglang/zig/issues/21911
2024-11-05 07:15:53 +01:00
Alex Rønne Petersen
4049be90de
test: Add aarch64_be-linux-(none,gnu,musl) to module tests.
2024-11-04 08:29:42 +01:00
Alex Rønne Petersen
9d0bb7ada8
test: Disable 128-bit atomics behavior tests on aarch64_be.
...
See: https://github.com/ziglang/zig/issues/21892
2024-11-04 08:29:42 +01:00
Alex Rønne Petersen
2958a90515
test: Disable some vector behavior tests on aarch64_be.
...
See: https://github.com/ziglang/zig/issues/21893
2024-11-04 08:29:42 +01:00
Alex Rønne Petersen
b72b81292f
test: Remove some unsupported ohos triples from llvm_targets.
2024-11-04 08:29:42 +01:00
Alex Rønne Petersen
96ea7d3e1c
test: Disable reinterpret packed union on all big endian targets.
...
See: https://github.com/ziglang/zig/issues/21050
2024-11-04 08:29:42 +01:00
Alex Rønne Petersen
3054486d1d
Merge pull request #21843 from alexrp/callconv-followup
...
Some follow-up work for #21697
2024-11-03 14:27:09 +01:00
Alex Rønne Petersen
2f003f39b2
Merge pull request #21599 from alexrp/thumb-porting
2024-11-03 14:25:30 +01:00
Alex Rønne Petersen
621487d5ab
test: Add thumb-linux-(musl)eabi(hf) target triples for module tests.
2024-11-03 09:29:33 +01:00
Alex Rønne Petersen
d89cf3e7d8
test: Add the ability to skip specific modules for a target.
2024-11-03 09:29:33 +01:00
Alex Rønne Petersen
c9e67e71c1
std.Target: Replace isARM() with isArmOrThumb() and rename it to isArm().
...
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-03 09:29:30 +01:00
Alex Rønne Petersen
e4e3d7ab41
Sema: Disallow calling functions with certain special calling conventions.
2024-11-02 10:44:18 +01:00
Alex Rønne Petersen
11915ae48e
std.zig.target: Change mips64(el)-linux-musl triples to -muslabi64.
...
With this, MIPS triples for musl are in line with glibc triples.
2024-11-02 10:42:53 +01:00