Commit graph

7436 commits

Author SHA1 Message Date
WillLillis
28383d4d98 fix(Sema): patch segfault in finishStructInit 2024-09-01 17:31:00 +03:00
mlugg
c3fb30803f
behavior: avoid field/decl name conflicts 2024-08-29 23:43:52 +01:00
mlugg
605f2a0978
cases: update for new error wording, add coverage for field/decl name conflict 2024-08-29 23:43:52 +01:00
Jacob Young
6a21875ddb
Merge pull request #21230 from jacobly0/stack-trace
Dwarf: fix self-hosted stack traces
2024-08-28 17:39:35 -04:00
Jacob Young
4cc16fd6f7 Dwarf: fix and test inline function bugs 2024-08-28 04:25:08 -04:00
mlugg
0fe3fd01dd
std: update std.builtin.Type fields to follow naming conventions
The compiler actually doesn't need any functional changes for this: Sema
does reification based on the tag indices of `std.builtin.Type` already!
So, no zig1.wasm update is necessary.

This change is necessary to disallow name clashes between fields and
decls on a type, which is a prerequisite of #9938.
2024-08-28 08:39:59 +01:00
Jacob Young
8c3f6c72c0 Dwarf: fix and test string format 2024-08-27 02:09:59 -04:00
mlugg
93cb44c805 translate-c: support GCC/Clang pointer subtraction extension
Pointer subtraction on `void *` or function pointers is UB by the C
spec, but is permitted by GCC and Clang as an extension. So, avoid
crashing translate-c in such cases, and follow the extension behavior --
there's nothing else that could really be intended.
2024-08-27 06:43:40 +01:00
mlugg
4c0f021c2e
behavior: import unintentionally excluded file from behavior.zig
And remove the now-invalid test for the return value of `@branchHint`.
2024-08-27 00:44:35 +01:00
mlugg
f47f6d766e
behavior,cases: add @branchHint test coverage 2024-08-27 00:44:35 +01:00
mlugg
6808ce27bd
compiler,lib,test,langref: migrate @setCold to @branchHint 2024-08-27 00:44:35 +01:00
mlugg
a3a737e9a6
lib,test,tools,doc: update usages of @export 2024-08-27 00:44:35 +01:00
Andrew Kelley
849c31a6cc
Merge pull request #21177 from alexrp/elf-coff-conv
`std.{coff,elf}`: Remove the `{MachineType,EM}.toTargetCpuArch()` functions.
2024-08-25 14:49:53 -07:00
mlugg
7d54c62c8a incremental: fix adding/removing aggregate fields
I don't recall why I put these checks here -- they aren't correct. We
can freely recreate a type even if its fields have changed, because we
are going to re-do all type resolution.

The only conditions for recreations are (a) the ZIR index must not be
lost and (b) the number of captures must be the same. These conditions
are permissible because if either is violated, we can guarantee that
analysis of a valid `zirStructDecl` (etc) will never reference this
type (since the ZIR index has just been tracked, and the captures have
just been created based on the ZIR).

Adds a corresponding test case.

Resolves: #21185
2024-08-24 20:30:52 +01:00
Alex Rønne Petersen
a69f55a7cc
std.{coff,elf}: Remove the {MachineType,EM}.toTargetCpuArch() functions.
These are fundamentally incapable of producing accurate information for reasons
I've laid out in #20771. Since our only use of these functions is to check that
object files have the correct machine type, and since #21020 made
`std.Target.to{Coff,Elf}Machine()` more accurate, just switch these checks over
to that and compare the machine type tags instead.

Closes #20771.
2024-08-23 19:56:24 +02:00
Jacob Young
c6286eee4b
Merge pull request #21170 from jacobly0/more-dwarf-cleanup
Dwarf: more cleanup
2024-08-22 23:20:53 -04:00
Andrew Kelley
ee84deda98
Merge pull request #21095 from alexrp/mips64-tests
Get `mips64(el)-linux` working and start testing it
2024-08-22 20:09:08 -07:00
Jacob Young
4a132d4bce Type: fix inconsistency between zig fmt and @typeName 2024-08-22 20:08:04 -04:00
Jakub Konka
fa79f53f92 test/macho: simplify testing range extension thunks 2024-08-22 00:36:47 +02:00
Jakub Konka
ca417e1e32 link/elf: simplify how we test thunks 2024-08-21 23:05:28 +02:00
Jakub Konka
b2fad5c58b test/debugger: test emitting relocs by ELF linker 2024-08-21 01:43:21 -04:00
mlugg
a99ad52b36
Sema: register correct dependencies for inline calls
And add a corresponding test case.
2024-08-21 01:30:46 +01:00
mlugg
2fb78430db
test: remove accidental hard tab 2024-08-21 01:30:46 +01:00
mlugg
ceb76b2ba7
test: add incremental compilation test for moving @src() call 2024-08-21 01:30:46 +01:00
Jacob Young
eaa227449c Dwarf: fix issues with inline call sites 2024-08-20 15:08:23 -04:00
Robin Voetter
80999391d9
re-enable emit_asm_and_bin and emit_llvm_no_bin tests
These were fixed during the last few commits too. The emit_llvm_no_bin test
is renamed from the issue_12588 test.

