Commit Graph

1331 Commits

Author SHA1 Message Date
Michael Dusan
e0fb4c29cb llvm codegen: fix f16,f32,f64 nan bitcasts
@bitCast from integer NaN representation to float NaN resulted in
changed bits in float. This only happened with signaled NaN.

- added test for signaled NaN
- added tests for quiet NaN (for completeness)

closes #14198
2023-01-05 02:22:30 -07:00
Michael Dusan
ed23615638 behavior: add test for #8277
Test `@sizeOf` reified union with zero-size payload fields.

closes #8277
2023-01-04 15:48:00 -05:00
joachimschmidt557
09122650ba stage2 AArch64: bump up alignment of stack items fitting in regs
This enables us to use more efficient loading and storing for these
small stack items
2023-01-03 19:56:09 +01:00
Andrew Kelley
0b99c83c21 fix behavior test compile error
I bungled the commit 995c36dcb1 during the
merge. Sorry about that.
2023-01-02 15:02:33 -07:00
Andrew Kelley
995c36dcb1 avoid testing inline for in unrelated behavior tests 2023-01-02 14:09:01 -07:00
kcbanner
4776128099 skip "atomicrmw with 128-bit ints" on everything except cbe 2023-01-02 13:56:32 -07:00
kcbanner
8ebf18635c skip "atomicrmw with 128-bit ints" on linux x64_64 due to linker error 2023-01-02 13:56:32 -07:00
kcbanner
50c31e5caa skip "truncate int128" on wasm 2023-01-02 13:56:32 -07:00
kcbanner
fc84b233ee skip "truncate to non-power-of-two integers from 128-bit" on non-llvm 2023-01-02 13:56:32 -07:00
kcbanner
c2f5c3bc4e skip "binary not 128-bit" on non-llvm 2023-01-02 13:56:32 -07:00
kcbanner
9c951cc874 fmt fixups 2023-01-02 13:56:32 -07:00
kcbanner
9c70315854 tests: add more coverage for 128 bit operations
- fixup 128-bit atomics test to only run on x86_64
- add truncation test for 128-bit types, including non power of two targets (there was a bug with broken non-power-of-two truncation in the cbe)
- add 128-bit binary not test (covers another bug fixed in the cbe)
2023-01-02 13:55:45 -07:00
kcbanner
676e4f3824 cbe: changes to get zig2.c compiling under msvc
- Add cpuid / getXCR0 functions for the cbe to use instead of asm blocks
- Don't cast between 128 bit types during truncation
- Fixup truncation to use functions for shifts / adds
- Fixup float casts for undefined values
- Add test for 128 bit integer truncation
2023-01-01 16:44:29 -05:00
kcbanner
f07d33f54b cbe: fixes for compiling zig2.c under msvc
- add zig_mul_i128
- render slice structs in static initializers without casts / c99 style init
- add negative numbers and u128 to 128-bit multiply test
2023-01-01 16:44:29 -05:00
kcbanner
5d59799641 cbe: add msvc flt atomics, re-enable test 2023-01-01 16:44:29 -05:00
kcbanner
6ed049fe36 cbe: all behaviour tests now pass on msvc
- Fix zig_clz_u128 not respecting the bits argument. This was crashing the compile-rt addxf3 tests with the cbe
- Instead of redering a negation for negative 128 bit int literals, render the literal as twos complement. This allows
rendering int representations of floats correctly (specifically f80).
2023-01-01 16:44:29 -05:00
kcbanner
6445196fab tests: disable function alignment test for cbe, add 128-bit atomicrmw tests 2023-01-01 16:44:29 -05:00
kcbanner
5470708a89 cbe: implement 128 bit atomic operations with cmpxchg loops
- Enable 128 bit atomic int tests for the cbe only
2023-01-01 16:44:29 -05:00
kcbanner
5b8245d35a tests: update "atomicrmw with ints" to test u8 through u64 2023-01-01 16:44:29 -05:00
kcbanner
2d34477dbb cbe: msvc atomics
- Implement most atomic operations for msvc
- Disable "atomicrmw with floats" test for cbe
2023-01-01 16:44:28 -05:00
kcbanner
4fe71977e0 temporarily disable asm tests 2023-01-01 16:44:28 -05:00
Veikka Tuominen
58c1d98c14 add tests for fixed stage1 bugs
Closes #4144
Closes #4255
Closes #4372
Closes #4375
Closes #4380
Closes #4417
Closes #4423
Closes #4476
Closes #4528
Closes #4562
Closes #4572
Closes #4597
Closes #4639
Closes #4672
Closes #4782
Closes #4955
Closes #4984
Closes #4997
Closes #5010
Closes #5114
Closes #5166
Closes #5173
Closes #5276
2022-12-31 20:49:02 -05:00
Andrew Kelley
9b665a59f2
Merge pull request #14101 from Vexu/stage1
add tests for fixed stage1 bugs
2022-12-29 15:33:45 -05:00
Veikka Tuominen
9a0c593a54 add tests for fixed stage1 bugs
Closes #1957
Closes #1994
Closes #2140
Closes #2746
Closes #2802
Closes #2855
Closes #2895
Closes #2981
Closes #3054
Closes #3158
Closes #3234
Closes #3259
Closes #3371
Closes #3376
Closes #3387
Closes #3529
Closes #3653
Closes #3750
Closes #3778
Closes #3882
Closes #3915
Closes #3929
Closes #3961
Closes #3988
Closes #4123
Closes #7448
2022-12-29 12:42:44 +02:00
joachimschmidt557
1caf56c5fb stage2 AArch64: implement errUnion{Err,Payload} for registers 2022-12-29 11:12:08 +01:00
Andrew Kelley
a1d82352d2 disable failing C var arg behavior tests
See tracking issue #14096
2022-12-27 23:13:03 -07:00
Andrew Kelley
5ca1753ff1 Revert "aarch64: reenable tests that are no longer regressed"
This reverts commit 3370d58956.

