Modify tests to work with clang
PATCH 1/1 Modify tests to work with clang
Signed-off-by Taylor Simpson <[email protected]>
--- tests/tcg/multiarch/float_helpers.c | 2 -- tests/tcg/multiarch/linux-test.c | 6 +++++- 2 files changed, 5 insertions(+), 3 deletions(-)
tests/tcg/multiarch/float_helpers.c +0 -2
@@ -79,11 +79,9 @@ char *fmt_16(uint16_t num)#ifndef SNANF /* Signaling NaN macros, if supported. */ -# if __GNUC_PREREQ (3 ,3 )# define SNANF (__builtin_nansf (""))# define SNAN (__builtin_nans (""))# define SNANL (__builtin_nansl ("")) -# endif #endif static float f32_numbers[] = {
tests/tcg/multiarch/linux-test.c +5 -1
@@ -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 ;
Signature · 1 line
2.7.4
Quoted 30 lines · Taylor Simpson
Signed-off-by Taylor Simpson <[email protected]>--- tests/tcg/multiarch/float_helpers.c | 2 -- tests/tcg/multiarch/linux-test.c | 6 +++++- 2 files changed, 5 insertions(+), 3 deletions(-)tests/tcg/multiarch/float_helpers.c +0
-2@@ -79,11 +79,9 @@ char *fmt_16(uint16_t num)#ifndef SNANF /* Signaling NaN macros, if supported. */ -# if __GNUC_PREREQ (3 ,3 )# define SNANF (__builtin_nansf (""))# define SNAN (__builtin_nans (""))# define SNANL (__builtin_nansl ("")) -# endif #endif static float f32_numbers[] = {tests/tcg/multiarch/linux-test.c +0
-0@@ -485,7 +485,11 @@ static void test_signal(void) act.sa_flags =SA_SIGINFO ;chk_error (sigaction (SIGSEGV , &act,NULL ));
tests/tcg/multiarch/linux-test.c static void test_signal(void) · line 495
Quoted 10 lines
tests/tcg/multiarch/linux-test.c +5
-1if (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 ;
Reviewed-by Thomas Huth <[email protected]>
Quoted 5 lines · Taylor Simpson
Signed-off-by Taylor Simpson <[email protected]>--- tests/tcg/multiarch/float_helpers.c | 2 -- tests/tcg/multiarch/linux-test.c | 6 +++++- 2 files changed, 5 insertions(+), 3 deletions(-)
Reviewed-by Richard Henderson <[email protected]>
r~
Alex Bennée
AppliedQuoted 1 line · Taylor Simpson
Signed-off-by Taylor Simpson <[email protected]>
Queued to 4.2/for-rc2, thanks.
Quoted 28 lines
--- tests/tcg/multiarch/float_helpers.c | 2 -- tests/tcg/multiarch/linux-test.c | 6 +++++- 2 files changed, 5 insertions(+), 3 deletions(-)tests/tcg/multiarch/float_helpers.c +0
-2@@ -79,11 +79,9 @@ char *fmt_16(uint16_t num)#ifndef SNANF /* Signaling NaN macros, if supported. */ -# if __GNUC_PREREQ (3 ,3 )# define SNANF (__builtin_nansf (""))# define SNAN (__builtin_nans (""))# define SNANL (__builtin_nansl ("")) -# endif #endif static float f32_numbers[] = {tests/tcg/multiarch/linux-test.c +0
-0@@ -485,7 +485,11 @@ static void test_signal(void) act.sa_flags =SA_SIGINFO ;chk_error (sigaction (SIGSEGV , &act,NULL ));
tests/tcg/multiarch/linux-test.c static void test_signal(void) · line 495
Quoted 10 lines
tests/tcg/multiarch/linux-test.c +5
-1if (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 ;
--
Alex Bennée