public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/azanella/clang] malloc: Disable malloc builtins on tests
@ 2024-04-17 20:11 Adhemerval Zanella
  0 siblings, 0 replies; 19+ messages in thread
From: Adhemerval Zanella @ 2024-04-17 20:11 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=4fbc210a64404d78059759eb58cdaeda78d3d2fd

commit 4fbc210a64404d78059759eb58cdaeda78d3d2fd
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Wed Mar 30 15:42:18 2022 -0300

    malloc: Disable malloc builtins on tests
    
    To avoid compiler optimize away memory allocation calls, which might
    interfere when both valid and invalid calls checks.

Diff:
---
 malloc/Makefile | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/malloc/Makefile b/malloc/Makefile
index c83ade5f10..5363b884f5 100644
--- a/malloc/Makefile
+++ b/malloc/Makefile
@@ -370,3 +370,18 @@ tst-mallocstate-malloc-check-ENV = LD_PRELOAD=$(objpfx)libc_malloc_debug.so
 # libc_malloc_debug.so.
 $(objpfx)tst-mallocstate: $(objpfx)libc_malloc_debug.so
 $(objpfx)tst-mallocstate-malloc-check: $(objpfx)libc_malloc_debug.so
+
+CFLAGS-tst-memalign.c += -fno-builtin
+CFLAGS-tst-memalign-2.c += -fno-builtin
+CFLAGS-tst-memalign-3.c += -fno-builtin
+CFLAGS-tst-malloc.c += -fno-builtin
+CFLAGS-tst-malloc-backtrace.c += -fno-builtin
+CFLAGS-tst-malloc-check.c += -fno-builtin
+CFLAGS-tst-malloc-too-large.c += -fno-builtin
+CFLAGS-tst-realloc.c += -fno-builtin
+CFLAGS-tst-valloc.c += -fno-builtin
+CFLAGS-tst-compathooks-off.c += -fno-builtin
+CFLAGS-tst-compathooks-on.c += -fno-builtin
+CFLAGS-tst-mallinfo2.c += -fno-builtin
+CFLAGS-tst-aligned-alloc.c += -fno-builtin
+CFLAGS-tst-aligned-alloc-static.c += -fno-builtin

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [glibc/azanella/clang] malloc: Disable malloc builtins on tests
@ 2024-04-02 15:58 Adhemerval Zanella
  0 siblings, 0 replies; 19+ messages in thread
From: Adhemerval Zanella @ 2024-04-02 15:58 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=34e5a871994780c0696bfd99fb63e42f56f9a66e

commit 34e5a871994780c0696bfd99fb63e42f56f9a66e
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Wed Mar 30 15:42:18 2022 -0300

    malloc: Disable malloc builtins on tests
    
    To avoid compiler optimize away memory allocation calls, which might
    interfere when both valid and invalid calls checks.

Diff:
---
 malloc/Makefile | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/malloc/Makefile b/malloc/Makefile
index c83ade5f10..5363b884f5 100644
--- a/malloc/Makefile
+++ b/malloc/Makefile
@@ -370,3 +370,18 @@ tst-mallocstate-malloc-check-ENV = LD_PRELOAD=$(objpfx)libc_malloc_debug.so
 # libc_malloc_debug.so.
 $(objpfx)tst-mallocstate: $(objpfx)libc_malloc_debug.so
 $(objpfx)tst-mallocstate-malloc-check: $(objpfx)libc_malloc_debug.so
+
+CFLAGS-tst-memalign.c += -fno-builtin
+CFLAGS-tst-memalign-2.c += -fno-builtin
+CFLAGS-tst-memalign-3.c += -fno-builtin
+CFLAGS-tst-malloc.c += -fno-builtin
+CFLAGS-tst-malloc-backtrace.c += -fno-builtin
+CFLAGS-tst-malloc-check.c += -fno-builtin
+CFLAGS-tst-malloc-too-large.c += -fno-builtin
+CFLAGS-tst-realloc.c += -fno-builtin
+CFLAGS-tst-valloc.c += -fno-builtin
+CFLAGS-tst-compathooks-off.c += -fno-builtin
+CFLAGS-tst-compathooks-on.c += -fno-builtin
+CFLAGS-tst-mallinfo2.c += -fno-builtin
+CFLAGS-tst-aligned-alloc.c += -fno-builtin
+CFLAGS-tst-aligned-alloc-static.c += -fno-builtin

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [glibc/azanella/clang] malloc: Disable malloc builtins on tests
@ 2024-02-09 17:36 Adhemerval Zanella
  0 siblings, 0 replies; 19+ messages in thread
From: Adhemerval Zanella @ 2024-02-09 17:36 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=e5fe85a7407a56e2d9a42f535f3be2812a3112c0

commit e5fe85a7407a56e2d9a42f535f3be2812a3112c0
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Wed Mar 30 15:42:18 2022 -0300

    malloc: Disable malloc builtins on tests
    
    To avoid compiler optimize away memory allocation calls, which might
    interfere when both valid and invalid calls checks.

Diff:
---
 malloc/Makefile | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/malloc/Makefile b/malloc/Makefile
index c83ade5f10..5363b884f5 100644
--- a/malloc/Makefile
+++ b/malloc/Makefile
@@ -370,3 +370,18 @@ tst-mallocstate-malloc-check-ENV = LD_PRELOAD=$(objpfx)libc_malloc_debug.so
 # libc_malloc_debug.so.
 $(objpfx)tst-mallocstate: $(objpfx)libc_malloc_debug.so
 $(objpfx)tst-mallocstate-malloc-check: $(objpfx)libc_malloc_debug.so
+
+CFLAGS-tst-memalign.c += -fno-builtin
+CFLAGS-tst-memalign-2.c += -fno-builtin
+CFLAGS-tst-memalign-3.c += -fno-builtin
+CFLAGS-tst-malloc.c += -fno-builtin
+CFLAGS-tst-malloc-backtrace.c += -fno-builtin
+CFLAGS-tst-malloc-check.c += -fno-builtin
+CFLAGS-tst-malloc-too-large.c += -fno-builtin
+CFLAGS-tst-realloc.c += -fno-builtin
+CFLAGS-tst-valloc.c += -fno-builtin
+CFLAGS-tst-compathooks-off.c += -fno-builtin
+CFLAGS-tst-compathooks-on.c += -fno-builtin
+CFLAGS-tst-mallinfo2.c += -fno-builtin
+CFLAGS-tst-aligned-alloc.c += -fno-builtin
+CFLAGS-tst-aligned-alloc-static.c += -fno-builtin

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [glibc/azanella/clang] malloc: Disable malloc builtins on tests
@ 2024-02-07 14:11 Adhemerval Zanella
  0 siblings, 0 replies; 19+ messages in thread
