jcs's openbsd hax
openbsd

Mark the invalid memory location as volatile, otherwise clang would optimize the access to it with an illegal instruction. But the tests needs a SIGSEGV, it would fail with SIGILL.

bluhm d60f87b9 b309be90

+2 -2
+2 -2
regress/lib/libc/setjmp-signal/setjmp-signal.c
··· 1 - /* $OpenBSD: setjmp-signal.c,v 1.3 2003/01/03 20:46:05 miod Exp $ */ 1 + /* $OpenBSD: setjmp-signal.c,v 1.4 2017/07/27 12:31:09 bluhm Exp $ */ 2 2 /* 3 3 * Written by Artur Grabowski <art@openbsd.org> 2002 Public Domain. 4 4 */ ··· 19 19 { 20 20 signal(SIGSEGV, segv_handler); 21 21 if (setjmp(jb) == 0) { 22 - *((int *)0L) = 0; 22 + *((volatile int *)0L) = 0; 23 23 return (1); 24 24 } 25 25 return (0);