summaryrefslogtreecommitdiff
path: root/libgomp
diff options
context:
space:
mode:
authorTom de Vries <tom@codesourcery.com>2015-12-02 13:32:51 +0000
committerTom de Vries <vries@gcc.gnu.org>2015-12-02 13:32:51 +0000
commit694e5e4baebff76320ecbb0c119bc086126c4095 (patch)
tree6b472c95b371572ac65f8248f47d8aac5477666b /libgomp
parent7dbf36f7cb76a7e2bb8a8658f608ee659fe07cb9 (diff)
downloadgcc-694e5e4baebff76320ecbb0c119bc086126c4095.tar.gz
Handle BUILT_IN_GOACC_PARALLEL in ipa-pta
2015-12-02 Tom de Vries <tom@codesourcery.com> * tree-ssa-structalias.c (find_func_aliases_for_builtin_call) (find_func_clobbers, ipa_pta_execute): Handle BUILT_IN_GOACC_PARALLEL. * c-c++-common/goacc/kernels-alias-ipa-pta-2.c: New test. * c-c++-common/goacc/kernels-alias-ipa-pta-3.c: New test. * c-c++-common/goacc/kernels-alias-ipa-pta.c: New test. From-SVN: r231169
Diffstat (limited to 'libgomp')
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta-2.c27
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta-3.c26
-rw-r--r--libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta.c26
3 files changed, 79 insertions, 0 deletions
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta-2.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta-2.c
new file mode 100644
index 00000000000..0f323c82d2c
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta-2.c
@@ -0,0 +1,27 @@
+/* { dg-additional-options "-O2 -fipa-pta" } */
+
+#include <stdlib.h>
+
+#define N 2
+
+int
+main (void)
+{
+ unsigned int *a = (unsigned int *)malloc (N * sizeof (unsigned int));
+ unsigned int *b = (unsigned int *)malloc (N * sizeof (unsigned int));
+ unsigned int *c = (unsigned int *)malloc (N * sizeof (unsigned int));
+
+#pragma acc kernels pcopyout (a[0:N], b[0:N], c[0:N])
+ {
+ a[0] = 0;
+ b[0] = 1;
+ c[0] = a[0];
+ }
+
+ if (a[0] != 0 || b[0] != 1 || c[0] != 0)
+ abort ();
+
+ free (a);
+ free (b);
+ free (c);
+}
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta-3.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta-3.c
new file mode 100644
index 00000000000..654e750c3b4
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta-3.c
@@ -0,0 +1,26 @@
+/* { dg-additional-options "-O2 -fipa-pta" } */
+
+#include <stdlib.h>
+
+#define N 2
+
+int
+main (void)
+{
+ unsigned int *a = (unsigned int *)malloc (N * sizeof (unsigned int));
+ unsigned int *b = a;
+ unsigned int *c = (unsigned int *)malloc (N * sizeof (unsigned int));
+
+#pragma acc kernels pcopyout (a[0:N], b[0:N], c[0:N])
+ {
+ a[0] = 0;
+ b[0] = 1;
+ c[0] = a[0];
+ }
+
+ if (a[0] != 1 || b[0] != 1 || c[0] != 1)
+ abort ();
+
+ free (a);
+ free (c);
+}
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta.c
new file mode 100644
index 00000000000..44d4fd25cd2
--- /dev/null
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-alias-ipa-pta.c
@@ -0,0 +1,26 @@
+/* { dg-additional-options "-O2 -fipa-pta" } */
+
+#include <stdlib.h>
+
+#define N 2
+
+int
+main (void)
+{
+ unsigned int a[N];
+ unsigned int b[N];
+ unsigned int c[N];
+
+#pragma acc kernels pcopyout (a, b, c)
+ {
+ a[0] = 0;
+ b[0] = 1;
+ c[0] = a[0];
+ }
+
+ if (a[0] != 0 || b[0] != 1 || c[0] != 0)
+ abort ();
+
+ return 0;
+}
+