From: Adhemerval Zanella @ 2024-02-07 14:11 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=b6f03c586728b36ac16348038a29827eb673945c

commit b6f03c586728b36ac16348038a29827eb673945c
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Wed Mar 30 15:42:18 2022 -0300

    malloc: Disable malloc builtins on tests
    
    To avoid compiler optimize away memory allocation calls, which might
    interfere when both valid and invalid calls checks.

Diff:
---
 malloc/Makefile | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/malloc/Makefile b/malloc/Makefile
index c83ade5f10..5363b884f5 100644
--- a/malloc/Makefile
+++ b/malloc/Makefile
@@ -370,3 +370,18 @@ tst-mallocstate-malloc-check-ENV = LD_PRELOAD=$(objpfx)libc_malloc_debug.so
 # libc_malloc_debug.so.
 $(objpfx)tst-mallocstate: $(objpfx)libc_malloc_debug.so
 $(objpfx)tst-mallocstate-malloc-check: $(objpfx)libc_malloc_debug.so
+
+CFLAGS-tst-memalign.c += -fno-builtin
+CFLAGS-tst-memalign-2.c += -fno-builtin
+CFLAGS-tst-memalign-3.c += -fno-builtin
+CFLAGS-tst-malloc.c += -fno-builtin
+CFLAGS-tst-malloc-backtrace.c += -fno-builtin
+CFLAGS-tst-malloc-check.c += -fno-builtin
+CFLAGS-tst-malloc-too-large.c += -fno-builtin
+CFLAGS-tst-realloc.c += -fno-builtin
+CFLAGS-tst-valloc.c += -fno-builtin
+CFLAGS-tst-compathooks-off.c += -fno-builtin
+CFLAGS-tst-compathooks-on.c += -fno-builtin
+CFLAGS-tst-mallinfo2.c += -fno-builtin
+CFLAGS-tst-aligned-alloc.c += -fno-builtin
+CFLAGS-tst-aligned-alloc-static.c += -fno-builtin

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [glibc/azanella/clang] malloc: Disable malloc builtins on tests
@ 2024-01-29 18:02 Adhemerval Zanella
  0 siblings, 0 replies; 19+ messages in thread
From: Adhemerval Zanella @ 2024-01-29 18:02 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=74c56dc6ee95e3985fb5d94b30cb1e71d3f3f3f7

commit 74c56dc6ee95e3985fb5d94b30cb1e71d3f3f3f7
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Wed Mar 30 15:42:18 2022 -0300

    malloc: Disable malloc builtins on tests
    
    To avoid compiler optimize away memory allocation calls, which might
    interfere when both valid and invalid calls checks.

Diff:
---
 malloc/Makefile | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/malloc/Makefile b/malloc/Makefile
index c83ade5f10..5363b884f5 100644
--- a/malloc/Makefile
+++ b/malloc/Makefile
@@ -370,3 +370,18 @@ tst-mallocstate-malloc-check-ENV = LD_PRELOAD=$(objpfx)libc_malloc_debug.so
 # libc_malloc_debug.so.
 $(objpfx)tst-mallocstate: $(objpfx)libc_malloc_debug.so
 $(objpfx)tst-mallocstate-malloc-check: $(objpfx)libc_malloc_debug.so
+
+CFLAGS-tst-memalign.c += -fno-builtin
+CFLAGS-tst-memalign-2.c += -fno-builtin
+CFLAGS-tst-memalign-3.c += -fno-builtin
+CFLAGS-tst-malloc.c += -fno-builtin
+CFLAGS-tst-malloc-backtrace.c += -fno-builtin
+CFLAGS-tst-malloc-check.c += -fno-builtin
+CFLAGS-tst-malloc-too-large.c += -fno-builtin
+CFLAGS-tst-realloc.c += -fno-builtin
+CFLAGS-tst-valloc.c += -fno-builtin
+CFLAGS-tst-compathooks-off.c += -fno-builtin
+CFLAGS-tst-compathooks-on.c += -fno-builtin
+CFLAGS-tst-mallinfo2.c += -fno-builtin
+CFLAGS-tst-aligned-alloc.c += -fno-builtin
+CFLAGS-tst-aligned-alloc-static.c += -fno-builtin

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [glibc/azanella/clang] malloc: Disable malloc builtins on tests
@ 2023-12-21 18:58 Adhemerval Zanella
  0 siblings, 0 replies; 19+ messages in thread
From: Adhemerval Zanella @ 2023-12-21 18:58 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=65627d07e407188bb850105cc6926ee440157bbb

commit 65627d07e407188bb850105cc6926ee440157bbb
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Wed Mar 30 15:42:18 2022 -0300

    malloc: Disable malloc builtins on tests
    
    To avoid compiler optimize away memory allocation calls, which might
    interfere when both valid and invalid calls checks.

Diff:
---
 malloc/Makefile | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/malloc/Makefile b/malloc/Makefile
index f6cdf7bf0b..d03cbd173c 100644
--- a/malloc/Makefile
+++ b/malloc/Makefile
@@ -370,3 +370,18 @@ tst-mallocstate-malloc-check-ENV = LD_PRELOAD=$(objpfx)libc_malloc_debug.so
 # libc_malloc_debug.so.
 $(objpfx)tst-mallocstate: $(objpfx)libc_malloc_debug.so
 $(objpfx)tst-mallocstate-malloc-check: $(objpfx)libc_malloc_debug.so
