From 039edd5cd47a6fcd3c9889306ee64a477771422d Mon Sep 17 00:00:00 2001 From: Frits van Bommel Date: Sat, 9 May 2009 00:55:47 +0200 Subject: [PATCH] Make sure this testcase keeps crashing with -O3. Recent optimization improvements made LLVM realize the store-to-null was unavoidable, so it deleted all of main() and replaced it with 'unreachable'. Because the body of main() no longer even contained a return instruction, calling it caused random code to be ran instead. This happened to be the code that links in the ModuleInfo on my machine, which then returned "successfully". --- tests/mini/norun_debug11.d | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/mini/norun_debug11.d b/tests/mini/norun_debug11.d index 2bbf4b9d..67c70182 100644 --- a/tests/mini/norun_debug11.d +++ b/tests/mini/norun_debug11.d @@ -28,6 +28,6 @@ void main() auto ci = c.classinfo; - int* fail; + int* fail = cast(int*) 1; *fail = 0; }