diff options
Diffstat (limited to 'tests/tcg/multiarch/linux-test.c')
-rw-r--r-- | tests/tcg/multiarch/linux-test.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/tcg/multiarch/linux-test.c b/tests/tcg/multiarch/linux-test.c index 673d7c8a1c..8a7c15cd31 100644 --- a/tests/tcg/multiarch/linux-test.c +++ b/tests/tcg/multiarch/linux-test.c @@ -485,7 +485,11 @@ static void test_signal(void) act.sa_flags = SA_SIGINFO; chk_error(sigaction(SIGSEGV, &act, NULL)); if (setjmp(jmp_env) == 0) { - *(uint8_t *)0 = 0; + /* + * clang requires volatile or it will turn this into a + * call to abort() instead of forcing a SIGSEGV. + */ + *(volatile uint8_t *)0 = 0; } act.sa_handler = SIG_DFL; |