aboutsummaryrefslogtreecommitdiff
path: root/libgomp/testsuite
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2007-11-10 08:51:55 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2007-11-10 08:51:55 +0100
commit78e4746337d87401a818d0179597e19fab620ee0 (patch)
tree9d3f2ce4c54127ae9b5aa594d54bd9031add67ce /libgomp/testsuite
parent416c991fdd5568197d0f545c0e0a2ad3fd577dc6 (diff)
downloadgcc-78e4746337d87401a818d0179597e19fab620ee0.zip
gcc-78e4746337d87401a818d0179597e19fab620ee0.tar.gz
gcc-78e4746337d87401a818d0179597e19fab620ee0.tar.bz2
re PR fortran/34020 (Bogus codegen for openmp atomics w/ indirects operands on IPF)
PR fortran/34020 * gimplify.c (goa_lhs_expr_p): Inside INDIRECT_REF handle unshared nops. * testsuite/libgomp.fortran/pr34020.f90: New test. From-SVN: r130069
Diffstat (limited to 'libgomp/testsuite')
-rw-r--r--libgomp/testsuite/libgomp.fortran/pr34020.f9019
1 files changed, 19 insertions, 0 deletions
diff --git a/libgomp/testsuite/libgomp.fortran/pr34020.f90 b/libgomp/testsuite/libgomp.fortran/pr34020.f90
new file mode 100644
index 0000000..3bb14f5
--- /dev/null
+++ b/libgomp/testsuite/libgomp.fortran/pr34020.f90
@@ -0,0 +1,19 @@
+! PR fortran/34020
+! { dg-do run }
+
+ subroutine atomic_add(lhs, rhs)
+ real lhs, rhs
+!$omp atomic
+ lhs = rhs + lhs
+ end
+
+ real lhs, rhs
+ integer i
+ lhs = 0
+ rhs = 1
+!$omp parallel do num_threads(8) shared(lhs, rhs)
+ do i = 1, 300000
+ call atomic_add(lhs, rhs)
+ enddo
+ if (lhs .ne. 300000) call abort
+ end