aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/array.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2021-08-06 19:40:55 -0700
committerAndrew Kelley <andrew@ziglang.org>2021-08-06 19:53:04 -0700
commit7d0de54ad44832589379a4bcbba493db2087bebf (patch)
tree5efb0a82c4ad399e25f603ba25cc6e36566ca845 /test/behavior/array.zig
parente974d4c4295c4fbdbc239caa2cf2d653f65662f1 (diff)
downloadzig-7d0de54ad44832589379a4bcbba493db2087bebf.tar.gz
zig-7d0de54ad44832589379a4bcbba493db2087bebf.zip
stage2: fix return pointer result locations
* Introduce `ret_load` ZIR instruction which does return semantics based on a corresponding `ret_ptr` instruction. If the return type of the function has storage for the return type, it simply returns. However if the return type of the function is by-value, it loads the return value from the `ret_ptr` allocation and returns that. * AstGen: improve `finishThenElseBlock` to not emit break instructions after a return instruction in the same block. * Sema: `ret_ptr` instruction works correctly in comptime contexts. Same with `alloc_mut`. The test case with a recursive inline function having an implicitly comptime return value now has a runtime return value because of the fact that it calls a function in a non-comptime context.
Diffstat (limited to 'test/behavior/array.zig')
0 files changed, 0 insertions, 0 deletions