]> sourceware.org Git - glibc.git/commitdiff
Fix tests which expose ldbl -> _Float128 redirects
authorPaul E. Murphy <murphyp@linux.vnet.ibm.com>
Fri, 7 Feb 2020 20:08:16 +0000 (14:08 -0600)
committerPaul E. Murphy <murphyp@linux.vnet.ibm.com>
Wed, 25 Mar 2020 19:34:23 +0000 (14:34 -0500)
The ldbl redirects for ieee128 have some jagged edges when
inspecting and manipulating symbols directly.

e.g asprintf is unconditionally redirected to __asprintfieee128
thus any tests relying on GCC's redirect behavior will encounter
problems if they inspect the symbol names too closely.

I've mitigated tests which expose the limitations of the
ldbl -> f128 redirects by giving them knowledge about the
redirected symbol names.

Hopefully there isn't much user code which depends on this
implementation specific behavior.

Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
elf/tst-addr1.c
stdio-common/tst-vfprintf-user-type.c

index 68ff74aabd4dbe5b4dc1c98ebd2df2f66e080890..27dc0f00f4dad77cc25310ede9894205f097f695 100644 (file)
@@ -12,6 +12,16 @@ do_test (void)
       return 1;
     }
   printf ("found symbol %s in %s\n", i.dli_sname, i.dli_fname);
+  if (i.dli_sname == NULL)
+    return 1;
+
+#if __LONG_DOUBLE_USES_FLOAT128 == 1
+  /* On architectures which redirect long double to
+     _Float128 (e.g powerpc64le), printf will resolve
+     to __printfieee128 due to header redirects.  There
+     is no _IO_printfieee128 alias.  */
+  return strcmp (i.dli_sname, "__printfieee128") != 0;
+#else
   return i.dli_sname == NULL
         || (strcmp (i.dli_sname, "printf") != 0
             /* On architectures which create PIC code by default
@@ -20,6 +30,7 @@ do_test (void)
                are aliased and which one comes first in the
                hash table is up to the linker.  */
             && strcmp (i.dli_sname, "_IO_printf") != 0);
+#endif
 }
 
 #include <support/test-driver.c>
index 6c840fe04b382f053f27fa1dd542962c91a603a8..40d714fdb1563870f71afb884e0a9542f3c165f5 100644 (file)
@@ -147,7 +147,11 @@ do_test (void)
 
   /* Alias declaration for asprintf, to avoid the format string
      attribute and the associated warning.  */
+#if __LONG_DOUBLE_USES_FLOAT128 == 1
+  extern int asprintf_alias (char **, const char *, ...) __asm__ ("__asprintfieee128");
+#else
   extern int asprintf_alias (char **, const char *, ...) __asm__ ("asprintf");
+#endif
   TEST_VERIFY (asprintf_alias == asprintf);
   char *str = NULL;
   TEST_VERIFY (asprintf_alias (&str, "[[%P]]", 123L, 456.0) >= 0);
This page took 0.043303 seconds and 5 git commands to generate.