From c79668d42502a966790eb1b5471ca1c4a231eae8 Mon Sep 17 00:00:00 2001 From: Andrei Horodniceanu Date: Tue, 19 Aug 2025 20:29:50 +0300 Subject: [PATCH] druntime-test: memoryerror_stackoverflow try harder to avoid optimizations gdc and ldc2 with llvm-20 optimize away the array declarations leading to an infinite cycle. See-Also: https://github.com/ldc-developers/ldc/pull/4969 Signed-off-by: Andrei Horodniceanu --- druntime/test/exceptions/src/memoryerror_stackoverflow.d | 3 +++ 1 file changed, 3 insertions(+) diff --git a/druntime/test/exceptions/src/memoryerror_stackoverflow.d b/druntime/test/exceptions/src/memoryerror_stackoverflow.d index f54d78d26a19..729174f199db 100644 --- a/druntime/test/exceptions/src/memoryerror_stackoverflow.d +++ b/druntime/test/exceptions/src/memoryerror_stackoverflow.d @@ -1,16 +1,19 @@ import etc.linux.memoryerror; +import core.volatile; pragma(inline, false): void f(ref ubyte[1024] buf) { ubyte[1024] cpy = buf; + volatileStore(&cpy[0], 1); g(cpy); } void g(ref ubyte[1024] buf) { ubyte[1024] cpy = buf; + volatileStore(&cpy[0], 2); f(cpy); }