aboutsummaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2024-08-07Merge pull request #20958 from ziglang/fuzzAndrew Kelley
introduce a fuzz testing web interface
2024-08-07Merge pull request #20894 from alexrp/target-cleanup-4Andrew Kelley
`std.Target`: Minor rework to some `isArch()` functions, fix some related issues throughout `std`
2024-08-07update coff_dwarf standalone test to new APIAndrew Kelley
and make it still test compilation on non-Windows
2024-08-05test: Add generate_c_size_and_align_checks.zig to standalone build testEvan Haas
2024-08-02fix compilation on powerpc GNU systemsAndrew Kelley
...which have a ucontext_t but not a PC register. The current stack unwinding implementation does not yet support this architecture. Also fix name of `std.debug.SelfInfo.openSelf` to remove redundancy. Also removed this hook into root providing an "openSelfDebugInfo" function. Sorry, this debugging code is not of sufficient quality to offer a plugin API right now.
2024-08-01build.zig: fix -Dskip-non-nativeAndrew Kelley
now it actually does what it says on the tin
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
2024-07-31Merge pull request #20885 from ziglang/simplify-tokenizerAndrew Kelley
std.zig.tokenizer: simplification and spec conformance
2024-07-31Merge pull request #20883 from ehaas/aro-translate-c-no-panicAndrew Kelley
aro-translate-c improvements
2024-07-31tokenizer: tabs and carriage returns spec conformanceAndrew Kelley
2024-07-31remove hard tabs from source codeAndrew Kelley
these are illegal according to the spec
2024-07-31std.zig.tokenizer: simplifyAndrew Kelley
I pointed a fuzzer at the tokenizer and it crashed immediately. Upon inspection, I was dissatisfied with the implementation. This commit removes several mechanisms: * Removes the "invalid byte" compile error note. * Dramatically simplifies tokenizer recovery by making recovery always occur at newlines, and never otherwise. * Removes UTF-8 validation. * Moves some character validation logic to `std.zig.parseCharLiteral`. Removing UTF-8 validation is a regression of #663, however, the existing implementation was already buggy. When adding this functionality back, it must be fuzz-tested while checking the property that it matches an independent Unicode validation implementation on the same file. While we're at it, fuzzing should check the other properties of that proposal, such as no ASCII control characters existing inside the source code. Other changes included in this commit: * Deprecate `std.unicode.utf8Decode` and its WTF-8 counterpart. This function has an awkward API that is too easy to misuse. * Make `utf8Decode2` and friends use arrays as parameters, eliminating a runtime assertion in favor of using the type system. After this commit, the crash found by fuzzing, which was "\x07\xd5\x80\xc3=o\xda|a\xfc{\x9a\xec\x91\xdf\x0f\\\x1a^\xbe;\x8c\xbf\xee\xea" no longer causes a crash. However, I did not feel the need to add this test case because the simplified logic eradicates most crashes of this nature.
2024-07-31riscv: implement non-pow2 indirect loadsDavid Rubin
2024-07-31aro_translate_c: do not translate atomic typesEvan Haas
2024-07-31aro_translate_c: move noreturn test to manifestEvan Haas
2024-07-31aro_translate_c: handle opaque struct defs in prototypesEvan Haas
2024-07-31aro_translate_c: move simple function prototype test to manifestEvan Haas
2024-07-31translate_c: move empty declaration test to test manifestEvan Haas
2024-07-31aro_translate_c: Make function decls publicEvan Haas
2024-07-30elf: simplify output section tracking for symbolsJakub Konka
2024-07-30elf: resolve COMDATs in more parallel-friendly wayJakub Konka
2024-07-30test/link/elf: test COMDAT eliminationJakub Konka
2024-07-30std.Target: Remove `sparcel` architecture tag.Alex Rønne Petersen
What is `sparcel`, you might ask? Good question! If you take a peek in the SPARC v8 manual, §2.2, it is quite explicit that SPARC v8 is a big-endian architecture. No little-endian or mixed-endian support to be found here. On the other hand, the SPARC v9 manual, in §3.2.1.2, states that it has support for mixed-endian operation, with big-endian mode being the default. Ok, so `sparcel` must just be referring to SPARC v9 running in little-endian mode, surely? Nope: * https://github.com/llvm/llvm-project/blob/40b4fd7a3e81d32b29364a1b15337bcf817659c0/llvm/lib/Target/Sparc/SparcTargetMachine.cpp#L226 * https://github.com/llvm/llvm-project/blob/40b4fd7a3e81d32b29364a1b15337bcf817659c0/llvm/lib/Target/Sparc/SparcTargetMachine.cpp#L104 So, `sparcel` in LLVM is referring to some sort of fantastical little-endian SPARC v8 architecture. I've scoured the internet and I can find absolutely no evidence that such a thing exists or has ever existed. In fact, I can find no evidence that a little-endian implementation of SPARC v9 ever existed, either. Or any SPARC version, actually! The support was added here: https://reviews.llvm.org/D8741 Notably, there is no mention whatsoever of what CPU this might be referring to, and no justification given for the "but some are little" comment added in the patch. My best guess is that this might have been some private exercise in creating a little-endian version of SPARC that never saw the light of day. Given that SPARC v8 explicitly doesn't support little-endian operation (let alone little-endian instruction encoding!), and no CPU is known to be implemented as such, I think it's very reasonable for us to just remove this support.
2024-07-29aro_translate_c: do not translate _Static_assert declarationsEvan Haas
This does not completely ignore static asserts - they are validated by aro during parsing; any failures will render an error and non-zero exit code. Emit a warning comment that _Static_asserts are not translated - this matches the behavior of the existing clang-based translate-c. Aro currently does not store source locations for _Static_assert declarations so I've hard-coded token index 0 for now.
2024-07-28std.Target.Cpu.Arch: Remove the `aarch64_32` tag.Alex Rønne Petersen
This is a misfeature that we inherited from LLVM: * https://reviews.llvm.org/D61259 * https://reviews.llvm.org/D61939 (`aarch64_32` and `arm64_32` are equivalent.) I truly have no idea why this triple passed review in LLVM. It is, to date, the *only* tag in the architecture component that is not, in fact, an architecture. In reality, it is just an ILP32 ABI for AArch64 (*not* AArch32). The triples that use `aarch64_32` look like `aarch64_32-apple-watchos`. Yes, that triple is exactly what you think; it has no ABI component. They really, seriously did this. Since only Apple could come up with silliness like this, it should come as no surprise that no one else uses `aarch64_32`. Later on, a GNU ILP32 ABI for AArch64 was developed, and support was added to LLVM: * https://reviews.llvm.org/D94143 * https://reviews.llvm.org/D104931 Here, sanity seems to have prevailed, and a triple using this ABI looks like `aarch64-linux-gnu_ilp32` as you would expect. As can be seen from the diffs in this commit, there was plenty of confusion throughout the Zig codebase about what exactly `aarch64_32` was. So let's just remove it. In its place, we'll use `aarch64-watchos-ilp32`, `aarch64-linux-gnuilp32`, and so on. We'll then translate these appropriately when talking to LLVM. Hence, this commit adds the `ilp32` ABI tag (we already have `gnuilp32`).
2024-07-28Merge pull request #20807 from Rexicon226/riscvJakub Konka
riscv: more backend progress
2024-07-28Merge pull request #20834 from ziglang/macho-boundary-typo-fixJakub Konka
macho: fix typo in boundary symbols handling
2024-07-28macho: test section$end$ boundary symbol handlingJakub Konka
2024-07-28translate-c: Use mangled name for local extern in condition/loopLinus Groh
2024-07-26riscv: make multi-threaded enabled compilation the defaultDavid Rubin
2024-07-26riscv: implement `@cmpxchg*` and remove fixesDavid Rubin
2024-07-26riscv: update tests and fix reuse bugDavid Rubin
2024-07-26riscv: airAsm rewriteDavid Rubin
with this rewrite we can call functions inside of inline assembly, enabling us to use the default start.zig logic all that's left is to implement lr/sc loops for atomically manipulating 1 and 2 byte values, after which we can use the segfault handler logic.
2024-07-26riscv: enable passing testsDavid Rubin
2024-07-26riscv: implement `@floatFromInt`David Rubin
2024-07-26riscv: clean up and unify encoding logicDavid Rubin
2024-07-26riscv: update testsDavid Rubin
2024-07-26riscv: implement sub-byte additionDavid Rubin
2024-07-26riscv: fix logic bug in `ptr_elem_ptr`David Rubin
I was doing duplicate work with `elemOffset` multiplying by the abi size and then the `ptr_add` `genBinOp` also multiplying. This led to having writes happening in the wrong place.
2024-07-26riscv: remove redundant assert in `genBinOp`David Rubin
2024-07-26riscv: implement `@clz`David Rubin
2024-07-26riscv: implement more operatorsDavid Rubin
we can run `std.debug.print` now, with both run-time strings and integers!
2024-07-26riscv: un-cache the `avl` and `vtype` when returning from a function callDavid Rubin
the csrs `avl` and `vtype` are considered caller-saved so it could have changed while inside of the function. the easiest way to handle this is to just set the cached `vtype` and `avl` to null, so that the next time something needs to set it, it'll emit an instruction instead of relying on a potentially invalid setting.
2024-07-25aarch64: reenable tests that are no longer regressedJulian Vesper
Closes #12012
2024-07-23Merge pull request #20758 from pavelverigo/stage2-wasm-compiler-rt-test-passAndrew Kelley
stage2-wasm: pass compiler_rt test suite
2024-07-23Default std.posix.system.ucontext_t is voidPat Tullmann
PR https://github.com/ziglang/zig/pull/20679 ("std.c reorganization") switched feature-detection code to use "T != void" checks in place of "@hasDecl". However, the std.posix.system struct is empty, so compile-time feature detection against symbols in there (specifically `std.posix.system.ucontext_t` in this case), fail at compile time on freestanding targets. This PR adds a void ucontext_t into the std.posix.system default. This PR also adds pseudo-"freestanding" variation of the StackIterator "unwind" test. It is sort of hacky (its freestanding, but assumes it can invoke a Linux exit syscall), but it does detect this problem. Fixes #20710
2024-07-23stage2-wasm: mul_sat 32 bits <=, i64, i128Pavel Verigo
2024-07-22riscv: disable failing testDavid Rubin
2024-07-21Merge pull request #20708 from alexrp/target-cleanup-2Andrew Kelley
`std.Target`: Remove more dead architecture tags.