]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
testsuite: robustify gcc.target/m68k/20100512-1.c
authorAndreas Schwab <schwab@suse.de>
Tue, 19 Nov 2024 16:35:14 +0000 (17:35 +0100)
committerAndreas Schwab <schwab@suse.de>
Tue, 19 Nov 2024 16:38:27 +0000 (17:38 +0100)
This has been failing since r5-2883-g8cb65b3725f0c3 which caused the
memset to be optimized out.  Add an unoptimizable reference to the local
variable to keep it.

* gcc.target/m68k/20100512-1.c (doTest1, doTest2): Add asm that
references foo.

gcc/testsuite/gcc.target/m68k/20100512-1.c

index d07bb519abc1c50ead3f0af6a68205bde9c58e42..ab54a92e9652cfc4383ff11b1a89c2d36ef5a250 100644 (file)
@@ -9,8 +9,10 @@
 void doTest1(void) {
   volatile char foo[10];
   memset((void *)foo, 1, 100);
+  asm volatile("# %0" : : "g"(foo));
 }
 void doTest2(void) {
   volatile char foo[10];
   memset((void *)foo, 1, 100);
+  asm volatile("# %0" : : "g"(foo));
 }