+
+CFLAGS-tst-memalign.c += -fno-builtin
+CFLAGS-tst-memalign-2.c += -fno-builtin
+CFLAGS-tst-memalign-3.c += -fno-builtin
+CFLAGS-tst-malloc.c += -fno-builtin
+CFLAGS-tst-malloc-backtrace.c += -fno-builtin
+CFLAGS-tst-malloc-check.c += -fno-builtin
+CFLAGS-tst-malloc-too-large.c += -fno-builtin
+CFLAGS-tst-realloc.c += -fno-builtin
+CFLAGS-tst-valloc.c += -fno-builtin
+CFLAGS-tst-compathooks-off.c += -fno-builtin
+CFLAGS-tst-compathooks-on.c += -fno-builtin
+CFLAGS-tst-mallinfo2.c += -fno-builtin
+CFLAGS-tst-aligned-alloc.c += -fno-builtin
+CFLAGS-tst-aligned-alloc-static.c += -fno-builtin

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [glibc/azanella/clang] malloc: Disable malloc builtins on tests
@ 2023-09-28 17:56 Adhemerval Zanella
  0 siblings, 0 replies; 19+ messages in thread
From: Adhemerval Zanella @ 2023-09-28 17:56 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=ca27004e1096ab2942dc770acccf835e52bc9d74

commit ca27004e1096ab2942dc770acccf835e52bc9d74
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Wed Mar 30 15:42:18 2022 -0300

    malloc: Disable malloc builtins on tests
    
    To avoid compiler optimize away memory allocation calls, which might
    interfere when both valid and invalid calls checks.

Diff:
---
 malloc/Makefile | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/malloc/Makefile b/malloc/Makefile
index c1db3347d8..0e47b8446f 100644
--- a/malloc/Makefile
+++ b/malloc/Makefile
@@ -368,3 +368,18 @@ tst-mallocstate-malloc-check-ENV = LD_PRELOAD=$(objpfx)libc_malloc_debug.so
 # libc_malloc_debug.so.
 $(objpfx)tst-mallocstate: $(objpfx)libc_malloc_debug.so
 $(objpfx)tst-mallocstate-malloc-check: $(objpfx)libc_malloc_debug.so
+
+CFLAGS-tst-memalign.c += -fno-builtin
+CFLAGS-tst-memalign-2.c += -fno-builtin
+CFLAGS-tst-memalign-3.c += -fno-builtin
+CFLAGS-tst-malloc.c += -fno-builtin
+CFLAGS-tst-malloc-backtrace.c += -fno-builtin
+CFLAGS-tst-malloc-check.c += -fno-builtin
+CFLAGS-tst-malloc-too-large.c += -fno-builtin
+CFLAGS-tst-realloc.c += -fno-builtin
+CFLAGS-tst-valloc.c += -fno-builtin
+CFLAGS-tst-compathooks-off.c += -fno-builtin
+CFLAGS-tst-compathooks-on.c += -fno-builtin
+CFLAGS-tst-mallinfo2.c += -fno-builtin
+CFLAGS-tst-aligned-alloc.c += -fno-builtin
+CFLAGS-tst-aligned-alloc-static.c += -fno-builtin

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [glibc/azanella/clang] malloc: Disable malloc builtins on tests
@ 2023-08-30 12:41 Adhemerval Zanella
  0 siblings, 0 replies; 19+ messages in thread
From: Adhemerval Zanella @ 2023-08-30 12:41 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=91a2e7b6f4ad009cf003b10fcd86fa6587fd3dec

commit 91a2e7b6f4ad009cf003b10fcd86fa6587fd3dec
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Wed Mar 30 15:42:18 2022 -0300

    malloc: Disable malloc builtins on tests
    
    To avoid compiler optimize away memory allocation calls, which might
    interfere when both valid and invalid calls checks.

Diff:
---
 malloc/Makefile | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/malloc/Makefile b/malloc/Makefile
index c1db3347d8..55c1ca4915 100644
--- a/malloc/Makefile
+++ b/malloc/Makefile
@@ -368,3 +368,15 @@ tst-mallocstate-malloc-check-ENV = LD_PRELOAD=$(objpfx)libc_malloc_debug.so
 # libc_malloc_debug.so.
 $(objpfx)tst-mallocstate: $(objpfx)libc_malloc_debug.so
 $(objpfx)tst-mallocstate-malloc-check: $(objpfx)libc_malloc_debug.so
+
+CFLAGS-tst-memalign.c += -fno-builtin
+CFLAGS-tst-malloc.c += -fno-builtin
+CFLAGS-tst-malloc-backtrace.c += -fno-builtin
+CFLAGS-tst-malloc-check.c += -fno-builtin
+CFLAGS-tst-malloc-too-large.c += -fno-builtin
+CFLAGS-tst-realloc.c += -fno-builtin
+CFLAGS-tst-valloc.c += -fno-builtin
+CFLAGS-tst-compathooks-off.c += -fno-builtin
+CFLAGS-tst-compathooks-on.c += -fno-builtin
+CFLAGS-tst-mallinfo2.c += -fno-builtin
+CFLAGS-tst-aligned-alloc.c += -fno-builtin

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [glibc/azanella/clang] malloc: Disable malloc builtins on tests
@ 2023-02-09 19:53 Adhemerval Zanella
  0 siblings, 0 replies; 19+ messages in thread
From: Adhemerval Zanella @ 2023-02-09 19:53 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=a8f02b157e8f113a5a7f746b8b70fc71985cb945

commit a8f02b157e8f113a5a7f746b8b70fc71985cb945
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Wed Mar 30 15:42:18 2022 -0300

    malloc: Disable malloc builtins on tests
    
    To avoid compiler optimize away memory allocation calls, which might
    interfere when both valid and invalid calls checks.

Diff:
---
 malloc/Makefile       | 11 +++++++++++
 malloc/tst-malloc.c   |  1 +
 malloc/tst-memalign.c |  3 +--
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/malloc/Makefile b/malloc/Makefile
index dfb51d344c..729198e81e 100644
--- a/malloc/Makefile
+++ b/malloc/Makefile
@@ -366,3 +366,14 @@ tst-mallocstate-malloc-check-ENV = LD_PRELOAD=$(objpfx)libc_malloc_debug.so
 # libc_malloc_debug.so.
 $(objpfx)tst-mallocstate: $(objpfx)libc_malloc_debug.so
 $(objpfx)tst-mallocstate-malloc-check: $(objpfx)libc_malloc_debug.so
