diff options
author | Tom de Vries <tom@codesourcery.com> | 2017-08-07 17:06:11 +0000 |
---|---|---|
committer | Tom de Vries <vries@gcc.gnu.org> | 2017-08-07 17:06:11 +0000 |
commit | f4c222c0358dc0f9f6390e1eee1c6a9214f7f829 (patch) | |
tree | 75adc4e765783e7a1a3ac4a08c86f29481880c7c /libgomp/testsuite | |
parent | 58fccd6c21433d60c8ff41272c2edec0d4f39df7 (diff) | |
download | gcc-f4c222c0358dc0f9f6390e1eee1c6a9214f7f829.zip gcc-f4c222c0358dc0f9f6390e1eee1c6a9214f7f829.tar.gz gcc-f4c222c0358dc0f9f6390e1eee1c6a9214f7f829.tar.bz2 |
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
Diffstat (limited to 'libgomp/testsuite')
-rw-r--r-- | libgomp/testsuite/libgomp.oacc-c-c++-common/vprop-2.c | 45 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.oacc-c-c++-common/vprop.c | 1 |
2 files changed, 45 insertions, 1 deletions
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/vprop-2.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/vprop-2.c new file mode 100644 index 0000000..046ac68 --- /dev/null +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/vprop-2.c @@ -0,0 +1,45 @@ +/* { dg-do run } */ + +#include <assert.h> + +#define DO_PRAGMA(x) _Pragma (#x) + +#define test(idx,type,ngangs) \ + void \ + test_##idx () \ + { \ + int b[100]; \ + \ + for (unsigned int i = 0; i < 100; i++) \ + b[i] = 0; \ + \ + DO_PRAGMA(acc parallel num_gangs (ngangs) copy (b)) \ + { \ + _Pragma("acc loop gang") \ + for (type j = 0; j < 5; j++) \ + { \ + _Pragma("acc loop vector") \ + for (unsigned int i = 0; i < 20; i++) \ + b[j * 20 + i] = -2; \ + } \ + } \ + \ + for (unsigned int i = 0; i < 100; i++) \ + assert (b[i] == -2); \ + } + +test (0, signed char, 256) +test (1, unsigned char, 256) +test (2, signed short, 65535) +test (3, unsigned short, 65535) + +int +main () +{ + test_0 (); + test_1 (); + test_2 (); + test_3 (); + + return 0; +} diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/vprop.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/vprop.c index 0ac0cf6..e4dd682 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/vprop.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/vprop.c @@ -1,5 +1,4 @@ /* { dg-do run } */ -/* { dg-xfail-run-if "PR78266" { openacc_nvidia_accel_selected } } */ #include <assert.h> |