* tests/test-alloca-opt.c (func) [HAVE_ALLOCA]:
Now volatile, to foil whole-program optimization.
---
 ChangeLog               | 6 ++++++
 tests/test-alloca-opt.c | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 6436ddfb81..a8ed30c4ae 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-05-16  Paul Eggert  <egg...@cs.ucla.edu>
+
+       alloca-opt-tests: add a ‘volatile’
+       * tests/test-alloca-opt.c (func) [HAVE_ALLOCA]:
+       Now volatile, to foil whole-program optimization.
+
 2024-05-16  Collin Funk  <collin.fu...@gmail.com>
 
        byteswap tests: Strengthen tests.
diff --git a/tests/test-alloca-opt.c b/tests/test-alloca-opt.c
index 3f20779c9e..b22921758e 100644
--- a/tests/test-alloca-opt.c
+++ b/tests/test-alloca-opt.c
@@ -29,7 +29,7 @@ do_allocation (int n)
   (void) ptr;
 }
 
-void (*func) (int) = do_allocation;
+void (*volatile func) (int) = do_allocation;
 
 #endif
 
-- 
2.45.0


Reply via email to