+
+CFLAGS-tst-memalign.c += -fno-builtin
+CFLAGS-tst-malloc.c += -fno-builtin
+CFLAGS-tst-malloc-backtrace.c += -fno-builtin
+CFLAGS-tst-malloc-check.c += -fno-builtin
+CFLAGS-tst-malloc-too-large.c += -fno-builtin
+CFLAGS-tst-realloc.c += -fno-builtin
+CFLAGS-tst-valloc.c += -fno-builtin
+CFLAGS-tst-compathooks-off.c += -fno-builtin
+CFLAGS-tst-compathooks-on.c += -fno-builtin
+CFLAGS-tst-mallinfo2.c += -fno-builtin
diff --git a/malloc/tst-malloc.c b/malloc/tst-malloc.c
index 0da5a8f263..6097ce092d 100644
--- a/malloc/tst-malloc.c
+++ b/malloc/tst-malloc.c
@@ -46,6 +46,7 @@ do_test (void)
   p = malloc (-1);
   DIAG_POP_NEEDS_COMMENT;
   save = errno;
+  asm volatile("" ::: "memory");
 
   if (p != NULL)
     merror ("malloc (-1) succeeded.");
diff --git a/malloc/tst-memalign.c b/malloc/tst-memalign.c
index 720e640f16..5ba595089a 100644
--- a/malloc/tst-memalign.c
+++ b/malloc/tst-memalign.c
@@ -124,5 +124,4 @@ do_test (void)
   return errors != 0;
 }
 
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [glibc/azanella/clang] malloc: Disable malloc builtins on tests
@ 2022-10-28 17:46 Adhemerval Zanella
  0 siblings, 0 replies; 19+ messages in thread
From: Adhemerval Zanella @ 2022-10-28 17:46 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=1e51fd33645e2fdf647cf2b4b7a9acf1ea73ee87

commit 1e51fd33645e2fdf647cf2b4b7a9acf1ea73ee87
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Wed Mar 30 15:42:18 2022 -0300

    malloc: Disable malloc builtins on tests
    
    To avoid compiler optimize away memory allocation calls, which might
    interfere when both valid and invalid calls checks.

Diff:
---
 malloc/Makefile       | 11 +++++++++++
 malloc/tst-malloc.c   |  1 +
 malloc/tst-memalign.c |  3 +--
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/malloc/Makefile b/malloc/Makefile
index 4e32de2a0b..250717d255 100644
--- a/malloc/Makefile
+++ b/malloc/Makefile
@@ -367,3 +367,14 @@ tst-mallocstate-malloc-check-ENV = LD_PRELOAD=$(objpfx)libc_malloc_debug.so
 # libc_malloc_debug.so.
 $(objpfx)tst-mallocstate: $(objpfx)libc_malloc_debug.so
 $(objpfx)tst-mallocstate-malloc-check: $(objpfx)libc_malloc_debug.so
+
+CFLAGS-tst-memalign.c += -fno-builtin
+CFLAGS-tst-malloc.c += -fno-builtin
+CFLAGS-tst-malloc-backtrace.c += -fno-builtin
+CFLAGS-tst-malloc-check.c += -fno-builtin
+CFLAGS-tst-malloc-too-large.c += -fno-builtin
+CFLAGS-tst-realloc.c += -fno-builtin
+CFLAGS-tst-valloc.c += -fno-builtin
+CFLAGS-tst-compathooks-off.c += -fno-builtin
+CFLAGS-tst-compathooks-on.c += -fno-builtin
+CFLAGS-tst-mallinfo2.c += -fno-builtin
diff --git a/malloc/tst-malloc.c b/malloc/tst-malloc.c
index 62e3b9b95c..e3855035e7 100644
--- a/malloc/tst-malloc.c
+++ b/malloc/tst-malloc.c
@@ -46,6 +46,7 @@ do_test (void)
   p = malloc (-1);
   DIAG_POP_NEEDS_COMMENT;
   save = errno;
+  asm volatile("" ::: "memory");
 
   if (p != NULL)
     merror ("malloc (-1) succeeded.");
diff --git a/malloc/tst-memalign.c b/malloc/tst-memalign.c
index b5933f4741..5da00954e2 100644
--- a/malloc/tst-memalign.c
+++ b/malloc/tst-memalign.c
@@ -124,5 +124,4 @@ do_test (void)
   return errors != 0;
 }
 
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [glibc/azanella/clang] malloc: Disable malloc builtins on tests
@ 2022-10-04 13:04 Adhemerval Zanella
  0 siblings, 0 replies; 19+ messages in thread
From: Adhemerval Zanella @ 2022-10-04 13:04 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=e9d45800c0ec6cc55ccc00e1f508c41eba3852a9

commit e9d45800c0ec6cc55ccc00e1f508c41eba3852a9
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Wed Mar 30 15:42:18 2022 -0300

    malloc: Disable malloc builtins on tests
    
    To avoid compiler optimize away memory allocation calls, which might
    interfere when both valid and invalid calls checks.

Diff:
---
 malloc/Makefile       | 11 +++++++++++
 malloc/tst-malloc.c   |  1 +
 malloc/tst-memalign.c |  3 +--
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/malloc/Makefile b/malloc/Makefile
index 4e32de2a0b..250717d255 100644
--- a/malloc/Makefile
+++ b/malloc/Makefile
@@ -367,3 +367,14 @@ tst-mallocstate-malloc-check-ENV = LD_PRELOAD=$(objpfx)libc_malloc_debug.so
 # libc_malloc_debug.so.
 $(objpfx)tst-mallocstate: $(objpfx)libc_malloc_debug.so
 $(objpfx)tst-mallocstate-malloc-check: $(objpfx)libc_malloc_debug.so
+
+CFLAGS-tst-memalign.c += -fno-builtin
+CFLAGS-tst-malloc.c += -fno-builtin
+CFLAGS-tst-malloc-backtrace.c += -fno-builtin
+CFLAGS-tst-malloc-check.c += -fno-builtin
+CFLAGS-tst-malloc-too-large.c += -fno-builtin
+CFLAGS-tst-realloc.c += -fno-builtin
+CFLAGS-tst-valloc.c += -fno-builtin
+CFLAGS-tst-compathooks-off.c += -fno-builtin
+CFLAGS-tst-compathooks-on.c += -fno-builtin
+CFLAGS-tst-mallinfo2.c += -fno-builtin
diff --git a/malloc/tst-malloc.c b/malloc/tst-malloc.c
index 62e3b9b95c..e3855035e7 100644
--- a/malloc/tst-malloc.c
+++ b/malloc/tst-malloc.c
@@ -46,6 +46,7 @@ do_test (void)
   p = malloc (-1);
   DIAG_POP_NEEDS_COMMENT;
   save = errno;
