Jakub Konka
4fd4c733d4
x86_64: pass more behavior tests
2022-09-10 09:23:26 +02:00
Jakub Konka
5778077f9f
Merge pull request #12799 from joachimschmidt557/stage2-arm
...
stage2 ARM: introduce allocRegs mechanism and other improvements
2022-09-10 09:13:08 +02:00
Jacob Young
5b9c5191ab
type: print comptime on fn type params
...
This avoids the following confusing error message:
error: expected type 'fn(i32, i32) void', found 'fn(i32, i32) void'
2022-09-10 01:55:52 +03:00
Evan Haas
8e631ee3e7
translate-c: Escape non-ASCII characters that appear in macros
...
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-10 01:50:17 +03:00
joachimschmidt557
94499898e5
stage2 ARM: implement basic array_elem_val
2022-09-09 20:26:04 +02:00
joachimschmidt557
b976997e16
stage2 ARM: implement ptr_elem_val
2022-09-09 19:17:18 +02:00
joachimschmidt557
a0a7d15142
stage2 ARM: support larger function stacks
...
This is done by introducing a new Mir pseudo-instruction
2022-09-09 19:17:18 +02:00
joachimschmidt557
3794f2c493
stage2 ARM: implement struct_field_val for registers
2022-09-09 19:17:18 +02:00
joachimschmidt557
261fec8036
stage2 ARM: amend implementation of various AIR instructions
...
- 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-09 19:17:17 +02:00
joachimschmidt557
e2b029e2c8
stage2 ARM: implement field_parent_ptr
2022-09-09 19:17:17 +02:00
Jakub Konka
56b96cd61b
Merge pull request #12772 from ziglang/coff-basic-imports
...
coff: implement enough of the incremental linker to pass behavior and incremental tests on Windows
2022-09-09 13:08:58 +02:00
Jakub Konka
0ae2ea671b
wasm: temporarily save curr file pointer before pwriting on Win
...
This is a temporary workaround to an unclear platform-dependence
behavior we have in libstd for `std.fs.File` abstraction. See
https://github.com/ziglang/zig/issues/12783 for more information.
2022-09-08 14:29:54 +02:00
Veikka Tuominen
c7e45aebaf
llvm: handle pointers in packed structs in more places
...
Closes #12776
2022-09-08 12:51:40 +03:00
Veikka Tuominen
99826a2ba8
Sema: fix UAF in zirClosureGet
...
Previously if a decl failed its capture scope would be deallocated and
set to undefined which would then lead to invalid dereference in
`zirClosureGet`. To avoid this set the capture scope to a special
failed state and fail the current decl with dependency failure if
the failed state is encountered in `zirClosureGet`.
Closes #12433
Closes #12530
Closes #12593
2022-09-08 00:37:11 +03:00
Veikka Tuominen
37afab2add
Sema: preserve alignment of const decl pointers
...
Closes #12769
2022-09-08 00:37:11 +03:00
Veikka Tuominen
0fa80e66b7
Sema: correct types in @memset and @memcpy
...
Closes #12750
2022-09-08 00:37:11 +03:00
Jakub Konka
0e152b76ac
tests: force LLD off for stage2 backends until auto-select deems worthy
2022-09-07 23:16:42 +02:00
Jakub Konka
c4d297b1af
test-cases: add missing incremental x86_64-windows test cases
2022-09-07 22:42:59 +02:00
Jakub Konka
945111ae92
enable testing of x86_64-windows-gnu using self-hosted backend and linker
2022-09-07 22:42:58 +02:00
Jakub Konka
56a131d27a
test-cases: fix compiler error locations for hello world with updates
2022-09-07 22:42:57 +02:00
Jakub Konka
a35f156cf6
coff: re-enable default entrypoint for Windows
2022-09-07 22:42:55 +02:00
Evan Haas
e283a40d17
translate-c: convert tabs to \t in object-like macro string literals
...
Closes #12549
2022-09-07 14:46:58 +03:00
Veikka Tuominen
9ce841a0f0
stage2 llvm: implement aarch64 C ABI
...
... at least enough to pass all the current tests.
2022-09-04 18:46:56 +03:00
riChar
349cf54b32
llvm: fix the type parameter of GlobalAlias
...
Closes 12680
2022-09-04 18:44:45 +03:00
Veikka Tuominen
c7884af063
translate-c: do not translate packed C structs as packed Zig structs in stage2
...
Zig's integer backed packed structs are not compatible with C's packed structs.
2022-09-03 03:42:42 +03:00
Veikka Tuominen
b83c037f9f
Sema: only ABI sized packed structs are extern compatible
2022-09-03 01:04:46 +03:00
Veikka Tuominen
f281f3d10e
Sema: improve behavior of comptime_int backed enums
2022-09-02 17:57:11 +03:00
Veikka Tuominen
a9cdacff95
Sema: add error for enum tag value overflow
...
Closes #12291
2022-09-02 17:57:11 +03:00
Veikka Tuominen
7a51e0befe
Sema: fix noalias coercion error message
...
Closes #11769
2022-09-02 17:57:11 +03:00
Veikka Tuominen
1c4c68e6ba
AstGen: use reachableExpr for try operand
...
Closes #12248
2022-09-02 17:57:10 +03:00
Veikka Tuominen
db54cd247d
Sema: do not emit dbg_inline_end after NoReturn
...
Closes #12698
2022-09-02 17:57:10 +03:00
Veikka Tuominen
8b58dab78b
Sema: resolve lazy value before intToFloat
...
Closes #12698
2022-09-02 17:57:10 +03:00
Veikka Tuominen
7a8d9af4a9
stage2 llvm: correct handling of zero-bit types in unionFieldPtr
...
Pointers to zero-bit types are not zero-bit types so the function should
return something.
Closes #12716
2022-09-02 17:57:10 +03:00
Veikka Tuominen
4462d08224
stage2 llvm: fix passing packed structs to callconv(.C) functions
...
Closes #12704
2022-09-02 17:57:10 +03:00
Veikka Tuominen
2cd3989cb3
Sema: add more validation to coerceVarArgParam
...
Closes #12706
2022-09-01 13:16:33 +03:00
Veikka Tuominen
26e9839132
disable test for non-llvm backends
...
Follow up to fdb88708527742e450e4c566024d9d50ce61dd8d
2022-08-31 16:46:51 +03:00
Evan Haas
fdb8870852
translate-c: promote large integer macros to unsigned long long if necessary
...
Closes #10793
Co-authored-by: Veikka Tuominen <git@vexu.eu>
2022-08-31 15:52:53 +03:00
Luuk de Gram
4ba0ad295f
Merge pull request #12687 from Luukdegram/wasm-extern-globals
...
wasm-linker: implement non-function extern variables
2022-08-31 13:44:06 +02:00
Andrew Kelley
7377dce368
avoid exposing supportsTailCall in the standard library
...
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-30 12:50:15 -07:00
Veikka Tuominen
65d3723968
Sema: check that target supports tail calls
2022-08-30 12:22:07 -07:00
Veikka Tuominen
c558de6655
stage2 llvm: use tag value instead of field index in airUnionInit
...
Closes #12656
2022-08-30 12:22:07 -07:00
Veikka Tuominen
d3b4b2edf1
Sema: shift of comptime int with runtime value
...
Closes #12290
2022-08-30 12:22:07 -07:00
Veikka Tuominen
01d19a8d3c
Sema: do not emit generic poison for non generic parameters
...
Closes #12679
2022-08-30 12:22:07 -07:00
Veikka Tuominen
67a44211f7
Sema: improve handling of always_tail call modifier
...
Closes #4301
Closes #5692
Closes #6281
Closes #10786
Closes #11149
Closes #11776
2022-08-30 12:22:07 -07:00
Luuk de Gram
8627858bbc
test/link: add test for extern resolution
...
Adds a linker tests to verify extern/undefined symbols
representing non-functions are being resolved correctly.
2022-08-30 18:32:08 +02:00
Jakub Konka
e57fbe8069
test-cases: fix compiler error locations for hello world with updates
2022-08-30 11:01:08 +02:00
Andrew Kelley
d2d42cf7ba
Merge pull request #12641 from Luukdegram/wasm-c-types
...
stage2: fix size of c_longdouble for Wasm target
2022-08-29 18:21:38 -04:00
Veikka Tuominen
a4b52ccd9f
Sema: fix access of inactive union field when enum and union fields are in different order
...
Closes #12667
2022-08-29 13:45:37 -07:00
Luuk de Gram
1eb22e7ad6
wasm: skip unimplemented behavior test
...
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-28 17:50:07 +02:00
Veikka Tuominen
15cc4514e0
Sema: add missing calls to resolveStructLayout
...
Closes #12645
2022-08-28 15:41:21 +03:00