test_gen: get wasm linking test working with DCE

This commit is contained in:
Brian Carroll 2022-07-10 08:43:34 +01:00 committed by Folkert
parent 0b0c54d676
commit 66a7955475
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C

View file

@ -37,7 +37,10 @@ pub fn main() !void {
const host = host_called_directly_from_main();
const js = js_called_directly_from_main();
const app = roc__app_proc_1_exposed();
host_result = host | js | app;
// Make sure read_host_result is not eliminated! We know it's zero.
const avoid_dead_code_elim = read_host_result();
host_result = host | js | app | avoid_dead_code_elim;
if (@import("builtin").target.cpu.arch != .wasm32) {
const stdout = @import("std").io.getStdOut().writer();