Commit Graph

4531 Commits

Author SHA1 Message Date
Luuk de Gram
8033767082
wasm-linker: Implement linker tests (#12006)
* test/link: initial wasm support

This adds basic parsing and dumping of wasm section so they
can be tested using the new linker-test infrastructure.

* test/link: all wasm sections parsing and dumping

We now parse and dump all sections for the wasm binary format.
Currently, this only dumps the name of a custom section.
Later this should also dump symbol table, name, linking metadata and relocations.
All of those live within the custom sections.

* Add wasm linker test

This also fixes a parser mistake in reading the flags.

* test/link: implement linker tests wasm & fixes

Adds several test cases to test the wasm self-hosted linker.
This also introduces fixes that were caught during the implementation
of those tests.

* test-runner: obey omit_stage2 for standalone

When a standalone test requires stage2, but stage2 is omit
from the compiler, such test case will not be included as part
of the test suite that is being ran. This is to support CI's
where we omit stage2 to lower the memory usage.
2022-07-12 14:36:33 +02:00
Andrew Kelley
7d2e142679
Merge pull request #12044 from Vexu/stage2-compile-errors
Sema: add detailed error notes to `coerceInMemoryAllowed`
2022-07-11 20:45:27 -04:00
Andrew Kelley
dc815e5e8f
Merge pull request #12075 from Vexu/stage2-validate-extern
Stage2 validate extern types
2022-07-11 20:25:35 -04:00
r00ster91
da75eb0d79
Compilation: indent multiline error messages properly
Co-authored-by: Veikka Tuominen <git@vexu.eu>
2022-07-12 00:10:39 +03:00
Veikka Tuominen
122c76a167 Sema: allow void as an extern union field & fix invalid extern unions 2022-07-11 20:30:16 +03:00
Veikka Tuominen
d00da05ecb Sema: validate extern types 2022-07-11 18:47:29 +03:00
Veikka Tuominen
3ceb27c840 Sema: better explanation why opaque types require comptime 2022-07-11 18:47:29 +03:00
Veikka Tuominen
20d4f7213d Sema: add notes about function return type 2022-07-11 17:55:19 +03:00
Veikka Tuominen
c9e1360cdb Sema: add "cannot convert to payload type" error notes 2022-07-11 14:17:22 +03:00
Veikka Tuominen
0370006c1f Sema: only add note about int mismatch if not coercible
`unsigned 64-bit int cannot represent all possible unsigned 63-bit values`
is nonsensical.
2022-07-11 11:59:26 +03:00
Cody Tapscott
d182e2ebda stage1: Lower libcalls on Windows x86-64 correctly
This change is the Zig counterpart to https://reviews.llvm.org/D110413

Since we lower some libcalls directly (just like clang does), we need to
make sure that the ABI we call with matches the ABI of the compiler-rt
we are providing (and also the ABI expected by LLVM).

While I was at it, I noticed some flawed vector handling in the binary
soft float ops in stage 1, so I shored up the logic a bit and expanded
an existing test to cover the missing functionality.
2022-07-10 20:52:28 -07:00
Veikka Tuominen
34fe2b4f4b Sema: prefer original error message in coerce 2022-07-10 23:47:56 +03:00
Veikka Tuominen
b9f01bc394 Sema: add detailed error notes to coerceInMemoryAllowed 2022-07-10 23:15:17 +03:00
Andrew Kelley
b88151e0e1
Merge pull request #12001 from ziglang/llvm14
Upgrade to LLVM 14
2022-07-10 03:06:05 -04:00
Andrew Kelley
e0d5ae75af these riscv64 behavior tests work for stage1 but not stage2 2022-07-09 12:48:59 -07:00
Andrew Kelley
a1c56ffd5a disable regressed translate-c test case on freebsd
see #12055
2022-07-08 23:17:41 -07:00
Andrew Kelley
f976758855 disable failing riscv64 tests from LLVM 14 upgrade
See #12054
2022-07-08 23:11:03 -07:00
Cody Tapscott
c830606bbe stage2: Support @fieldParentPtr for tuples and anon structs 2022-07-08 19:52:23 -07:00
Cody Tapscott
51a8f52e6c stage2: Support @offsetOf for tuples and anon structs 2022-07-08 19:51:35 -07:00
Cody Tapscott
2fff25fd22 stage2: Support initializing anonymous struct type
This commit adds support for initializing `.anon_struct` types. There
is also some follow-up work to do for both tuples and structs regarding
comptime fields, so this also adds some tests to keep track of that
work.
2022-07-08 19:50:28 -07:00
Andrew Kelley
6a3a0fe7ae Merge remote-tracking branch 'origin/master' into llvm14 2022-07-07 18:25:01 -07:00
Cody Tapscott
cbc85f4516 stage1: Fix seg-fault when slicing string literal with sentinel 2022-07-08 02:14:38 +03:00
VÖRÖSKŐI András
75c33ba85e Sema: add a note about @setEvalBranchQuota() when branch quota is exceeded
closes #11996
2022-07-08 02:13:33 +03:00
Andrew Kelley
8e07b0c4b9 Merge remote-tracking branch 'origin/master' into llvm14 2022-07-07 14:01:54 -07:00
Andrew Kelley
0c78ece1c9
Merge pull request #12016 from Vexu/stage2-compile-errors
Stage2 compile error improvements
2022-07-07 14:52:28 -04:00
r00ster91
6f17be063d
std.log: give friendly error to freestanding users 2022-07-07 21:40:31 +03:00
emma
81bbefe9b8
AstGen: fix catch payoad not checking for shadowing 2022-07-07 21:38:32 +03:00
Veikka Tuominen
b5ac2b4330 Sema: improve array source location 2022-07-07 10:50:06 +03:00
Veikka Tuominen
27ee414159 Sema: improve slice source locations 2022-07-07 10:50:06 +03:00
Veikka Tuominen
89cef9f5f7 stage2: make line field of @src runtime known 2022-07-07 10:50:06 +03:00
Veikka Tuominen
226994cd7e Sema: misc error message fixes 2022-07-07 10:50:06 +03:00
Veikka Tuominen
c07c2d68c7 Sema: more runtime indexing comptime value checks 2022-07-07 10:50:06 +03:00
Veikka Tuominen
1569b9c165 Sema: validate pointer types 2022-07-07 10:50:05 +03:00
Veikka Tuominen
299836dbd9 Sema: panic at comptime + misc error message improvements 2022-07-07 10:50:05 +03:00
Andrew Kelley
1b610d7853 Merge remote-tracking branch 'origin/master' into llvm14 2022-07-06 17:55:05 -07:00
Andrew Kelley
c061b3a572 disable more standalone tests
these are tripping LLVM 13 assertions.

See #12015
See #12022
2022-07-06 15:10:41 -07:00
Andrew Kelley
6164801efb update install_raw_hex test case
LLVM 14 optimizes differently, so it's reasonable to have there be a
binary difference here.
2022-07-06 11:52:21 -07:00
Andrew Kelley
fa40bddf27 Merge remote-tracking branch 'origin/master' into llvm14 2022-07-06 02:40:05 -07:00
Andrew Kelley
aab1284e10 disable failing standalone test - tools/gen_spirv_spec.zig
Because it is tripping an LLVM 13 assertion.

See #12015
2022-07-06 02:39:28 -07:00
Andrew Kelley
d8fc8d0118 compiler_rt: work around LLVM optimizing __muloti4 to call itself
This is a workaround for
https://github.com/llvm/llvm-project/issues/56403
2022-07-05 21:28:39 -07:00
Andrew Kelley
558ad19095 disable regressed behavior tests from llvm 14
See #12012
See #12013
2022-07-05 18:50:03 -07:00
Andrew Kelley
9a5c7b4b4d Merge remote-tracking branch 'origin/master' into llvm14 2022-07-05 16:24:18 -07:00
Andrew Kelley
f639cb33a9 fix expected error messages in test cases 2022-07-05 16:22:53 -07:00
Andrew Kelley
844b77e3bc remove sparc64 test case which is tripping llvm assertion
See #12011
2022-07-05 16:22:53 -07:00
Andrew Kelley
e8ce1728e9 disable regressed wasm32 behavior tests from LLVM 14 2022-07-05 15:46:12 -07:00
Andrew Kelley
388520a40b fix behavior test which was relying on UB 2022-07-05 15:22:19 -07:00
Cody Tapscott
86570b3e2c stage2: Fix corrupted Type when de-referencing field pointer 2022-07-05 15:02:13 -04:00
Andrew Kelley
f59bd2be53 Merge remote-tracking branch 'origin/master' into llvm14 2022-07-04 14:07:08 -07:00
Veikka Tuominen
050fef3c23 translate-c: do not try to get rid of do while loop
It might contain breaks and continues.

Closes #11994
2022-07-04 21:56:54 +03:00
Andrew Kelley
b698168664 stage2: update vector alignment logic
This follows LLVM14's lead on vector alignment, which computes byte
count based on the length premultiplied by bits.

This commit also disables behavior tests regressed by LLVM 14, only for
stage1. stage2 fortunately does not trip the regression.
2022-07-03 13:33:09 -07:00