]> Savannah Git Hosting - gnulib.git/commitdiff
malloc, calloc, realloc tests: Work around clang optimization bug.
authorBruno Haible <bruno@clisp.org>
Mon, 4 Nov 2024 10:47:23 +0000 (11:47 +0100)
committerBruno Haible <bruno@clisp.org>
Mon, 4 Nov 2024 10:47:23 +0000 (11:47 +0100)
* tests/test-malloc-posix.c (my_malloc): New variable.
* tests/test-calloc-posix.c (my_calloc): New variable.
* tests/test-realloc-posix.c (my_realloc): New variable.

ChangeLog
tests/test-calloc-posix.c
tests/test-malloc-posix.c
tests/test-realloc-posix.c

index 1381089ad83c3942910705867b8d659fa828fa61..c73909152a4138218144ff41e0e1ed6588021908 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-11-04  Bruno Haible  <bruno@clisp.org>
+
+       malloc, calloc, realloc tests: Work around clang optimization bug.
+       * tests/test-malloc-posix.c (my_malloc): New variable.
+       * tests/test-calloc-posix.c (my_calloc): New variable.
+       * tests/test-realloc-posix.c (my_realloc): New variable.
+
 2024-11-03  Bruno Haible  <bruno@clisp.org>
 
        crc: Fix build rules with Automake's option 'subdir-objects'.
index d75a255cf502583d16313782a2618816d59607b3..5fb5c3baa2870cbcd08cd938478e3b0fe02e5b3f 100644 (file)
 
 #include "macros.h"
 
+/* Work around clang bug
+   <https://github.com/llvm/llvm-project/issues/114772>.  */
+void *(* volatile my_calloc) (size_t, size_t) = calloc;
+#define calloc my_calloc
+
 int
 main ()
 {
index 7a89b0ab792742b1d5adbdecff05d6f98a65b91e..191b9d1048eb3897555964f4678472f54f31acdf 100644 (file)
 
 #include "macros.h"
 
+/* Work around clang bug
+   <https://github.com/llvm/llvm-project/issues/114772>.  */
+void *(* volatile my_malloc) (size_t) = malloc;
+#define malloc my_malloc
+
 int
 main ()
 {
index 804d8f24e559735084556ff1d1a2f65171d79ad1..c6d62e1d30ddca893e687a562e46270158ad2e02 100644 (file)
 
 #include "macros.h"
 
+/* Work around clang bug
+   <https://github.com/llvm/llvm-project/issues/114772>.  */
+void *(* volatile my_realloc) (void *, size_t) = realloc;
+#define realloc my_realloc
+
 int
 main (int argc, _GL_UNUSED char **argv)
 {