vxworks' libatomic comes from its libc, and it's missing
__atomic_feraiseexcept.  ARM and AArch64 ports call it implicitly in
c11-atomic-exec-[23].c, so these tests fail.

No exceptions are expected to be raised by these tests, so I'm working
around and silencing the failures by defining the missing function
when compiling for the affected target.

(We're considering changing libatomic so that, on VxWorks, it adds the
symbols that are missing from libc, without overriding them, but for now
this silences a couple of failures.)

Regstrapped on x86_64-linux-gnu.  Also tested with gcc-14 on aarch64-,
arm-, x86-, and x86_64-vxworks7r2.  Ok to install?


for  gcc/testsuite/ChangeLog

        * gcc.dg/atomic/c11-atomic-exec-2.c [__VXWORKS__]
        (__atomic_feraiseexcept): Define.
        * gcc.dg/atomic/c11-atomic-exec-3.c: Likewise.
---
 gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-2.c |   10 ++++++++++
 gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-3.c |   10 ++++++++++
 2 files changed, 20 insertions(+)

diff --git a/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-2.c 
b/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-2.c
index 3e75096243e08..0f80b5b908229 100644
--- a/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-2.c
+++ b/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-2.c
@@ -7,6 +7,16 @@
 extern void abort (void);
 extern void exit (int);
 
+#ifdef __VXWORKS__
+/* vxworks offers libatomic in libc, but not __atomic_feraiseexcept.  No FP
+   exceptions are expected in this testcase, so define the symbol so that the
+   remainder of the test gets a chance to run.  */
+void
+__atomic_feraiseexcept (int excepts __attribute__ ((__unused__)))
+{
+}
+#endif
+
 #define CMPLX(X, Y) __builtin_complex ((X), (Y))
 
 #define TEST_COMPOUND(TYPE, LHSVAL, RHSVAL, OP)                                
\
diff --git a/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-3.c 
b/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-3.c
index 7bfa8c05f96cf..066f4ae249f74 100644
--- a/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-3.c
+++ b/gcc/testsuite/gcc.dg/atomic/c11-atomic-exec-3.c
@@ -6,6 +6,16 @@
 extern void abort (void);
 extern void exit (int);
 
+#ifdef __VXWORKS__
+/* vxworks offers libatomic in libc, but not __atomic_feraiseexcept.  No FP
+   exceptions are expected in this testcase, so define the symbol so that the
+   remainder of the test gets a chance to run.  */
+void
+__atomic_feraiseexcept (int excepts __attribute__ ((__unused__)))
+{
+}
+#endif
+
 #define TEST_INCDEC(TYPE, VALUE, PREOP, POSTOP, PRE_P, CHANGE)         \
   do                                                                   \
     {                                                                  \


-- 
Alexandre Oliva, happy hacker            https://blog.lx.oliva.nom.br/
Free Software Activist     FSFLA co-founder     GNU Toolchain Engineer
More tolerance and less prejudice are key for inclusion and diversity.
Excluding neuro-others for not behaving ""normal"" is *not* inclusive!

Reply via email to