Commit Graph

5627 Commits

Author SHA1 Message Date
mlugg
d5f1a8823e Sema: allow ptr field access on pointer-to-array
Also remove an incorrect piece of logic which allowed fetching the 'len'
property on non-single-ptrs (e.g. many-ptrs) and add a corresponding
compile error test case.

Resolves: #4765
2023-04-20 09:05:22 -07:00
Andrew Kelley
30fc160874
Merge pull request #15302 from jacobly0/x86_64-non-liveness
x86_64: liveness independent fixes
2023-04-18 17:28:19 -07:00
Jakub Konka
1fb0b5a044
Merge pull request #15308 from kcbanner/dynlib_lookup_alignment
DynLib.lookup: cast the pointer to the correct alignment
2023-04-17 12:02:57 +02:00
Jacob Young
4df87b40fd tests: fix skip_cross_glibc check
Native targets are, by definition, not cross-compiling targets.
2023-04-16 17:36:02 -07:00
Jacob Young
7e0c6d7edc Sema: fix empty infinite loops
Closes #15284
2023-04-17 02:30:10 +03:00
Jacob Young
780f654e19 behavior: disable flaky test on x86_64
Also reenable stage2_x86_64 windows behavior tests in case it is failing
for the same reason.

Closes #15324
2023-04-16 17:07:07 -04:00
Jacob Young
c1a2da6b78 x86_64: implement packed load and store 2023-04-16 17:05:35 -04:00
Luuk de Gram
7fad555e5e
Merge pull request #15271 from Luukdegram/wasm-start
wasm: no longer use simplified `start.zig` logic
2023-04-16 22:16:53 +02:00
kcbanner
956caf6eba re-enable load_dynamic_library standalone tests 2023-04-16 12:01:54 -04:00
Andrew Kelley
9e6647582d disable x86_64-windows self-hosted backend behavior tests
because they are not passing on the CI yet.
2023-04-15 12:45:47 -07:00
Andrew Kelley
e9d854743a disable more failing C backend tests 2023-04-15 10:33:08 -07:00
Andrew Kelley
a281d29881 disable not-yet-passing C backend tests 2023-04-15 10:33:08 -07:00
Andrew Kelley
29c8d93b82 disable not-yet-passing test suites
* wasm32-wasi compiler_rt tests
 * std lib tests with the C backend
2023-04-15 10:33:08 -07:00
Andrew Kelley
4a233d1871 CI: more C backend test coverage
The CI now runs C backend tests in addition to compiling them. It uses
-std=c99 -pedantic -Werror in order to catch non-conformant C code.

This necessitated disabling a test case that caused a C compile error,
in addition to disabling a handful of warnings that are already being
triggered by Zig's C backend output for the behavior tests.

The upshot is that I was able to, very cleanly, integrate the C backend
tests into the build system, so that it communicates via the test runner
protocol along with all the other behavior tests.
2023-04-15 10:33:08 -07:00
Andrew Kelley
3c93c1664a tests: avoid skipping native tests
Make the test targets use options that match the actual options of
CompileStep. This makes the code more straightforward, and ends up
making fewer tests incorrectly skipped. For example, now the CI runner
on Windows will no longer skip self-hosted x86_64 backend tests.
2023-04-15 10:33:08 -07:00
Luuk de Gram
3ad092e1e7
test-link: update type link test due start.zig 2023-04-14 15:25:45 +02:00
Luuk de Gram
25e3851fe0
Merge pull request #15257 from Luukdegram/wasm-tagname
wasm: Implement `@tagName` instruction
2023-04-13 19:32:22 +02:00
Jacob Young
caa3d6a4f4 x86_64: fix constant pointers to zero-bit types
These non-dereferencable pointers still need to have the correct
alignment and non-null-ness.
2023-04-13 04:17:47 -04:00
Jacob Young
3b22ce8264 x86_64: fix atomic loop implementation 2023-04-13 04:17:47 -04:00
Jacob Young
0165187cd0 x86_64: fix some of the mass confusion about the meaning of MCValue 2023-04-13 04:17:47 -04:00
Luuk de Gram
abc1e52e08
wasm: enable @tagName behavior tests 2023-04-12 22:23:36 +02:00
mlugg
ccf670c2b0 Zir: implement explicit block_comptime instruction
Resolves: #7056
2023-04-12 12:06:19 -04:00
Andrew Kelley
3c3cee2cfa fix build logic due to state mutations and break the API accordingly
* remove setName, setFilter, and setTestRunner. Please set these
   options directly when creating the CompileStep.
 * removed unused field
 * remove computeOutFileNames and inline the logic, making clear the
   goal of avoiding state mutations after the build step is created.
2023-04-11 08:42:14 -07:00
Andrew Kelley
60eabc0eca std.Build.CompileStep: remove run() and install()
These functions are problematic in light of dependencies because they
run and install, respectively, for the *owner* package rather than for
the *user* package. By removing these functions, the build script is
forced to provide the *Build object to associate the new step with,
making everything less surprising.