+  asm volatile("" ::: "memory");
 
   if (p != NULL)
     merror ("malloc (-1) succeeded.");
diff --git a/malloc/tst-memalign.c b/malloc/tst-memalign.c
index b5933f4741..5da00954e2 100644
--- a/malloc/tst-memalign.c
+++ b/malloc/tst-memalign.c
@@ -124,5 +124,4 @@ do_test (void)
   return errors != 0;
 }
 
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [glibc/azanella/clang] malloc: Disable malloc builtins on tests
@ 2022-06-09 21:24 Adhemerval Zanella
  0 siblings, 0 replies; 19+ messages in thread
From: Adhemerval Zanella @ 2022-06-09 21:24 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=7e09b33e16baf3f68ec6982334061b32509c1700

commit 7e09b33e16baf3f68ec6982334061b32509c1700
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Wed Mar 30 15:42:18 2022 -0300

    malloc: Disable malloc builtins on tests
    
    To avoid compiler optimize away memory allocation calls, which might
    interfere when both valid and invalid calls checks.

Diff:
---
 malloc/Makefile       | 11 +++++++++++
 malloc/tst-malloc.c   |  1 +
 malloc/tst-memalign.c |  3 +--
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/malloc/Makefile b/malloc/Makefile
index 4e32de2a0b..250717d255 100644
--- a/malloc/Makefile
+++ b/malloc/Makefile
@@ -367,3 +367,14 @@ tst-mallocstate-malloc-check-ENV = LD_PRELOAD=$(objpfx)libc_malloc_debug.so
 # libc_malloc_debug.so.
 $(objpfx)tst-mallocstate: $(objpfx)libc_malloc_debug.so
 $(objpfx)tst-mallocstate-malloc-check: $(objpfx)libc_malloc_debug.so
+
+CFLAGS-tst-memalign.c += -fno-builtin
+CFLAGS-tst-malloc.c += -fno-builtin
+CFLAGS-tst-malloc-backtrace.c += -fno-builtin
+CFLAGS-tst-malloc-check.c += -fno-builtin
+CFLAGS-tst-malloc-too-large.c += -fno-builtin
+CFLAGS-tst-realloc.c += -fno-builtin
+CFLAGS-tst-valloc.c += -fno-builtin
+CFLAGS-tst-compathooks-off.c += -fno-builtin
+CFLAGS-tst-compathooks-on.c += -fno-builtin
+CFLAGS-tst-mallinfo2.c += -fno-builtin
diff --git a/malloc/tst-malloc.c b/malloc/tst-malloc.c
index 62e3b9b95c..e3855035e7 100644
--- a/malloc/tst-malloc.c
+++ b/malloc/tst-malloc.c
@@ -46,6 +46,7 @@ do_test (void)
   p = malloc (-1);
   DIAG_POP_NEEDS_COMMENT;
   save = errno;
+  asm volatile("" ::: "memory");
 
   if (p != NULL)
     merror ("malloc (-1) succeeded.");
diff --git a/malloc/tst-memalign.c b/malloc/tst-memalign.c
index b5933f4741..5da00954e2 100644
--- a/malloc/tst-memalign.c
+++ b/malloc/tst-memalign.c
@@ -124,5 +124,4 @@ do_test (void)
   return errors != 0;
 }
 
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [glibc/azanella/clang] malloc: Disable malloc builtins on tests
@ 2022-06-09 13:21 Adhemerval Zanella
  0 siblings, 0 replies; 19+ messages in thread
From: Adhemerval Zanella @ 2022-06-09 13:21 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=7e09b33e16baf3f68ec6982334061b32509c1700

commit 7e09b33e16baf3f68ec6982334061b32509c1700
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Wed Mar 30 15:42:18 2022 -0300

    malloc: Disable malloc builtins on tests
    
    To avoid compiler optimize away memory allocation calls, which might
    interfere when both valid and invalid calls checks.

Diff:
---
 malloc/Makefile       | 11 +++++++++++
 malloc/tst-malloc.c   |  1 +
 malloc/tst-memalign.c |  3 +--
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/malloc/Makefile b/malloc/Makefile
index 4e32de2a0b..250717d255 100644
--- a/malloc/Makefile
+++ b/malloc/Makefile
@@ -367,3 +367,14 @@ tst-mallocstate-malloc-check-ENV = LD_PRELOAD=$(objpfx)libc_malloc_debug.so
 # libc_malloc_debug.so.
 $(objpfx)tst-mallocstate: $(objpfx)libc_malloc_debug.so
 $(objpfx)tst-mallocstate-malloc-check: $(objpfx)libc_malloc_debug.so
+
+CFLAGS-tst-memalign.c += -fno-builtin
+CFLAGS-tst-malloc.c += -fno-builtin
+CFLAGS-tst-malloc-backtrace.c += -fno-builtin
+CFLAGS-tst-malloc-check.c += -fno-builtin
+CFLAGS-tst-malloc-too-large.c += -fno-builtin
+CFLAGS-tst-realloc.c += -fno-builtin
+CFLAGS-tst-valloc.c += -fno-builtin
+CFLAGS-tst-compathooks-off.c += -fno-builtin
+CFLAGS-tst-compathooks-on.c += -fno-builtin
+CFLAGS-tst-mallinfo2.c += -fno-builtin
diff --git a/malloc/tst-malloc.c b/malloc/tst-malloc.c
index 62e3b9b95c..e3855035e7 100644
--- a/malloc/tst-malloc.c
+++ b/malloc/tst-malloc.c
@@ -46,6 +46,7 @@ do_test (void)
   p = malloc (-1);
   DIAG_POP_NEEDS_COMMENT;
   save = errno;
