diff options
author | Jakub Jelinek <jakub@redhat.com> | 2014-04-24 23:17:32 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2014-04-24 23:17:32 +0200 |
commit | f7468577f88cbfe33e0a5e9a2104a32f7e45c44f (patch) | |
tree | 58c72224fbdd8cfd29b26acb0ed228ad9bf56b58 /libgomp/testsuite/libgomp.c/loop-16.c | |
parent | 2f7ac5ce576962dc7610d8cb3e0b107b05d77bbf (diff) | |
download | gcc-f7468577f88cbfe33e0a5e9a2104a32f7e45c44f.zip gcc-f7468577f88cbfe33e0a5e9a2104a32f7e45c44f.tar.gz gcc-f7468577f88cbfe33e0a5e9a2104a32f7e45c44f.tar.bz2 |
tree.h (OMP_CLAUSE_LINEAR_GIMPLE_SEQ): Define.
* tree.h (OMP_CLAUSE_LINEAR_GIMPLE_SEQ): Define.
* gimplify.c (omp_is_private): Change last argument's type to int.
Only diagnose lastprivate if the simd argument is 1, only diagnose
linear if the simd argument is 2.
(gimplify_omp_for): Adjust omp_is_private callers. When adding
lastprivate or private, add the clause to OMP_FOR_CLAUSES. Pass
GOVD_EXPLICIT to omp_add_variable. For simd with collapse == 1
create OMP_CLAUSE_LINEAR rather than OMP_CLAUSE_PRIVATE for var.
If var != decl and decl is in OMP_CLAUSE_LINEAR, gimplify decl
increment to OMP_CLAUSE_LINEAR_GIMPLE_SEQ.
* omp-low.c (scan_sharing_clauses, lower_lastprivate_clauses): Handle
OMP_CLAUSE_LINEAR_GIMPLE_SEQ.
* tree-nested.c (convert_nonlocal_omp_clauses,
convert_local_omp_clauses): Handle OMP_CLAUSE_LINEAR.
* testsuite/libgomp.c/simd-7.c: New test.
* testsuite/libgomp.c/simd-8.c: New test.
* testsuite/libgomp.c/simd-9.c: New test.
* testsuite/libgomp.c/loop-16.c: New test.
From-SVN: r209760
Diffstat (limited to 'libgomp/testsuite/libgomp.c/loop-16.c')
-rw-r--r-- | libgomp/testsuite/libgomp.c/loop-16.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/libgomp/testsuite/libgomp.c/loop-16.c b/libgomp/testsuite/libgomp.c/loop-16.c new file mode 100644 index 0000000..3ef2f64 --- /dev/null +++ b/libgomp/testsuite/libgomp.c/loop-16.c @@ -0,0 +1,27 @@ +/* { dg-do run } */ + +extern void abort (void); + +volatile int count; +static int test (void) +{ + return ++count > 0; +} + +int i; + +int +main () +{ + #pragma omp for lastprivate (i) + for (i = 0; i < 10; ++i) + { + int *p = &i; + if (test ()) + continue; + abort (); + } + if (i != count) + abort (); + return 0; +} |