You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
wasi-sdk/tests/general/exceptions.cc

18 lines
269 B

#include <iostream>
#include <stdlib.h>
int main() {
#ifdef __wasm_exception_handling__
try {
throw std::runtime_error("An error occurred");
abort();
} catch (const std::runtime_error& e) {
// ..
return 0;
}
abort();
#else
return 0;
#endif
}