+  asm volatile("" ::: "memory");
 
   if (p != NULL)
     merror ("malloc (-1) succeeded.");
diff --git a/malloc/tst-memalign.c b/malloc/tst-memalign.c
index b5933f4741..5da00954e2 100644
--- a/malloc/tst-memalign.c
+++ b/malloc/tst-memalign.c
@@ -124,5 +124,4 @@ do_test (void)
   return errors != 0;
 }
 
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [glibc/azanella/clang] malloc: Disable malloc builtins on tests
@ 2022-06-03 14:10 Adhemerval Zanella
  0 siblings, 0 replies; 19+ messages in thread
From: Adhemerval Zanella @ 2022-06-03 14:10 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=0b3cc16abb1de98b7908c3346084df7af928fa01

commit 0b3cc16abb1de98b7908c3346084df7af928fa01
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Wed Mar 30 15:42:18 2022 -0300

    malloc: Disable malloc builtins on tests
    
    To avoid compiler optimize away memory allocation calls, which might
    interfere when both valid and invalid calls checks.

Diff:
---
 malloc/Makefile       | 11 +++++++++++
 malloc/tst-malloc.c   |  1 +
 malloc/tst-memalign.c |  3 +--
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/malloc/Makefile b/malloc/Makefile
index 4e32de2a0b..250717d255 100644
--- a/malloc/Makefile
+++ b/malloc/Makefile
@@ -367,3 +367,14 @@ tst-mallocstate-malloc-check-ENV = LD_PRELOAD=$(objpfx)libc_malloc_debug.so
 # libc_malloc_debug.so.
 $(objpfx)tst-mallocstate: $(objpfx)libc_malloc_debug.so
 $(objpfx)tst-mallocstate-malloc-check: $(objpfx)libc_malloc_debug.so
+
+CFLAGS-tst-memalign.c += -fno-builtin
+CFLAGS-tst-malloc.c += -fno-builtin
+CFLAGS-tst-malloc-backtrace.c += -fno-builtin
+CFLAGS-tst-malloc-check.c += -fno-builtin
+CFLAGS-tst-malloc-too-large.c += -fno-builtin
+CFLAGS-tst-realloc.c += -fno-builtin
+CFLAGS-tst-valloc.c += -fno-builtin
+CFLAGS-tst-compathooks-off.c += -fno-builtin
+CFLAGS-tst-compathooks-on.c += -fno-builtin
+CFLAGS-tst-mallinfo2.c += -fno-builtin
diff --git a/malloc/tst-malloc.c b/malloc/tst-malloc.c
index 62e3b9b95c..e3855035e7 100644
--- a/malloc/tst-malloc.c
+++ b/malloc/tst-malloc.c
@@ -46,6 +46,7 @@ do_test (void)
   p = malloc (-1);
   DIAG_POP_NEEDS_COMMENT;
   save = errno;
+  asm volatile("" ::: "memory");
 
   if (p != NULL)
     merror ("malloc (-1) succeeded.");
diff --git a/malloc/tst-memalign.c b/malloc/tst-memalign.c
index b5933f4741..5da00954e2 100644
--- a/malloc/tst-memalign.c
+++ b/malloc/tst-memalign.c
@@ -124,5 +124,4 @@ do_test (void)
   return errors != 0;
 }
 
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [glibc/azanella/clang] malloc: Disable malloc builtins on tests
@ 2022-05-13 14:24 Adhemerval Zanella
  0 siblings, 0 replies; 19+ messages in thread
From: Adhemerval Zanella @ 2022-05-13 14:24 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=18392b1f6f4e541be6fe926368295ccdbae06b22

commit 18392b1f6f4e541be6fe926368295ccdbae06b22
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Wed Mar 30 15:42:18 2022 -0300

    malloc: Disable malloc builtins on tests
    
    To avoid compiler optimize away memory allocation calls, which might
    interfere when both valid and invalid calls checks.

Diff:
---
 malloc/Makefile       | 11 +++++++++++
 malloc/tst-malloc.c   |  1 +
 malloc/tst-memalign.c |  3 +--
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/malloc/Makefile b/malloc/Makefile
index 4e32de2a0b..250717d255 100644
--- a/malloc/Makefile
+++ b/malloc/Makefile
@@ -367,3 +367,14 @@ tst-mallocstate-malloc-check-ENV = LD_PRELOAD=$(objpfx)libc_malloc_debug.so
 # libc_malloc_debug.so.
 $(objpfx)tst-mallocstate: $(objpfx)libc_malloc_debug.so
 $(objpfx)tst-mallocstate-malloc-check: $(objpfx)libc_malloc_debug.so
+
+CFLAGS-tst-memalign.c += -fno-builtin
+CFLAGS-tst-malloc.c += -fno-builtin
+CFLAGS-tst-malloc-backtrace.c += -fno-builtin
+CFLAGS-tst-malloc-check.c += -fno-builtin
+CFLAGS-tst-malloc-too-large.c += -fno-builtin
+CFLAGS-tst-realloc.c += -fno-builtin
+CFLAGS-tst-valloc.c += -fno-builtin
+CFLAGS-tst-compathooks-off.c += -fno-builtin
+CFLAGS-tst-compathooks-on.c += -fno-builtin
+CFLAGS-tst-mallinfo2.c += -fno-builtin
diff --git a/malloc/tst-malloc.c b/malloc/tst-malloc.c
index 62e3b9b95c..e3855035e7 100644
--- a/malloc/tst-malloc.c
+++ b/malloc/tst-malloc.c
@@ -46,6 +46,7 @@ do_test (void)
   p = malloc (-1);
   DIAG_POP_NEEDS_COMMENT;
   save = errno;
+  asm volatile("" ::: "memory");
 
   if (p != NULL)
     merror ("malloc (-1) succeeded.");
diff --git a/malloc/tst-memalign.c b/malloc/tst-memalign.c
index b5933f4741..5da00954e2 100644
--- a/malloc/tst-memalign.c
+++ b/malloc/tst-memalign.c
@@ -124,5 +124,4 @@ do_test (void)
   return errors != 0;
 }
 
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [glibc/azanella/clang] malloc: Disable malloc builtins on tests
@ 2022-05-12 19:38 Adhemerval Zanella
  0 siblings, 0 replies; 19+ messages in thread
