tests/tcg: modify multiarch tests to work with clang
Signed-off-by: Taylor Simpson <tsimpson@quicinc.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <1574032465-12186-1-git-send-email-tsimpson@quicinc.com> [AJB: tweak header line] Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
This commit is contained in:
parent
6e98888041
commit
22c30b2d20
|
@ -79,11 +79,9 @@ char *fmt_16(uint16_t num)
|
||||||
|
|
||||||
#ifndef SNANF
|
#ifndef SNANF
|
||||||
/* Signaling NaN macros, if supported. */
|
/* Signaling NaN macros, if supported. */
|
||||||
# if __GNUC_PREREQ(3, 3)
|
|
||||||
# define SNANF (__builtin_nansf (""))
|
# define SNANF (__builtin_nansf (""))
|
||||||
# define SNAN (__builtin_nans (""))
|
# define SNAN (__builtin_nans (""))
|
||||||
# define SNANL (__builtin_nansl (""))
|
# define SNANL (__builtin_nansl (""))
|
||||||
# endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static float f32_numbers[] = {
|
static float f32_numbers[] = {
|
||||||
|
|
|
@ -485,7 +485,11 @@ static void test_signal(void)
|
||||||
act.sa_flags = SA_SIGINFO;
|
act.sa_flags = SA_SIGINFO;
|
||||||
chk_error(sigaction(SIGSEGV, &act, NULL));
|
chk_error(sigaction(SIGSEGV, &act, NULL));
|
||||||
if (setjmp(jmp_env) == 0) {
|
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;
|
act.sa_handler = SIG_DFL;
|
||||||
|
|
Loading…
Reference in a new issue