gcc/libgomp/testsuite/libgomp.oacc-c-c++-common/vprop.c
Tom de Vries f4c222c035 Fix diff_type in expand_oacc_for char iter_type
2017-08-07  Tom de Vries  <tom@codesourcery.com>

	PR middle-end/78266
	* omp-expand.c (expand_oacc_for): Ensure diff_type is large enough.

	* testsuite/libgomp.oacc-c-c++-common/vprop-2.c: New test.
	* testsuite/libgomp.oacc-c-c++-common/vprop.c: Remove xfail.

From-SVN: r250925
2017-08-07 17:06:11 +00:00

37 lines
636 B
C

/* { dg-do run } */
#include <assert.h>
#define test(type) \
void \
test_##type () \
{ \
signed type b[100]; \
signed type i, j, x = -1, y = -1; \
\
_Pragma("acc parallel loop copyout (b)") \
for (j = 0; j > -5; j--) \
{ \
type c = x+y; \
_Pragma("acc loop vector") \
for (i = 0; i < 20; i++) \
b[-j*20 + i] = c; \
b[5-j] = c; \
} \
\
for (i = 0; i < 100; i++) \
assert (b[i] == -2); \
}
test(char)
test(short)
int
main ()
{
test_char ();
test_short ();
return 0;
}