Alex Rønne Petersen
f8719c4197
test: Re-enable store vector with memset for LLVM.
...
Closes #16177 .
2024-09-19 18:20:21 -07:00
Alex Rønne Petersen
2a24c17be2
test: Re-enable LLVM riscv64 module tests.
...
Closes #18872 .
2024-09-19 18:20:21 -07:00
Alex Rønne Petersen
a99c883cf0
test: Update wasm/infer-features based on what LLVM produces.
2024-09-19 18:20:21 -07:00
Alex Rønne Petersen
bdae7d97b9
test: Disable @bitCast of packed struct containing pointer temporarily.
...
TODO: Figure out what to do about this.
Context: https://discourse.llvm.org/t/rfc-remove-most-constant-expressions/63179
After changing our emit strategy for packed structs to just write to memory:
test-behavior
└─ run test behavior-x86_64-linux.6.5...6.5-gnu.2.38-x86_64-ReleaseSmall-libc
└─ zig test ReleaseSmall native failure
error: thread 44346 panic: attempt to unwrap error: ReinterpretDeclRef
/home/alexrp/Source/zig/src/Value.zig:571:42: 0x1f33514 in writeToPackedMemory (zig)
if (!val.ptrHasIntAddr(mod)) return error.ReinterpretDeclRef;
^
/home/alexrp/Source/zig/src/Value.zig:548:17: 0x1f32f45 in writeToPackedMemory (zig)
try field_val.writeToPackedMemory(field_ty, pt, buffer, bit_offset + bits);
^
/home/alexrp/Source/zig/src/codegen/llvm.zig:3706:89: 0x1ca2366 in lowerValueToInt (zig)
val.writeToPackedMemory(ty, pt, std.mem.sliceAsBytes(limbs)[0..bytes], 0) catch unreachable;
^
/home/alexrp/Source/zig/src/codegen/llvm.zig:4083:49: 0x1a33800 in lowerValue (zig)
return o.lowerValueToInt(llvm_int_ty, arg_val);
^
/home/alexrp/Source/zig/src/codegen/llvm.zig:4798:42: 0x2ec4e6a in resolveValue (zig)
const llvm_val = try o.lowerValue(val.toIntern());
^
/home/alexrp/Source/zig/src/codegen/llvm.zig:4789:47: 0x2ec4bd3 in resolveInst (zig)
const llvm_val = try self.resolveValue((try self.air.value(inst, self.ng.object.pt)).?);
^
/home/alexrp/Source/zig/src/codegen/llvm.zig:8996:49: 0x2f022e9 in airStore (zig)
const src_operand = try self.resolveInst(bin_op.rhs);
^
/home/alexrp/Source/zig/src/codegen/llvm.zig:4967:53: 0x29f7260 in genBody (zig)
.store => try self.airStore(inst, false),
^
/home/alexrp/Source/zig/src/codegen/llvm.zig:1682:19: 0x29f147c in updateFunc (zig)
fg.genBody(air.getMainBody()) catch |err| switch (err) {
^
/home/alexrp/Source/zig/src/link/Elf.zig:2916:70: 0x2eb0f15 in updateFunc (zig)
if (self.llvm_object) |llvm_object| return llvm_object.updateFunc(pt, func_index, air, liveness);
^
/home/alexrp/Source/zig/src/link.zig:426:82: 0x29fbef5 in updateFunc (zig)
return @as(*tag.Type(), @fieldParentPtr("base", base)).updateFunc(pt, func_index, air, liveness);
^
/home/alexrp/Source/zig/src/Zcu/PerThread.zig:876:22: 0x25f3d9e in linkerUpdateFunc (zig)
lf.updateFunc(pt, func_index, air, liveness) catch |err| switch (err) {
^
/home/alexrp/Source/zig/src/Compilation.zig:3975:36: 0x21768fe in processOneCodegenJob (zig)
try pt.linkerUpdateFunc(func.func, func.air);
^
/home/alexrp/Source/zig/src/Compilation.zig:3928:36: 0x2176541 in queueCodegenJob (zig)
return processOneCodegenJob(tid, comp, codegen_job);
^
/home/alexrp/Source/zig/src/Compilation.zig:3682:37: 0x1e9d37f in processOneJob (zig)
try comp.queueCodegenJob(tid, .{ .func = .{
^
/home/alexrp/Source/zig/src/Compilation.zig:3638:30: 0x1c1f6c1 in performAllTheWorkInner (zig)
try processOneJob(@intFromEnum(Zcu.PerThread.Id.main), comp, job, main_progress_node);
^
/home/alexrp/Source/zig/src/Compilation.zig:3508:36: 0x1ab6e10 in performAllTheWork (zig)
try comp.performAllTheWorkInner(main_progress_node);
^
/home/alexrp/Source/zig/src/Compilation.zig:2269:31: 0x1ab25b9 in update (zig)
try comp.performAllTheWork(main_progress_node);
^
/home/alexrp/Source/zig/src/main.zig:4156:32: 0x1b01351 in serve (zig)
try comp.update(main_progress_node);
^
/home/alexrp/Source/zig/src/main.zig:3453:22: 0x1b20d7c in buildOutputType (zig)
try serve(
^
/home/alexrp/Source/zig/src/main.zig:267:31: 0x1969c54 in mainArgs (zig)
return buildOutputType(gpa, arena, args, .zig_test);
^
/home/alexrp/Source/zig/src/main.zig:199:20: 0x19669c5 in main (zig)
return mainArgs(gpa, arena, args);
^
/home/alexrp/Source/zig/lib/std/start.zig:614:37: 0x19664ee in main (zig)
const result = root.main() catch |err| {
^
../sysdeps/nptl/libc_start_call_main.h:58:16: 0x7a453da2814f in __libc_start_call_main (../sysdeps/x86/libc-start.c)
../csu/libc-start.c:360:3: 0x7a453da28208 in __libc_start_main_impl (../sysdeps/x86/libc-start.c)
???:?:?: 0x1966134 in ??? (???)
???:?:?: 0x0 in ??? (???)
2024-09-19 18:20:21 -07:00
mlugg
2111f4c38b
Sema: mark export on owner nav when exporting function alias
...
Resolves : #20847
2024-09-18 21:42:47 +01:00
Matthew Lugg
41330c96ae
Merge pull request #21428 from mlugg/compare-to-undef
...
Sema: return undefined on comparison of runtime value against undefined
2024-09-17 14:34:10 +01:00
mlugg
4650e5b9fc
Sema: clean up cmpNumeric
...
There is one minor language change here, which is that comparisons of
the form `comptime_inf < runtime_f32` have their results comptime-known.
This is consistent with comparisons against comptime NaN for instance,
which are always comptime known. A corresponding behavior test is added.
This fixes a bug with int comparison elision which my previous commit
somehow triggered. `Sema.compareIntsOnlyPossibleResult` is much cleaner
now!
2024-09-17 11:00:38 +01:00
mlugg
a5c922179f
Sema: return undefined on comparison of runtime value against undefined
...
Resolves : #10703
Resolves : #17798
2024-09-16 17:11:47 +01:00
mlugg
1365be5d02
compiler: provide correct result types to += and -=
...
Resolves : #21341
2024-09-16 16:42:42 +01:00
mlugg
258236ec1b
Sema: don't emit instruction when casting @min/@max result to OPV type
...
Resolves : #21408
2024-09-15 17:52:35 +01:00
mlugg
19924ca289
Sema: give try operand error{} result type in non-errorable functions
...
Resolves : #21414
2024-09-15 16:51:26 +01:00
David Rubin
bc161430b0
riscv: implement optional_payload_ptr_set
2024-09-12 20:29:10 -04:00
xdBronch
0329b8387c
make decl literals work with single item pointers
2024-09-12 20:29:10 -04:00
mlugg
55250a9370
Sema: perform requested coercion when decl literal demoted to enum literal
...
Resolves : #21392
2024-09-12 23:46:00 +01:00
mlugg
03c363300f
AstGen: do not allow unlabeled break to exit a labeled switch
...
`break`ing from something which isn't a loop should always be opt-in.
This was a bug in #21257 .
2024-09-12 22:52:23 +01:00
Matthew Lugg
0001f91e4e
Merge pull request #21287 from linusg/deprecated-default-init
...
Replace deprecated default initializations with decl literals
2024-09-12 19:50:38 +01:00
Linus Groh
8588964972
Replace deprecated default initializations with decl literals
2024-09-12 16:01:23 +01:00
Alex Rønne Petersen
5cb9668632
test: Re-enable a bunch of behavior tests with LLVM.
...
Closes #10627 .
Closes #12013 .
Closes #18034 .
2024-09-12 07:28:37 +02:00
Andrew Kelley
4fba7336a9
Merge pull request #21269 from alexrp/soft-float
...
Fix soft float support, split musl triples by float ABI, and enable CI
2024-09-11 17:41:55 -07:00
Jacob Young
6aa6d088d9
Dwarf: implement and test hash maps
2024-09-10 13:06:08 -04:00
Jacob Young
d5a7fcfc13
Dwarf: implement and test multi array list slices
2024-09-10 13:06:08 -04:00
Jacob Young
e048e78886
Dwarf: implement and test multi array list
2024-09-10 12:27:57 -04:00
Jacob Young
6459212ebe
Dwarf: implement and test segmented list
2024-09-10 12:27:57 -04:00
Jacob Young
f34b198251
Dwarf: implement and test decls
2024-09-10 12:27:56 -04:00
Alex Rønne Petersen
75983c692f
test: Switch all arm-linux-* triples for module tests from v8a to v7a.
...
Broadly speaking, versions 6, 7, and 8 are the ones that are in common use. Of
these, v7 is what you'll typically see for 32-bit Arm today. So let's actually
make sure that that's what we're testing.
2024-09-10 08:53:30 +02:00
Alex Rønne Petersen
a872b61021
test: Add arm, mips, and powerpc soft float targets to module tests.
...
Prefer `eabi` and `eabihf` over the ambiguous `none` when not using libc.
2024-09-10 08:53:30 +02:00
Alex Rønne Petersen
26119bd98d
test: Skip some floating point tests that fail on arm-linux-(gnu,musl)eabi.
...
https://github.com/ziglang/zig/issues/21234
2024-09-10 08:53:30 +02:00
Alex Rønne Petersen
5285f41267
test: Disable store vector with memset on soft float arm.
...
https://github.com/ziglang/zig/issues/16177
2024-09-10 08:53:30 +02:00
xdBronch
d6d09f4ea7
add error for discarding if/while pointer capture
2024-09-10 01:45:48 +03:00
Maciej 'vesim' Kuliński
fb0028a0d7
mips: fix C ABI compatibility
2024-09-07 23:46:30 -07:00
Alex Rønne Petersen
ccf852c31e
test: Re-enable vector reduce operation for most LLVM targets.
...
mips64 failure is tracked in #21091 .
Closes #7138 .
2024-09-07 02:47:57 +02:00
Alex Rønne Petersen
5c128a8990
test: Re-enable vector shift operators for all LLVM targets.
...
Closes #4951 .
2024-09-07 02:47:57 +02:00
Alex Rønne Petersen
17f54e8274
std.zig.target: Split powerpc-linux-musl triple into powerpc-linux-musleabi(hf).
2024-09-06 20:11:47 +02:00
Alex Rønne Petersen
c1a70acc91
std.zig.target: Split mips(el)-linux-musl triples into mips(el)-linux-musleabi(hf).
...
Closes #21184 .
2024-09-06 20:11:47 +02:00
Andrew Kelley
1511a4171f
Merge pull request #21310 from alexrp/ppc64-tests
...
Force ELFv2 for PPC64 and add `powerpc64-linux-(none,musl)` to CI
2024-09-06 10:48:21 -07:00
Andrew Kelley
3929cac154
Merge pull request #21257 from mlugg/computed-goto-3
...
compiler: implement labeled switch/continue
2024-09-04 18:31:28 -07:00
Alex Rønne Petersen
ee3efe8007
test: Add powerpc64-linux-(none,musl) triples to module tests.
2024-09-05 01:15:33 +02:00
Alex Rønne Petersen
40ee682517
test: Disable store vector with memset on powerpc64.
...
This will be re-enabled with LLVM 19.
2024-09-05 01:15:33 +02:00
Alex Rønne Petersen
2a6eecff3e
test: Disable reinterpret packed union for powerpc64 too.
...
https://github.com/ziglang/zig/issues/21050
2024-09-05 01:15:33 +02:00
Jakub Konka
6ec8b15918
elf: fix emitting static lib when ZigObject is present
2024-09-04 13:34:26 +02:00
Jakub Konka
8c76a61ef5
test/link/elf: test --gc-sections on Zig input with LLVM too
2024-09-04 13:34:26 +02:00
Michael Dusan
7a4d69983a
AstGen: update @errorCast to maybe eval to err
...
Consequently, `AstGen.ret()` now passes the error code to
`.defer_error_code`. Previously, the error union value was passed.
closes #20371
2024-09-03 22:56:23 +01:00
David Rubin
0d295d7635
riscv: implement switch_dispatch & loop_switch_br
2024-09-01 18:31:01 +01:00
Jacob Young
d5b01df3c8
x86_64: implement loop_switch_br and switch_dispatch
2024-09-01 18:31:01 +01:00
mlugg
2b9af9e825
AstGen: error on unused switch label
2024-09-01 18:31:01 +01:00
mlugg
b7a55cd6c3
AstGen: allow breaking from labeled switch
...
Also, don't use the special switch lowering for errors if the switch
is labeled; this isn't currently supported. Related: #20627 .
2024-09-01 18:31:01 +01:00
mlugg
5e12ca9fe3
compiler: implement labeled switch/continue
2024-09-01 18:30:31 +01:00
mlugg
6e3e23a941
compiler: implement decl literals
...
Resolves : #9938
2024-09-01 17:34:07 +01:00
mlugg
9e683f0f35
compiler: provide result type to operand of try
...
This is mainly useful in conjunction with Decl Literals (#9938 ).
Resolves : #19777
2024-09-01 17:34:07 +01:00
David Rubin
fbac7afa0f
riscv: implement errunion_payload_ptr_set
2024-09-01 17:34:06 +01:00