blob: ec952d9b78733754f461fb8a923e3c34000bab44 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
// PR c++/48869
// { dg-do run }
// { dg-options "-std=gnu++0x" }
template <const int N>
struct A
{
A () {}
A (const A&) = delete;
void foo () {}
~A () {}
};
template <const int N>
struct B
{
B () {}
B (const B&) {}
void foo () {}
~B () {}
};
void __attribute__((used))
foo (B<6> b6)
{
#pragma omp task
b6.foo ();
}
int
main ()
{
A<0> a0;
#pragma omp task shared(a0)
a0.foo ();
#pragma omp task default(shared)
a0.foo ();
#pragma omp parallel shared(a0)
#pragma omp task
a0.foo ();
#pragma omp task
{
A<1> a1;
a1.foo ();
}
B<0> b0;
#pragma omp task shared(b0)
b0.foo ();
B<1> b1;
#pragma omp task default(shared)
b1.foo ();
B<2> b2;
#pragma omp parallel shared(b2)
#pragma omp task
b2.foo ();
B<3> b3;
#pragma omp task
b3.foo ();
B<4> b4;
#pragma omp parallel private (b4)
#pragma omp task
b4.foo ();
B<5> b5;
#pragma omp parallel firstprivate (b5)
#pragma omp task
b5.foo ();
return 0;
}
|