]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
tests: Avoid some more runtime errors with Fil-C. master
authorBruno Haible <bruno@clisp.org>
Tue, 28 Jul 2026 20:37:55 +0000 (22:37 +0200)
committerBruno Haible <bruno@clisp.org>
Tue, 28 Jul 2026 20:37:55 +0000 (22:37 +0200)
* tests/test-c32ispunct.c (main): Skip a test case that fails on Fil-C.
* tests/test-free.c (main): Avoid converting from a pointer to uintptr_t
and back.
* tests/test-explicit_bzero.c (test_heap): Skip this test on Fil-C.
* tests/test-memset_explicit.c (test_heap): Likewise.
* tests/test-sigsegv-catch-segv1.c: Skip the entire test on Fil-C, since
it relies on converting an uintptr_t value to a pointer.
* tests/test-sigsegv-catch-segv2.c: Likewise.

ChangeLog
tests/test-c32ispunct.c
tests/test-explicit_bzero.c
tests/test-free.c
tests/test-memset_explicit.c
tests/test-sigsegv-catch-segv1.c
tests/test-sigsegv-catch-segv2.c

index e392c9b8ace43a7003783f30509675b8067d57f9..07587269d4fc152214a3ad0273297f32d33d1fd6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2026-07-28  Bruno Haible  <bruno@clisp.org>
+
+       tests: Avoid some more runtime errors with Fil-C.
+       * tests/test-c32ispunct.c (main): Skip a test case that fails on Fil-C.
+       * tests/test-free.c (main): Avoid converting from a pointer to uintptr_t
+       and back.
+       * tests/test-explicit_bzero.c (test_heap): Skip this test on Fil-C.
+       * tests/test-memset_explicit.c (test_heap): Likewise.
+       * tests/test-sigsegv-catch-segv1.c: Skip the entire test on Fil-C, since
+       it relies on converting an uintptr_t value to a pointer.
+       * tests/test-sigsegv-catch-segv2.c: Likewise.
+
 2026-07-28  Paul Eggert  <eggert@cs.ucla.edu>
             Bruno Haible  <bruno@clisp.org>
 
index d7493d05894a7181f5237b4fbe69635455ebb349..64852bbba1f006fc3b8d047b9282f46699016330 100644 (file)
@@ -255,7 +255,7 @@ main (int argc, char *argv[])
           is = for_character ("\360\235\204\200", 4);
           ASSERT (is != 0);
         #endif
-        #if !(defined __GLIBC__ || (defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined __NetBSD__ || defined __OpenBSD__ || defined _AIX || defined __sun || defined __CYGWIN__ || (defined _WIN32 && !defined __CYGWIN__) || defined __ANDROID__)
+        #if !(defined __GLIBC__ || (defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined __NetBSD__ || defined __OpenBSD__ || defined _AIX || defined __sun || defined __CYGWIN__ || (defined _WIN32 && !defined __CYGWIN__) || defined __ANDROID__ || defined __FILC__)
           /* U+E003A TAG COLON */
           is = for_character ("\363\240\200\272", 4);
           ASSERT (is == 0);
index 6abb85f180ed490c7bdb8daea54ede2936e1fca2..f34670cb9ef3757f08f80de6172f7d80fe47d387 100644 (file)
@@ -61,11 +61,14 @@ test_static (void)
 /* =============== Verify operation on heap-allocated memory =============== */
 
 /* Skip this part when an address sanitizer is in use, because it would report
-   a "heap use after free".  */
+   a "heap use after free".
+   Skip it also with Fil-C, because that environment does not support the
+   conversion of uintptr_t to a pointer or the re-use of a freed pointer.  */
 #ifndef __has_feature
 # define __has_feature(a) 0
 #endif
-#if defined __SANITIZE_ADDRESS__ || __has_feature (address_sanitizer)
+#if defined __SANITIZE_ADDRESS__ || __has_feature (address_sanitizer) \
+    || defined __FILC__
 
 static void
 test_heap (void)
@@ -141,7 +144,7 @@ test_heap (void)
     printf ("test_heap: address range is unmapped after free().\n");
 }
 
-#endif /* ! address sanitizer enabled */
+#endif /* ! (address sanitizer enabled || Fil-C) */
 
 /* =============== Verify operation on stack-allocated memory =============== */
 
index 49b76bc5435af1710a182ca1cc8dce48962f793e..7a3fa9a9aa4204c8b4f1c4e4e301fe0a3a743214 100644 (file)
@@ -131,7 +131,7 @@ main ()
           /* Do a large memory allocation.  */
           size_t big_size = 0x1000000;
           void *ptr = malloc (big_size - 0x100);
-          char *ptr_aligned = (char *) ((uintptr_t) ptr & ~(pagesize - 1));
+          char *ptr_aligned = (char *) ptr - ((uintptr_t) ptr & (pagesize - 1));
           /* This large memory allocation allocated a memory area
              from ptr_aligned to ptr_aligned + big_size.
              Enlarge this memory area by adding a page before and a page
index 02cb7e01ef89716c2b8c3e6ea3f34f6563858df1..d02431b4bba1146baf4a90281a45f5b1ce62a1b5 100644 (file)
@@ -87,11 +87,14 @@ test_static (void)
 /* =============== Verify operation on heap-allocated memory =============== */
 
 /* Skip this part when an address sanitizer is in use, because it would report
-   a "heap use after free".  */
+   a "heap use after free".
+   Skip it also with Fil-C, because that environment does not support the
+   conversion of uintptr_t to a pointer or the re-use of a freed pointer.  */
 #ifndef __has_feature
 # define __has_feature(a) 0
 #endif
-#if defined __SANITIZE_ADDRESS__ || __has_feature (address_sanitizer)
+#if defined __SANITIZE_ADDRESS__ || __has_feature (address_sanitizer) \
+    || defined __FILC__
 
 static void
 test_heap (void)
@@ -167,7 +170,7 @@ test_heap (void)
     printf ("test_heap: address range is unmapped after free().\n");
 }
 
-#endif /* ! address sanitizer enabled */
+#endif /* ! (address sanitizer enabled || Fil-C) */
 
 /* =============== Verify operation on stack-allocated memory =============== */
 
index 2d16478b8d624ec9da16c92816cca42d3366c35e..e433a607a5a78858670c125f94e3d1989d0f6d7d 100644 (file)
@@ -24,7 +24,7 @@
 #include <stdint.h>
 #include <stdio.h>
 
-#if HAVE_SIGSEGV_RECOVERY
+#if HAVE_SIGSEGV_RECOVERY && !defined __FILC__
 
 # include "mmap-anon-util.h"
 # include <stdlib.h>
index 97c069fb5da5d82fb28286691296f6a84051214f..e7f0482d77f811635eaa2d4fee42087f207c62fe 100644 (file)
@@ -24,7 +24,7 @@
 #include <stdint.h>
 #include <stdio.h>
 
-#if HAVE_SIGSEGV_RECOVERY
+#if HAVE_SIGSEGV_RECOVERY && !defined __FILC__
 
 # if defined _WIN32 && !defined __CYGWIN__
   /* Windows doesn't have sigset_t.  */