From: Adhemerval Zanella @ 2022-05-12 19:38 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=cf07256eacaab05d19b2589c28c10e3cf2fa1d9e

commit cf07256eacaab05d19b2589c28c10e3cf2fa1d9e
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Wed Mar 30 15:42:18 2022 -0300

    malloc: Disable malloc builtins on tests
    
    To avoid compiler optimize away memory allocation calls, which might
    interfere when both valid and invalid calls checks.

Diff:
---
 malloc/Makefile       | 11 +++++++++++
 malloc/tst-malloc.c   |  1 +
 malloc/tst-memalign.c |  3 +--
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/malloc/Makefile b/malloc/Makefile
index 4e32de2a0b..250717d255 100644
--- a/malloc/Makefile
+++ b/malloc/Makefile
@@ -367,3 +367,14 @@ tst-mallocstate-malloc-check-ENV = LD_PRELOAD=$(objpfx)libc_malloc_debug.so
 # libc_malloc_debug.so.
 $(objpfx)tst-mallocstate: $(objpfx)libc_malloc_debug.so
 $(objpfx)tst-mallocstate-malloc-check: $(objpfx)libc_malloc_debug.so
+
+CFLAGS-tst-memalign.c += -fno-builtin
+CFLAGS-tst-malloc.c += -fno-builtin
+CFLAGS-tst-malloc-backtrace.c += -fno-builtin
+CFLAGS-tst-malloc-check.c += -fno-builtin
+CFLAGS-tst-malloc-too-large.c += -fno-builtin
+CFLAGS-tst-realloc.c += -fno-builtin
+CFLAGS-tst-valloc.c += -fno-builtin
+CFLAGS-tst-compathooks-off.c += -fno-builtin
+CFLAGS-tst-compathooks-on.c += -fno-builtin
+CFLAGS-tst-mallinfo2.c += -fno-builtin
diff --git a/malloc/tst-malloc.c b/malloc/tst-malloc.c
index 62e3b9b95c..e3855035e7 100644
--- a/malloc/tst-malloc.c
+++ b/malloc/tst-malloc.c
@@ -46,6 +46,7 @@ do_test (void)
   p = malloc (-1);
   DIAG_POP_NEEDS_COMMENT;
   save = errno;
+  asm volatile("" ::: "memory");
 
   if (p != NULL)
     merror ("malloc (-1) succeeded.");
diff --git a/malloc/tst-memalign.c b/malloc/tst-memalign.c
index b5933f4741..5da00954e2 100644
--- a/malloc/tst-memalign.c
+++ b/malloc/tst-memalign.c
@@ -124,5 +124,4 @@ do_test (void)
   return errors != 0;
 }
 
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [glibc/azanella/clang] malloc: Disable malloc builtins on tests
@ 2022-05-10 18:28 Adhemerval Zanella
  0 siblings, 0 replies; 19+ messages in thread
From: Adhemerval Zanella @ 2022-05-10 18:28 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=baea5737f6473e6c3f017cf47705a50d5f4ac0ec

commit baea5737f6473e6c3f017cf47705a50d5f4ac0ec
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Wed Mar 30 15:42:18 2022 -0300

    malloc: Disable malloc builtins on tests
    
    To avoid compiler optimize away memory allocation calls, which might
    interfere when both valid and invalid calls checks.

Diff:
---
 malloc/Makefile       | 11 +++++++++++
 malloc/tst-malloc.c   |  1 +
 malloc/tst-memalign.c |  3 +--
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/malloc/Makefile b/malloc/Makefile
index 4e32de2a0b..250717d255 100644
--- a/malloc/Makefile
+++ b/malloc/Makefile
@@ -367,3 +367,14 @@ tst-mallocstate-malloc-check-ENV = LD_PRELOAD=$(objpfx)libc_malloc_debug.so
 # libc_malloc_debug.so.
 $(objpfx)tst-mallocstate: $(objpfx)libc_malloc_debug.so
 $(objpfx)tst-mallocstate-malloc-check: $(objpfx)libc_malloc_debug.so
+
+CFLAGS-tst-memalign.c += -fno-builtin
+CFLAGS-tst-malloc.c += -fno-builtin
+CFLAGS-tst-malloc-backtrace.c += -fno-builtin
+CFLAGS-tst-malloc-check.c += -fno-builtin
+CFLAGS-tst-malloc-too-large.c += -fno-builtin
+CFLAGS-tst-realloc.c += -fno-builtin
+CFLAGS-tst-valloc.c += -fno-builtin
+CFLAGS-tst-compathooks-off.c += -fno-builtin
+CFLAGS-tst-compathooks-on.c += -fno-builtin
+CFLAGS-tst-mallinfo2.c += -fno-builtin
diff --git a/malloc/tst-malloc.c b/malloc/tst-malloc.c
index 62e3b9b95c..e3855035e7 100644
--- a/malloc/tst-malloc.c
+++ b/malloc/tst-malloc.c
@@ -46,6 +46,7 @@ do_test (void)
   p = malloc (-1);
   DIAG_POP_NEEDS_COMMENT;
   save = errno;
+  asm volatile("" ::: "memory");
 
   if (p != NULL)
     merror ("malloc (-1) succeeded.");
diff --git a/malloc/tst-memalign.c b/malloc/tst-memalign.c
index b5933f4741..5da00954e2 100644
--- a/malloc/tst-memalign.c
+++ b/malloc/tst-memalign.c
@@ -124,5 +124,4 @@ do_test (void)
   return errors != 0;
 }
 
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [glibc/azanella/clang] malloc: Disable malloc builtins on tests
@ 2022-04-29 14:08 Adhemerval Zanella
  0 siblings, 0 replies; 19+ messages in thread
From: Adhemerval Zanella @ 2022-04-29 14:08 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=41f1d66c9bd771c780379020f38186b9d96ba32e

commit 41f1d66c9bd771c780379020f38186b9d96ba32e
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Wed Mar 30 15:42:18 2022 -0300

    malloc: Disable malloc builtins on tests
    
    To avoid compiler optimize away memory allocation calls, which might
    interfere when both valid and invalid calls checks.

