aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/guality
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2018-07-01 20:25:55 +0000
committerTom de Vries <vries@gcc.gnu.org>2018-07-01 20:25:55 +0000
commit2d0bc0af9c9a61a6ec445b98ee87e8774eff867d (patch)
tree25810e04d11f432287265f304f2f6a978edcfe66 /gcc/testsuite/gcc.dg/guality
parent4aef57c991dc27734d53413b6df33a448076e617 (diff)
downloadgcc-2d0bc0af9c9a61a6ec445b98ee87e8774eff867d.zip
gcc-2d0bc0af9c9a61a6ec445b98ee87e8774eff867d.tar.gz
gcc-2d0bc0af9c9a61a6ec445b98ee87e8774eff867d.tar.bz2
Revert "[testsuite/guality] Prevent optimization of local in vla-1.c"
2018-07-01 Tom de Vries <tdevries@suse.de> revert: 2018-07-01 Tom de Vries <tdevries@suse.de> * gcc.dg/guality/prevent-optimization.h (VOLATILE): Define. * gcc.dg/guality/vla-1.c (f1): Mark local vla a as VOLATILE. From-SVN: r262290
Diffstat (limited to 'gcc/testsuite/gcc.dg/guality')
-rw-r--r--gcc/testsuite/gcc.dg/guality/prevent-optimization.h2
-rw-r--r--gcc/testsuite/gcc.dg/guality/vla-1.c4
2 files changed, 1 insertions, 5 deletions
diff --git a/gcc/testsuite/gcc.dg/guality/prevent-optimization.h b/gcc/testsuite/gcc.dg/guality/prevent-optimization.h
index 57e945c..0ef84a3 100644
--- a/gcc/testsuite/gcc.dg/guality/prevent-optimization.h
+++ b/gcc/testsuite/gcc.dg/guality/prevent-optimization.h
@@ -21,10 +21,8 @@ along with GCC; see the file COPYING3. If not see
#ifdef PREVENT_OPTIMIZATION
#define ATTRIBUTE_USED __attribute__((used))
-#define VOLATILE volatile
#else
#define ATTRIBUTE_USED
-#define VOLATILE
#endif
#endif
diff --git a/gcc/testsuite/gcc.dg/guality/vla-1.c b/gcc/testsuite/gcc.dg/guality/vla-1.c
index d281185..264b9f3 100644
--- a/gcc/testsuite/gcc.dg/guality/vla-1.c
+++ b/gcc/testsuite/gcc.dg/guality/vla-1.c
@@ -2,8 +2,6 @@
/* { dg-do run } */
/* { dg-options "-g" } */
-#include "prevent-optimization.h"
-
void __attribute__((noinline))
bar (short *p)
{
@@ -14,7 +12,7 @@ bar (short *p)
int __attribute__((noinline))
f1 (int i)
{
- VOLATILE char a[i + 1];
+ char a[i + 1];
a[0] = 5; /* { dg-final { gdb-test .+1 "i" "5" } } */
return a[0]; /* { dg-final { gdb-test . "sizeof (a)" "6" } } */
}