Fork of daniellemaywood.uk/gleam — Wasm codegen work
531 B
15 lines
1%% SPDX-License-Identifier: Apache-2.0
2%% SPDX-FileCopyrightText: 2026 The Gleam contributors
3
4-module(main_ffi).
5-export([spawn_and_exit/0]).
6
7%% Spawn a linked process that exits with a non-standard reason.
8%% This tests that the @@main.erl template handles exit reasons
9%% that aren't {Reason, StackTrace} tuples (issue #4766).
10spawn_and_exit() ->
11 spawn_link(fun() ->
12 exit({shutdown, <<"test reason">>})
13 end),
14 %% Wait briefly to ensure the linked process exits and kills us
15 receive after 100 -> nil end.