Closes #17484
2024-08-19 19:09:13 +02:00
Robin Voetter
294ca6563e
add standalone test for only dependending on the emitted assembly and not the bin 2024-08-19 19:09:13 +02:00
Matthew Lugg
54e48f7b7d
Merge pull request #21128 from mlugg/incremental
incremental: more progress
2024-08-19 06:30:54 +01:00
Jacob Young
9a64b80377 Dwarf: test enums 2024-08-18 16:21:11 -04:00
Jacob Young
49e6041391 Dwarf: fix and test unions 2024-08-18 16:21:10 -04:00
mlugg
a239d8d4e2
test: add incremental case 2024-08-18 18:10:59 +01:00
Alex Rønne Petersen
3e8ac8e23f test: Add mips64(el)-linux-(none,musl,gnuabi64) targets.
These take 3-4 minutes to run on my machine, i.e. they're not affected by the
LLVM compilation speed bug that affects mips32.
2024-08-18 07:27:23 +02:00
Alex Rønne Petersen
ecbc701376 test: Disable vector reduce operation on mips64.
https://github.com/ziglang/zig/issues/21091
2024-08-18 07:27:23 +02:00
Alex Rønne Petersen
d4d6b23d64 test: Disable @min/max for floats on mips64.
https://github.com/ziglang/zig/issues/21090
2024-08-18 07:27:23 +02:00
mlugg
1ccbc6ca20 test: add new incremental test
This case is adapted from #11344, and passes with `-fno-emit-bin`.

Resolves: #11344
2024-08-17 18:50:10 -04:00
mlugg
936a79f428 tools,test: improve incr-check and add new incremental tests 2024-08-17 18:50:10 -04:00
mlugg
b65865b027 tools: improve incr-check
And add a new incremental test to match!
2024-08-17 18:50:10 -04:00
Jacob Young
d4e3d0e676 Dwarf: fix and test error unions 2024-08-17 09:27:15 -04:00
Jacob Young
f601aa780e Dwarf: fix and test allowzero pointers 2024-08-17 05:57:45 -04:00
Jacob Young
7a0acc8be6 Dwarf: fix cross-module inline function line info 2024-08-16 15:22:56 -04:00
Jacob Young
ef11bc9899 Dwarf: rework self-hosted debug info from scratch
This is in preparation for incremental and actually being able to debug
executables built by the x86_64 backend.
2024-08-16 15:22:55 -04:00
Jakub Konka
90989be0e3
Merge pull request #21065 from ziglang/elf-zig-got
elf: replace .got.zig with a zig jump table
2024-08-16 21:19:44 +02:00
David Rubin
f1eed99f3d
add an error for stack allocations in naked functions (#21082)
closes #72
2024-08-16 09:41:58 -07:00
Jakub Konka
9473d76449 test/elf: enhance testImportingDataDynamic 2024-08-15 21:47:34 +02:00
David Rubin
2e8351cc9e elf: fix up riscv for .got.zig rewrite 2024-08-15 08:53:41 +02:00
Alex Rønne Petersen
b6009a7416
build/test: Add -Dtest-slow-targets and move mips module tests behind it.
The idea is that these tests are just too slow to include by default on a
contributor's local machine. If they want to run these, they need to opt in.
2024-08-14 07:03:23 +02:00
Alex Rønne Petersen
3b51b43dc8
build/test: Add -Dtest-target-filter for filtering module tests by target triple.
This is useful during porting work where you're not interested in running all
targets all the time while iterating on changes.
2024-08-14 07:03:23 +02:00
Alex Rønne Petersen
019c0fc184
test: Re-enable mips(el)-linux-gnueabihf tests.
Closes #4927.
2024-08-14 06:52:05 +02:00
Andrew Kelley
0b5ea2b902
Merge pull request #21053 from alexrp/mips-tests
`test`: Re-enable `mips(el)-linux(-musl)` tests.
2024-08-13 11:48:33 -07:00
Alex Rønne Petersen
eadc0c01cc test: Re-enable armv8-linux-gnueabihf tests.
Closes #3287.
2024-08-13 00:57:49 -07:00