Unfortunately, this is a widely breaking change.

see #15079
2023-04-10 18:35:14 -07:00
Andrew Kelley
a2793f8ab8
Merge pull request #14853 from schmee/vector-peer-type-resolution
Vector type resolution/coercion fixes
2023-04-10 12:21:55 -04:00
Robin Voetter
f12beb857a
amdgpu,nvptx: unify kernel calling conventions
AmdgpuKernel and NvptxKernel are unified into a Kernel calling convention.
There is really no reason for these to be separate; no backend is allowed to
emit the calling convention of the other. This is in the same spirit as the
.Interrupt calling convention lowering to different LLVM calling conventions,
and opens the way for SPIR-V kernels to be exported using the Kernel calling
convention.
2023-04-09 01:51:54 +02:00
Auguste Rame
7225a15abe
Enable new tests 2023-04-07 20:55:04 -04:00
Luuk de Gram
4ebf483e0d
Merge pull request #14668 from Techatrix/wasm-floatops
wasm: implement float operations with compiler-rt
2023-04-07 18:22:41 +02:00
mlugg
1059b57898
Liveness: defer deaths of externally-scoped instructions in loop bodies 2023-04-07 01:29:20 +01:00
Andrew Kelley
13aa7871b2
Merge pull request #15101 from motiejus/glibc_compat
glibc: add backwards compatibility for some symbols
2023-04-06 17:15:58 -04:00
Andrew Kelley
f289277599 Merge remote-tracking branch 'origin/master' into llvm16 2023-04-05 22:05:31 -07:00
Veikka Tuominen
66520c8342 Sema: validate array element types
Fixes the compiler crash part of #15175
2023-04-05 14:45:56 +03:00
Veikka Tuominen
82a6acca93 Sema: implement inline switch capture at comptime
Closes #15157
2023-04-05 14:45:56 +03:00
Jacob Young
83b7dbe52f cases: disable failing incremental tests
Enabling start.zig logic breaks incremental compilation
See #15174
2023-04-04 12:48:21 -04:00
Jacob Young
c91929090d start: disable extra start logic on various x86_64 subtargets 2023-04-03 15:19:07 -04:00
Jacob Young
821eb595f4 x86_64: implement cmp_lt_errors_len 2023-04-03 15:19:07 -04:00
Jacob Young
5900dc0580 x86_64: fix typos 2023-04-03 18:02:55 +02:00
Jacob Young
f0d13489f8 Elf: add program headers for the program header table 2023-04-03 17:45:17 +02:00
Jacob Young
1980f5479b x86_64: implement store to immediate address 2023-04-03 17:45:16 +02:00
Jacob Young
272acb7ee5 x86_64: implement storing large immediates 2023-04-03 17:45:16 +02:00
Jacob Young
f4b411314c Sema: defer stores to inferred allocs
This lets us generate the store with knowledge of the type to be stored.
Therefore, we can avoid generating garbage Air with stores through
pointers to comptime-only types which backends cannot lower.

Closes #13410
Closes #15122
2023-04-02 18:05:44 +03:00
Jacob Young
f4359531b1 x86_64: implement shl with overflow 2023-04-02 06:11:12 -04:00
Jacob Young
0e289cc826 x86_64: implement large add/sub with overflow 2023-04-02 05:16:46 -04:00
Jacob Young
b80cdde4f0 x86_64: implement struct_field_val for large packed structs 2023-04-02 04:49:53 -04:00
Jacob Young
83a208c355 x86_64: implement large cmp 2023-04-02 04:49:53 -04:00
Jacob Young
677427bc3a x86_64: implement error name 2023-04-02 04:49:53 -04:00
Jacob Young
ac68d72d24 x86_64: implement aggregate init of a packed struct 2023-04-02 04:49:53 -04:00
Jakub Konka
43a6384e9c link-test: adjust test/link/bugs/macho/13056 to latest changes on macOS 13.3
Latest macOS 13.3 rolled out LLVM 15 and thus the way `nullptr_t` is
defined within the `libc++`:

157bbe6aea

This seems to require including `/usr/include` with `-isystem` directive
rather than `-I`. Otherwise we get clang miscompilation issues due to
missing `nullptr_t` declaration.
2023-04-02 10:18:43 +02:00
Jakub Konka
e0bf7b6424 link-test: skip foreign checks in entry_in_archive MachO test 2023-04-01 20:02:33 +02:00
Jakub Konka
a88c0b4d08 link: handle -u flag in all linkers
Also clean up parsing of linker args - reuse `ArgsIterator`.

In MachO, ensure we add every symbol marked with `-u` as undefined
before proceeding with symbol resolution. Additionally, ensure those
symbols are never garbage collected.

MachO entry_in_dylib test: pass `-u _my_main` when linking executable
so that it is not incorrectly garbage collected by the linker.
2023-04-01 14:22:44 +02:00