mirror of
https://github.com/fluencelabs/wasmer
synced 2024-12-13 14:25:32 +00:00
29 lines
767 B
C
29 lines
767 B
C
|
/*
|
||
|
* Copyright 2017 The Emscripten Authors. All rights reserved.
|
||
|
* Emscripten is available under two separate licenses, the MIT license and the
|
||
|
* University of Illinois/NCSA Open Source License. Both these licenses can be
|
||
|
* found in the LICENSE file.
|
||
|
*/
|
||
|
|
||
|
#include <setjmp.h>
|
||
|
#include <stdio.h>
|
||
|
|
||
|
// TODO: Once signals are supported, improve this test to verify preservation of signals state
|
||
|
|
||
|
int main() {
|
||
|
sigjmp_buf env;
|
||
|
volatile int flag = 0;
|
||
|
if (sigsetjmp(env, 1) == 0) {
|
||
|
// Cannot print anything here, because siglongjmp will
|
||
|
// print a warning in between but only with ASSERTIONS enabled
|
||
|
flag = 1;
|
||
|
siglongjmp(env, 1);
|
||
|
} else {
|
||
|
if (flag) {
|
||
|
puts("Success");
|
||
|
}
|
||
|
}
|
||
|
return 0;
|
||
|
}
|
||
|
|