diff options
| author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-09-18 16:46:17 +0000 |
|---|---|---|
| committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-09-18 16:46:17 +0000 |
| commit | 55d16af7d8b06febc456e2e4fc425288ba295f5f (patch) | |
| tree | 6955ba1ea071da09a5e83f351001ec836bc3dafe /libgomp | |
| parent | 1090951232851e5ed0bac9787c3cd3e570644582 (diff) | |
| download | ppe42-gcc-55d16af7d8b06febc456e2e4fc425288ba295f5f.tar.gz ppe42-gcc-55d16af7d8b06febc456e2e4fc425288ba295f5f.zip | |
PR c++/63248
* semantics.c (finish_omp_clauses): Don't call cp_omp_mappable_type
on type of type dependent expressions, and don't call it if
handle_omp_array_sections has kept TREE_LIST because something
was type dependent.
* pt.c (tsubst_expr) <case OMP_TARGET, case OMP_TARGET_DATA>:
Use keep_next_level, begin_omp_structured_block and
finish_omp_structured_block instead of push_stmt_list and
pop_stmt_list.
libgomp/
* testsuite/libgomp.c++/pr63248.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_9-branch@215360 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgomp')
| -rw-r--r-- | libgomp/ChangeLog | 5 | ||||
| -rw-r--r-- | libgomp/testsuite/libgomp.c++/pr63248.C | 62 |
2 files changed, 67 insertions, 0 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index d9d5db7c3c7..295800b4ba9 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,8 @@ +2014-09-18 Jakub Jelinek <jakub@redhat.com> + + PR c++/63248 + * testsuite/libgomp.c++/pr63248.C: New test. + 2014-08-04 Jakub Jelinek <jakub@redhat.com> * task.c (GOMP_taskgroup_end): If taskgroup->num_children diff --git a/libgomp/testsuite/libgomp.c++/pr63248.C b/libgomp/testsuite/libgomp.c++/pr63248.C new file mode 100644 index 00000000000..48d3f0af797 --- /dev/null +++ b/libgomp/testsuite/libgomp.c++/pr63248.C @@ -0,0 +1,62 @@ +// PR c++/63248 +// { dg-do run } + +int *v; + +template <typename T> +T +foo (T A, T B) +{ + T a = 2; + T b = 4; + +#pragma omp target map(v[a:b]) + v[a] = 1; + +#pragma omp target map(v[A:B]) + v[a] = 2; + +#pragma omp target map(A) + A = 19; + return A; +} + +template <int N> +int +bar (int A, int B) +{ +#pragma omp target map(A) + A = 8; + if (A != 8) + __builtin_abort (); +#pragma omp target map(A, B) + { + A = 1; + B = 2; + } + return A + B; +} + +int +baz (int A, int B) +{ +#pragma omp target map(A) + A = 8; + if (A != 8) + __builtin_abort (); +#pragma omp target map(A, B) + { + A = 1; + B = 2; + } + return A + B; +} + +int +main () +{ + int a[10] = { 0 }; + v = a; + if (foo (1, 5) != 19 || v[2] != 2 || bar<0> (5, 7) != 3 || baz (5, 7) != 3) + __builtin_abort (); +} |

