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: r262287
+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.
+
2018-07-01 Tom de Vries <tdevries@suse.de>
* lib/gcc-dg.exp (get-absolute-line): Handle '.'.
#ifdef PREVENT_OPTIMIZATION
#define ATTRIBUTE_USED __attribute__((used))
+#define VOLATILE volatile
#else
#define ATTRIBUTE_USED
+#define VOLATILE
#endif
#endif
/* { dg-do run } */
/* { dg-options "-g" } */
+#include "prevent-optimization.h"
+
void __attribute__((noinline))
bar (short *p)
{
int __attribute__((noinline))
f1 (int i)
{
- char a[i + 1];
+ VOLATILE char a[i + 1];
a[0] = 5; /* { dg-final { gdb-test .+1 "i" "5" } } */
return a[0]; /* { dg-final { gdb-test . "sizeof (a)" "6" } } */
}