aboutsummaryrefslogtreecommitdiff
path: root/test/behavior
AgeCommit message (Collapse)Author
2022-09-12remove pointless discardsAndrew Kelley
2022-09-12stage2: change how defers are stored in ZirVeikka Tuominen
Storing defers this way has the benefits that the defer doesn't get analyzed multiple times in AstGen, it takes up less space, and it makes Sema aware of defers allowing for 'unreachable else prong' error on error sets in generic code. The disadvantage is that it is a bit more complex and errdefers with payloads now emit a placeholder instruction (but those are rare). Sema.zig before: Total ZIR bytes: 3.7794370651245117MiB Instructions: 238996 (2.051319122314453MiB) String Table Bytes: 89.2802734375KiB Extra Data Items: 430144 (1.640869140625MiB) Sema.zig after: Total ZIR bytes: 3.3344192504882812MiB Instructions: 211829 (1.8181428909301758MiB) String Table Bytes: 89.2802734375KiB Extra Data Items: 374611 (1.4290275573730469MiB)
2022-09-10x86_64: pass more behavior testsJakub Konka
2022-09-10Merge pull request #12799 from joachimschmidt557/stage2-armJakub Konka
stage2 ARM: introduce allocRegs mechanism and other improvements
2022-09-10type: print comptime on fn type paramsJacob Young
This avoids the following confusing error message: error: expected type 'fn(i32, i32) void', found 'fn(i32, i32) void'
2022-09-10translate-c: Escape non-ASCII characters that appear in macrosEvan Haas
Macro definitions are simply a slice of bytes, which may not be UTF-8 encoded. If they are not UTF-8 encoded, escape non-printable and non-ASCII characters as `\xNN`. Fixes #12784
2022-09-09stage2 ARM: implement basic array_elem_valjoachimschmidt557
2022-09-09stage2 ARM: implement ptr_elem_valjoachimschmidt557
2022-09-09stage2 ARM: support larger function stacksjoachimschmidt557
This is done by introducing a new Mir pseudo-instruction
2022-09-09stage2 ARM: implement struct_field_val for registersjoachimschmidt557
2022-09-09stage2 ARM: amend implementation of various AIR instructionsjoachimschmidt557
- unwrap_errunion_err for registers - unwrap_errunion_payload for registers - ptr_slice_len_ptr for all MCValues - ptr_slice_ptr_ptr for all MCValues
2022-09-09stage2 ARM: implement field_parent_ptrjoachimschmidt557
2022-09-08llvm: handle pointers in packed structs in more placesVeikka Tuominen
Closes #12776
2022-09-08Sema: preserve alignment of const decl pointersVeikka Tuominen
Closes #12769
2022-09-07translate-c: convert tabs to `\t` in object-like macro string literalsEvan Haas
Closes #12549
2022-09-04llvm: fix the `type` parameter of `GlobalAlias`riChar
Closes 12680
2022-09-02Sema: improve behavior of comptime_int backed enumsVeikka Tuominen
2022-09-02Sema: resolve lazy value before intToFloatVeikka Tuominen
Closes #12698
2022-09-02stage2 llvm: correct handling of zero-bit types in unionFieldPtrVeikka Tuominen
Pointers to zero-bit types are not zero-bit types so the function should return something. Closes #12716
2022-09-02stage2 llvm: fix passing packed structs to callconv(.C) functionsVeikka Tuominen
Closes #12704
2022-08-31disable test for non-llvm backendsVeikka Tuominen
Follow up to fdb88708527742e450e4c566024d9d50ce61dd8d
2022-08-31translate-c: promote large integer macros to unsigned long long if necessaryEvan Haas
Closes #10793 Co-authored-by: Veikka Tuominen <git@vexu.eu>
2022-08-30avoid exposing supportsTailCall in the standard libraryAndrew Kelley
This is problematic because in practice it depends on whether the compiler backend supports it too, as evidenced by the TODO comment about LLVM not supporting some architectures that in fact do support tail calls. Instead this logic is organized strategically in src/target.zig, part of the internal compiler source code, and the behavior tests in question duplicate some logic for deciding whether to proceed with the test. The proper place to expose this flag is in `@import("builtin")` - the generated source file - so that third party compilers can advertise whether they support tail calls.
2022-08-30Sema: check that target supports tail callsVeikka Tuominen
2022-08-30stage2 llvm: use tag value instead of field index in airUnionInitVeikka Tuominen
Closes #12656
2022-08-30Sema: improve handling of always_tail call modifierVeikka Tuominen
Closes #4301 Closes #5692 Closes #6281 Closes #10786 Closes #11149 Closes #11776
2022-08-29Merge pull request #12641 from Luukdegram/wasm-c-typesAndrew Kelley
stage2: fix size of c_longdouble for Wasm target
2022-08-28wasm: skip unimplemented behavior testLuuk de Gram
Since now the size of a c_longdouble is correctly 16 bytes, the test is no longer passing. It was previously accidentally passing due to incorrect sizing and it not being larger than the size of a f64. disable long_double test for windows
2022-08-28Sema: add missing calls to resolveStructLayoutVeikka Tuominen
Closes #12645
2022-08-28Sema: correct one possible value for tuplesVeikka Tuominen
Closes #12376
2022-08-28Sema: fix handling of non-standard int types in empty non-exhaustive enumsVeikka Tuominen
Closes #12649
2022-08-27Sema: add error for non-comptime param in comptime funcantlilja
Adds error for taking a non comptime parameter in a function returning a comptime-only type but not when that type is dependent on a parameter. Co-authored-by: Veikka Tuominen <git@vexu.eu>
2022-08-26Add behavior test coverage for nested packed struct field accessDavid Gonzalez Martin
Closes #3091
2022-08-26Sema: ensure resolveTypeFields is called for optional and error union typesmartinhath
We call `sema.resolveTypeFields` in order to get the fields of structs and unions inserted into their data structures. If it isn't called, it can happen that the fields of a type is queried before those fields are inserted into (for instance) `Module.Union.fields`, which would result in a wrong 'no field named' error. Fixes: #12486
2022-08-26stage2: Reference to void constantsDavid Gonzalez Martin
Closes #7567
2022-08-25LLVM: fix missing alignment on wrapping instructionsAndrew Kelley
Previously, when lowering AIR instructions `wrap_errunion_payload`, `wrap_errunion_err`, and `wrap_optional`, the LLVM backend would create an alloca instruction to store the result, but did not set the alignment on it. This caused UB which went undetected for a long time until we started enabling the stack protector. Closes #12594 Unblocks #12508 Inspires #12634 Tests passed locally: * test-behavior * test-cases
2022-08-25Sema: ignore comptime params in partial func type checkVeikka Tuominen
This fixes a bug exposed by cd1833044ab7505bc101c85f59889bd3ea3fac80 where a function type would be converted to generic_poison even after being instantiated due to containing comptime only types. This could also be fixed by just checking `is_generic_instantiation` but this way also provides better type names. Closes #12625
2022-08-24stage2: explicitly tagged enums no longer have one possible valueAndrew Kelley
Previously, Zig had inconsistent semantics for an enum like this: `enum(u8){zero = 0}` Although in theory this can only hold one possible value, the tag `zero`, Zig no longer will treat the type this way. It will do loads and stores, as if the type has runtime bits. Closes #12619 Tests passed locally: * test-behavior * test-cases
2022-08-24Merge pull request #12623 from Vexu/stage2-fixesAndrew Kelley
Stage2 fixes
2022-08-24Merge pull request #12574 from Vexu/remove-bit-op-type-paramAndrew Kelley
stage2+stage1: remove type parameter from bit builtins
2022-08-24Sema: check one possible value earlier in `zirValidateArrayInit`Veikka Tuominen
Closes #12566
2022-08-24Sema: do not construct nested partial function typesVeikka Tuominen
Closes #12616
2022-08-23skip failing f80 behavior tests on WindowsJakub Konka
2022-08-22add behavior test for copying array of vectorsAndrew Kelley
closes #12026
2022-08-22stage2+stage1: remove type parameter from bit builtinsVeikka Tuominen
Closes #12529 Closes #12511 Closes #6835
2022-08-22Sema: fix implicit cast from extern fn to fn ptrVeikka Tuominen
Closes #12570
2022-08-22Sema: allow optional pointers in packed structsVeikka Tuominen
Closes #12572
2022-08-22Sema: make orelse with C pointers behave like stage1 for nowVeikka Tuominen
Closes #12537
2022-08-22Sema: resolve lazy values in `resolveMaybeUndefValIntable`Veikka Tuominen
Closes #12512 Closes #12513
2022-08-22Sema: fix parameter of type 'T' must be comptime errorVeikka Tuominen
Closes #12519 Closes #12505