aboutsummaryrefslogtreecommitdiff
path: root/test/behavior
AgeCommit message (Collapse)Author
2024-10-04remove `@fence` (#21585)David Rubin
closes #11650
2024-10-02test: Re-enable "bitcast nan float does not modify signaling bit" for LLVM + ↵Alex Rønne Petersen
arm. This now passes on all targets that we test in CI. See: https://github.com/ziglang/zig/issues/14366
2024-09-24std: add arch bits for s390x-linux (#21342)Meghan Denny
see #21402
2024-09-19test: Re-enable `store vector with memset` for LLVM.Alex Rønne Petersen
Closes #16177.
2024-09-19test: Disable `@bitCast of packed struct containing pointer` temporarily.Alex Rønne Petersen
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-18Sema: mark export on owner nav when exporting function aliasmlugg
Resolves: #20847
2024-09-17Merge pull request #21428 from mlugg/compare-to-undefMatthew Lugg
Sema: return undefined on comparison of runtime value against undefined
2024-09-17Sema: clean up cmpNumericmlugg
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-16compiler: provide correct result types to `+=` and `-=`mlugg
Resolves: #21341
2024-09-15Sema: don't emit instruction when casting @min/@max result to OPV typemlugg
Resolves: #21408
2024-09-15Sema: give `try` operand `error{}` result type in non-errorable functionsmlugg
Resolves: #21414
2024-09-12riscv: implement `optional_payload_ptr_set`David Rubin
2024-09-12make decl literals work with single item pointersxdBronch
2024-09-12AstGen: do not allow unlabeled `break` to exit a labeled switchmlugg
`break`ing from something which isn't a loop should always be opt-in. This was a bug in #21257.
2024-09-12Merge pull request #21287 from linusg/deprecated-default-initMatthew Lugg
Replace deprecated default initializations with decl literals
2024-09-12Replace deprecated default initializations with decl literalsLinus Groh
2024-09-12test: Re-enable a bunch of behavior tests with LLVM.Alex Rønne Petersen
Closes #10627. Closes #12013. Closes #18034.
2024-09-11Merge pull request #21269 from alexrp/soft-floatAndrew Kelley
Fix soft float support, split musl triples by float ABI, and enable CI
2024-09-10test: Skip some floating point tests that fail on `arm-linux-(gnu,musl)eabi`.Alex Rønne Petersen
https://github.com/ziglang/zig/issues/21234
2024-09-10test: Disable `store vector with memset` on soft float arm.Alex Rønne Petersen
https://github.com/ziglang/zig/issues/16177
2024-09-07test: Re-enable `vector reduce operation` for most LLVM targets.Alex Rønne Petersen
mips64 failure is tracked in #21091. Closes #7138.
2024-09-07test: Re-enable `vector shift operators` for all LLVM targets.Alex Rønne Petersen
Closes #4951.
2024-09-06Merge pull request #21310 from alexrp/ppc64-testsAndrew Kelley
Force ELFv2 for PPC64 and add `powerpc64-linux-(none,musl)` to CI
2024-09-04Merge pull request #21257 from mlugg/computed-goto-3Andrew Kelley
compiler: implement labeled switch/continue
2024-09-05test: Disable `store vector with memset` on powerpc64.Alex Rønne Petersen
This will be re-enabled with LLVM 19.
2024-09-05test: Disable `reinterpret packed union` for powerpc64 too.Alex Rønne Petersen
https://github.com/ziglang/zig/issues/21050
2024-09-03AstGen: update @errorCast to maybe eval to errMichael Dusan
Consequently, `AstGen.ret()` now passes the error code to `.defer_error_code`. Previously, the error union value was passed. closes #20371
2024-09-01riscv: implement `switch_dispatch` & `loop_switch_br`David Rubin
2024-09-01x86_64: implement `loop_switch_br` and `switch_dispatch`Jacob Young
2024-09-01AstGen: allow breaking from labeled switchmlugg
Also, don't use the special switch lowering for errors if the switch is labeled; this isn't currently supported. Related: #20627.
2024-09-01compiler: implement labeled switch/continuemlugg
2024-09-01compiler: implement decl literalsmlugg
Resolves: #9938
2024-09-01compiler: provide result type to operand of `try`mlugg
This is mainly useful in conjunction with Decl Literals (#9938). Resolves: #19777
2024-09-01riscv: implement `errunion_payload_ptr_set`David Rubin
2024-08-29behavior: avoid field/decl name conflictsmlugg
2024-08-28std: update `std.builtin.Type` fields to follow naming conventionsmlugg
The compiler actually doesn't need any functional changes for this: Sema does reification based on the tag indices of `std.builtin.Type` already! So, no zig1.wasm update is necessary. This change is necessary to disallow name clashes between fields and decls on a type, which is a prerequisite of #9938.
2024-08-27behavior: import unintentionally excluded file from behavior.zigmlugg
And remove the now-invalid test for the return value of `@branchHint`.
2024-08-27behavior,cases: add `@branchHint` test coveragemlugg
2024-08-27compiler,lib,test,langref: migrate `@setCold` to `@branchHint`mlugg
2024-08-27lib,test,tools,doc: update usages of @exportmlugg
2024-08-18test: Disable `vector reduce operation` on mips64.Alex Rønne Petersen
https://github.com/ziglang/zig/issues/21091
2024-08-18test: Disable `@min/max for floats` on mips64.Alex Rønne Petersen
https://github.com/ziglang/zig/issues/21090
2024-08-16Merge pull request #21065 from ziglang/elf-zig-gotJakub Konka
elf: replace .got.zig with a zig jump table
2024-08-15elf: fix up riscv for `.got.zig` rewriteDavid Rubin
2024-08-12test: Partially disable `vector float operators` on mips.Alex Rønne Petersen
https://github.com/ziglang/zig/issues/21051
2024-08-12test: Disable `reinterpret packed union` on mips.Alex Rønne Petersen
https://github.com/ziglang/zig/issues/21050
2024-08-11compiler: split Decl into Nav and Caumlugg
The type `Zcu.Decl` in the compiler is problematic: over time it has gained many responsibilities. Every source declaration, container type, generic instantiation, and `@extern` has a `Decl`. The functions of these `Decl`s are in some cases entirely disjoint. After careful analysis, I determined that the two main responsibilities of `Decl` are as follows: * A `Decl` acts as the "subject" of semantic analysis at comptime. A single unit of analysis is either a runtime function body, or a `Decl`. It registers incremental dependencies, tracks analysis errors, etc. * A `Decl` acts as a "global variable": a pointer to it is consistent, and it may be lowered to a specific symbol by the codegen backend. This commit eliminates `Decl` and introduces new types to model these responsibilities: `Cau` (Comptime Analysis Unit) and `Nav` (Named Addressable Value). Every source declaration, and every container type requiring resolution (so *not* including `opaque`), has a `Cau`. For a source declaration, this `Cau` performs the resolution of its value. (When #131 is implemented, it is unsolved whether type and value resolution will share a `Cau` or have two distinct `Cau`s.) For a type, this `Cau` is the context in which type resolution occurs. Every non-`comptime` source declaration, every generic instantiation, and every distinct `extern` has a `Nav`. These are sent to codegen/link: the backends by definition do not care about `Cau`s. This commit has some minor technically-breaking changes surrounding `usingnamespace`. I don't think they'll impact anyone, since the changes are fixes around semantics which were previously inconsistent (the behavior changed depending on hashmap iteration order!). Aside from that, this changeset has no significant user-facing changes. Instead, it is an internal refactor which makes it easier to correctly model the responsibilities of different objects, particularly regarding incremental compilation. The performance impact should be negligible, but I will take measurements before merging this work into `master`. Co-authored-by: Jacob Young <jacobly0@users.noreply.github.com> Co-authored-by: Jakub Konka <kubkon@jakubkonka.com>
2024-08-08language: add module name field to `@src`Andrew Kelley
closes #20963
2024-08-01std.Target: Rework isPPC()/isPPC64() functions.Alex Rønne Petersen
* Rename isPPC() -> isPowerPC32(). * Rename isPPC64() -> isPowerPC64(). * Add new isPowerPC() function which covers both. There was confusion even in the standard library about what isPPC() meant. This change makes these functions work how I think most people actually expect them to work, and makes them consistent with isMIPS(), isSPARC(), etc. I chose to rename from PPC to PowerPC because 1) it's more consistent with the other functions, and 2) it'll cause loud rather than silent breakage for anyone who might have been depending on isPPC() while misunderstanding it.
2024-08-01Merge pull request #20870 from alexrp/target-cleanup-3Andrew Kelley
`std.Target`: Remove more dead OS/architecture tags