tests/tcg: modify multiarch tests to work with clang
authorTaylor Simpson <tsimpson@quicinc.com>
Sun, 17 Nov 2019 23:14:25 +0000 (17:14 -0600)
committerAlex Bennée <alex.bennee@linaro.org>
Wed, 20 Nov 2019 10:53:31 +0000 (10:53 +0000)
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>
tests/tcg/multiarch/float_helpers.c
tests/tcg/multiarch/linux-test.c

index 8ee7903c785530618aeddacf87c7f4de79e87d0b..bc530e5732d321a28f33d3c97822cb7a984086e6 100644 (file)
@@ -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[] = {
index 673d7c8a1c25cda5fbab95780337daa67e0a3967..8a7c15cd31201772966ba48fbf72c08762936380 100644 (file)
@@ -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;