This commit was done with an LLVM build that did not have assertions
enabled. There are LLVM assertions being triggered due to this commit.

Reopens #10627
Reopens #12013
Reopens #12027
2022-12-27 20:54:27 -07:00
Andrew Kelley
357235d9de add behavior test for ptrcasted function pointers
See #2626. The runtime case is solved but comptime is not.
2022-12-27 15:19:00 -07:00
Andrew Kelley
6e9fbc83ca add behavior test for comptime pointer casting
comptime `@ptrCast` a subset of an array, then write through it

closes #2444
2022-12-27 14:44:04 -07:00
Andrew Kelley
f4b067743f add behavior test for optional error union return type
closes #1814
2022-12-27 13:46:57 -07:00
Andrew Kelley
19056cb682
Merge pull request #14024 from Vexu/overflow-arithmetic
Make overflow arithmetic builtins return tuples
2022-12-27 13:57:49 -05:00
Jakub Konka
aea3460cf5
Merge pull request #14084 from joachimschmidt557/stage2-aarch64
stage2 AArch64: small improvements
2022-12-27 18:59:59 +01:00
Veikka Tuominen
a777373bb8 enable test on more targets
This was fixed by 8a0a6b7387 for targets
without avx512
2022-12-27 15:34:19 +02:00
Veikka Tuominen
9c0f3163a8 value: fix bitcasting packed structs with u0 fields
Closes #13942
2022-12-27 15:33:27 +02:00
joachimschmidt557
485082064a
stage2 AArch64: implement field_parent_ptr 2022-12-27 21:26:18 +08:00
joachimschmidt557
d6e6162081
stage2 AArch64: unify callee-preserved regs on all targets
also enables many passing behavior tests
2022-12-27 21:17:52 +08:00
Veikka Tuominen
622311fb9a update uses of overflow arithmetic builtins 2022-12-27 15:13:14 +02:00
Jacob Young
81318e8704 llvm: add asserts and behavior tests for #14063
Closes #14063
2022-12-27 00:12:56 -05:00
Andrew Kelley
1b86a628ac
Merge pull request #14015 from Vexu/recursive-inline
Sema: add error for recursive inline call
2022-12-26 20:34:22 -05:00
Veikka Tuominen
81443fcde8 Sema: add error for recursive inline call
Closes #12973
2022-12-26 16:36:30 +02:00
Veikka Tuominen
3535c4b3b6 Sema: fix elem ptr type of vector in slice
Closes #14071
2022-12-26 15:26:27 +02:00
Jacob Young
64865679cf Sema: add missing resolveLazyValue cases
Closes #14032
2022-12-26 04:39:32 -05:00
Jacob Young
f5b6019646 Sema: fix missing struct layout for llvm backend
Closes #14063
2022-12-25 20:18:15 -05:00
Andrew Kelley
a193ec432d
Merge pull request #14058 from jacobly0/concat 2022-12-24 13:55:42 -05:00
Jacob Young
6f288051c1 behavior: disable tests on failing backends 2022-12-24 02:54:21 -05:00
Jacob Young
6cd8004213 Sema: relax undefined checks for concat
Closes #14037
2022-12-24 02:40:33 -05:00
Jacob Young
0559cdb554 Sema: support concat of tuple and array
Closes #14041
2022-12-24 02:40:33 -05:00
Jacob Young
fc0789f8e7 behavior: disable tests that trigger an llvm 15 bug and assertion
```
LLVM Emit Object... zig: llvm/include/llvm/ADT/APInt.h:840: void llvm::APInt::lshrInPlace(unsigned int): Assertion `ShiftAmt <= BitWidth && "Invalid shift amount"' failed.
Aborted
```

Tracked by #13782
2022-12-24 02:23:05 -05:00
travisstaloch
581d292381
fix overflow found while fuzzing
* allow file level `union {}` to parse as tuple field

this was found while fuzzing zls.

* before this patch the input `union {}` crashed the parser.  after
  this, it parses correctly just like `struct {}`.
* adds behavior tests for both inputs `struct {}` and `union {}`,
  checking that each becomes a file level tuple field.
2022-12-23 23:10:04 +02:00
Andrew Kelley
f211c1559a
Merge pull request #13960 from r00ster91/stage1cruft
Close more old stage1 issues
2022-12-22 16:36:55 -05:00