zig/test
mlugg 4976b58ab1
Prevent analysis of functions only referenced at comptime
The idea here is that there are two ways we can reference a function at runtime:

* Through a direct call, i.e. where the function is comptime-known
* Through a function pointer

This means we can easily perform a form of rudimentary escape analysis
on functions. If we ever see a `decl_ref` or `ref` of a function, we
have a function pointer, which could "leak" into runtime code, so we
emit the function; but for a plain `decl_val`, there's no need to.

This change means that `comptime { _ = f; }` no longer forces a function
to be emitted, which was used for some things (mainly tests). These use
sites have been replaced with `_ = &f;`, which still triggers analysis
of the function body, since you're taking a pointer to the function.

Resolves: #6256
Resolves: #15353
2023-05-29 23:06:08 +01:00
..
behavior Prevent analysis of functions only referenced at comptime 2023-05-29 23:06:08 +01:00
c_abi
cases Prevent analysis of functions only referenced at comptime 2023-05-29 23:06:08 +01:00
link Prevent analysis of functions only referenced at comptime 2023-05-29 23:06:08 +01:00
src std.fs.file: Rename File.Kind enum values to snake case 2023-05-25 20:17:07 +01:00
standalone fix keepalive and large buffered writes 2023-05-06 21:35:16 -05:00
assemble_and_link.zig
behavior.zig fix #15778: Binary operations on empty vectors crash 2023-05-29 13:01:11 +03:00
cases.zig re-enable test-cases and get them all passing 2023-03-15 10:48:14 -07:00
cbe.zig re-enable test-cases and get them all passing 2023-03-15 10:48:14 -07:00
compare_output.zig
compile_errors.zig Port some stage1 test cases to stage2 2023-03-20 19:55:50 -04:00
gen_h.zig
link.zig Merge pull request #15101 from motiejus/glibc_compat 2023-04-06 17:15:58 -04:00
nvptx.zig amdgpu,nvptx: unify kernel calling conventions 2023-04-09 01:51:54 +02:00
run_translated_c.zig
stack_traces.zig
standalone.zig std.http: add simple standalone http tests, add state check for http server 2023-05-06 21:35:15 -05:00
tests.zig Fixes WriteFile.getFileSource failure on Windows (#15730) 2023-05-24 14:26:07 -07:00
translate_c.zig translate-c: fix codegen when C source has variables named the same as mangling prefixes 2023-04-26 17:30:46 +03:00