diff options
Diffstat (limited to 'libgomp/testsuite/libgomp.c++/pr81314.C')
-rw-r--r-- | libgomp/testsuite/libgomp.c++/pr81314.C | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/libgomp/testsuite/libgomp.c++/pr81314.C b/libgomp/testsuite/libgomp.c++/pr81314.C new file mode 100644 index 00000000000..afe89438bd3 --- /dev/null +++ b/libgomp/testsuite/libgomp.c++/pr81314.C @@ -0,0 +1,38 @@ +// PR c++/81314 +// { dg-do link } + +template <int N> +struct S { + S () { s = 0; } + S (const S &x) { s = x.s; } + ~S () {} + int s; +}; + +void +foo (S<2> &x) +{ + #pragma omp taskloop + for (int i = 0; i < 100; ++i) + x.s++; +} + +void +bar (S<3> &x) +{ + #pragma omp task + x.s++; +} + +int +main () +{ + S<2> s; + S<3> t; + #pragma omp parallel + #pragma omp master + { + foo (s); + bar (t); + } +} |