diff --git a/tests/general/sigabrt.c b/tests/general/sigabrt.c new file mode 100644 index 0000000..4864db6 --- /dev/null +++ b/tests/general/sigabrt.c @@ -0,0 +1,11 @@ +#include +#include +#include + +int main(void) +{ + fprintf("raising SIGABRT...\n"); + raise(SIGABRT); + fprintf("oops!\n"); + return EXIT_FAILURE; +} diff --git a/tests/general/sigabrt.c.exit_status.expected b/tests/general/sigabrt.c.exit_status.expected new file mode 100644 index 0000000..405e2af --- /dev/null +++ b/tests/general/sigabrt.c.exit_status.expected @@ -0,0 +1 @@ +134 diff --git a/tests/general/sigabrt.c.options b/tests/general/sigabrt.c.options new file mode 100644 index 0000000..4f07a3e --- /dev/null +++ b/tests/general/sigabrt.c.options @@ -0,0 +1 @@ +-D_WASI_EMULATED_SIGNAL -lwasi-emulated-signal diff --git a/tests/general/sigabrt.c.stderr.expected b/tests/general/sigabrt.c.stderr.expected new file mode 100644 index 0000000..bd41dbd --- /dev/null +++ b/tests/general/sigabrt.c.stderr.expected @@ -0,0 +1,7 @@ +raising SIGABRT... +Error: failed to run main module `sigabrt.c.---.wasm` + +Caused by: + 0: failed to invoke `_start` + 1: wasm trap: unreachable, source location: @---- + wasm backtrace: diff --git a/tests/general/sigabrt.c.stderr.expected.filter b/tests/general/sigabrt.c.stderr.expected.filter new file mode 100755 index 0000000..425b060 --- /dev/null +++ b/tests/general/sigabrt.c.stderr.expected.filter @@ -0,0 +1,7 @@ +#!/bin/bash +set -euo pipefail + +cat \ + | sed -e 's/main module `sigabrt\.c\.[^`]*\.wasm`/main module `sigabrt.c.---.wasm`/' \ + | sed -e 's/source location: @[[:xdigit:]]*$/source location: @----/' \ + | head -n 6