Diff:
---
 malloc/Makefile       | 11 +++++++++++
 malloc/tst-malloc.c   |  1 +
 malloc/tst-memalign.c |  3 +--
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/malloc/Makefile b/malloc/Makefile
index 4e32de2a0b..250717d255 100644
--- a/malloc/Makefile
+++ b/malloc/Makefile
@@ -367,3 +367,14 @@ tst-mallocstate-malloc-check-ENV = LD_PRELOAD=$(objpfx)libc_malloc_debug.so
 # libc_malloc_debug.so.
 $(objpfx)tst-mallocstate: $(objpfx)libc_malloc_debug.so
 $(objpfx)tst-mallocstate-malloc-check: $(objpfx)libc_malloc_debug.so
+
+CFLAGS-tst-memalign.c += -fno-builtin
+CFLAGS-tst-malloc.c += -fno-builtin
+CFLAGS-tst-malloc-backtrace.c += -fno-builtin
+CFLAGS-tst-malloc-check.c += -fno-builtin
+CFLAGS-tst-malloc-too-large.c += -fno-builtin
+CFLAGS-tst-realloc.c += -fno-builtin
+CFLAGS-tst-valloc.c += -fno-builtin
+CFLAGS-tst-compathooks-off.c += -fno-builtin
+CFLAGS-tst-compathooks-on.c += -fno-builtin
+CFLAGS-tst-mallinfo2.c += -fno-builtin
diff --git a/malloc/tst-malloc.c b/malloc/tst-malloc.c
index 62e3b9b95c..e3855035e7 100644
--- a/malloc/tst-malloc.c
+++ b/malloc/tst-malloc.c
@@ -46,6 +46,7 @@ do_test (void)
   p = malloc (-1);
   DIAG_POP_NEEDS_COMMENT;
   save = errno;
+  asm volatile("" ::: "memory");
 
   if (p != NULL)
     merror ("malloc (-1) succeeded.");
diff --git a/malloc/tst-memalign.c b/malloc/tst-memalign.c
index b5933f4741..5da00954e2 100644
--- a/malloc/tst-memalign.c
+++ b/malloc/tst-memalign.c
@@ -124,5 +124,4 @@ do_test (void)
   return errors != 0;
 }
 
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [glibc/azanella/clang] malloc: Disable malloc builtins on tests
@ 2022-04-04 12:59 Adhemerval Zanella
  0 siblings, 0 replies; 19+ messages in thread
From: Adhemerval Zanella @ 2022-04-04 12:59 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=3159a333ff6214eb902bd0eef8ff2b59048ff4d1

commit 3159a333ff6214eb902bd0eef8ff2b59048ff4d1
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Wed Mar 30 15:42:18 2022 -0300

    malloc: Disable malloc builtins on tests
    
    To avoid compiler optimize away memory allocation calls, which might
    interfere when both valid and invalid calls checks.

Diff:
---
 malloc/Makefile       | 11 +++++++++++
 malloc/tst-malloc.c   |  1 +
 malloc/tst-memalign.c |  3 +--
 3 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/malloc/Makefile b/malloc/Makefile
index 4e32de2a0b..250717d255 100644
--- a/malloc/Makefile
+++ b/malloc/Makefile
@@ -367,3 +367,14 @@ tst-mallocstate-malloc-check-ENV = LD_PRELOAD=$(objpfx)libc_malloc_debug.so
 # libc_malloc_debug.so.
 $(objpfx)tst-mallocstate: $(objpfx)libc_malloc_debug.so
 $(objpfx)tst-mallocstate-malloc-check: $(objpfx)libc_malloc_debug.so
+
+CFLAGS-tst-memalign.c += -fno-builtin
+CFLAGS-tst-malloc.c += -fno-builtin
+CFLAGS-tst-malloc-backtrace.c += -fno-builtin
+CFLAGS-tst-malloc-check.c += -fno-builtin
+CFLAGS-tst-malloc-too-large.c += -fno-builtin
+CFLAGS-tst-realloc.c += -fno-builtin
+CFLAGS-tst-valloc.c += -fno-builtin
+CFLAGS-tst-compathooks-off.c += -fno-builtin
+CFLAGS-tst-compathooks-on.c += -fno-builtin
+CFLAGS-tst-mallinfo2.c += -fno-builtin
diff --git a/malloc/tst-malloc.c b/malloc/tst-malloc.c
index 62e3b9b95c..e3855035e7 100644
--- a/malloc/tst-malloc.c
+++ b/malloc/tst-malloc.c
@@ -46,6 +46,7 @@ do_test (void)
   p = malloc (-1);
   DIAG_POP_NEEDS_COMMENT;
   save = errno;
+  asm volatile("" ::: "memory");
 
   if (p != NULL)
     merror ("malloc (-1) succeeded.");
diff --git a/malloc/tst-memalign.c b/malloc/tst-memalign.c
index b5933f4741..5da00954e2 100644
--- a/malloc/tst-memalign.c
+++ b/malloc/tst-memalign.c
@@ -124,5 +124,4 @@ do_test (void)
   return errors != 0;
 }
 
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
+#include <support/test-driver.c>


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2024-04-17 20:11 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-17 20:11 [glibc/azanella/clang] malloc: Disable malloc builtins on tests Adhemerval Zanella
  -- strict thread matches above, loose matches on Subject: below --
2024-04-02 15:58 Adhemerval Zanella
2024-02-09 17:36 Adhemerval Zanella
2024-02-07 14:11 Adhemerval Zanella
2024-01-29 18:02 Adhemerval Zanella
2023-12-21 18:58 Adhemerval Zanella
2023-09-28 17:56 Adhemerval Zanella
2023-08-30 12:41 Adhemerval Zanella
2023-02-09 19:53 Adhemerval Zanella
2022-10-28 17:46 Adhemerval Zanella
2022-10-04 13:04 Adhemerval Zanella
2022-06-09 21:24 Adhemerval Zanella
2022-06-09 13:21 Adhemerval Zanella
2022-06-03 14:10 Adhemerval Zanella
2022-05-13 14:24 Adhemerval Zanella
2022-05-12 19:38 Adhemerval Zanella
2022-05-10 18:28 Adhemerval Zanella
2022-04-29 14:08 Adhemerval Zanella
2022-04-04 12:59 Adhemerval Zanella

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).