summaryrefslogtreecommitdiff
path: root/libgomp
diff options
context:
space:
mode:
authorTom de Vries <tom@codesourcery.com>2018-04-05 08:36:37 +0000
committerTom de Vries <vries@gcc.gnu.org>2018-04-05 08:36:37 +0000
commit2ba16fd2eb40c96e41de967ca32e4dea4b5e45a1 (patch)
tree26dcac04b2435d5bda5b7eba0accc7e71cccdde7 /libgomp
parent44780b91eb61d1a4ae3a6f94300d1b97a1d06557 (diff)
downloadgcc-2ba16fd2eb40c96e41de967ca32e4dea4b5e45a1.tar.gz
[nvptx] Fix neutering of bb with only cond jump
2018-04-05 Tom de Vries <tom@codesourcery.com> PR target/85204 * config/nvptx/nvptx.c (nvptx_single): Fix neutering of bb with only cond jump. * testsuite/libgomp.oacc-c-c++-common/broadcast-1.c: New test. From-SVN: r259125
Diffstat (limited to 'libgomp')
-rw-r--r--libgomp/ChangeLog5
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/broadcast-1.c49
2 files changed, 54 insertions, 0 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index a5a5e0631b2..ea28859efda 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,8 @@
+2018-04-05 Tom de Vries <tom@codesourcery.com>
+
+ PR target/85204
+ * testsuite/libgomp.oacc-c-c++-common/broadcast-1.c: New test.
+
2018-03-26 Tom de Vries <tom@codesourcery.com>
PR tree-optimization/85063
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/broadcast-1.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/broadcast-1.c
new file mode 100644
index 00000000000..ca0d37bf88a
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/broadcast-1.c
@@ -0,0 +1,49 @@
+/* Ensure that worker-vector state conditional expressions are
+ properly handled by the nvptx backend. */
+
+#include <assert.h>
+#include <math.h>
+
+
+#define N 1024
+
+int A[N][N] ;
+
+void test(int x)
+{
+#pragma acc parallel num_gangs(16) num_workers(4) vector_length(32) copyout(A)
+ {
+#pragma acc loop gang
+ for(int j=0;j<N;j++)
+ {
+ if (x==1)
+ {
+#pragma acc loop worker vector
+ for(int i=0;i<N;i++)
+ A[i][j] = 1;
+ }
+ else
+ {
+#pragma acc loop worker vector
+ for(int i=0;i<N;i++)
+ A[i][j] = -1;
+ }
+ }
+ }
+}
+
+
+int main(void)
+{
+ test (0);
+ for (int i = 0; i < N; i++)
+ for (int j = 0; j < N; j++)
+ assert (A[i][j] == -1);
+
+ test (1);
+ for (int i = 0; i < N; i++)
+ for (int j = 0; j < N; j++)
+ assert (A[i][j] == 1);
+
+ return 0;
+}