blob: d0539dbfa74dade9abf46580946f457e152b2124 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
#include "../../kit_test/test.h"
#include <cstdio>
#include <cstdlib>
#include <stdexcept>
TEST("c++ exception") {
printf("** C++ EXCEPTION\n\n");
exit(42);
throw std::exception {};
}
TEST("abort") {
printf("** ABORT\n\n");
abort();
}
TEST("invalid access") {
printf("** INVALID ACCESS\n\n");
*(volatile int *) nullptr = 42;
}
int main(int argc, char **argv) {
if (run_tests(argc, argv) != 1)
return 1;
return 0;
}
|