summaryrefslogtreecommitdiff
path: root/source/test/programs/signals.cpp
blob: faea12ef7c7e00c4c5dd74138de66b746c4e918b (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
#include "../../kit_test/test.h"

#include <cstdio>
#include <cstdlib>
#include <stdexcept>

TEST("c++ exception") {
  printf("** C++ EXCEPTION\n\n");
  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;
}