11 static volatile uint64_t
sink;
15 __asm__ __volatile__(
"" :::
"memory");
sink ^= (uint64_t)i;
17 extern "C" __attribute__((noinline))
void catchall_catch_marker(
int i) {
18 __asm__ __volatile__(
"" :::
"memory");
sink ^= (uint64_t)i << 8;
28 buf[i] = kind * 0x111ULL;
31 case 1: {
Pod p{1,2,3};
throw p; }
32 case 2:
throw std::string(
"boom");
33 case 3: {
Virt v; v.
x = i;
throw v; }
37 int main(
int argc,
char** argv) {
38 (void)argc; (void)argv;
40 for (
int i = 0; i <
ITERS; ++i) {
42 catchall_try_marker(i);
45 catchall_catch_marker(i);
51 fprintf(stderr,
"exc_catchall: caught=%d iters=%d sink=%llx\n",
53 return caught ==
ITERS ? 0 : 1;
int main(int argc, char **argv)
static uint64_t buf[ITERS]
static void thrower(int kind, int i)
static volatile uint64_t sink
__attribute__((noinline)) void catchall_try_marker(int i)