Skip to content

Commit ddda2b2

Browse files
committed
Added tests for directives no longer allowed to be nested in
order(concurrent) regions in OpenMP 6.0
1 parent d0b9502 commit ddda2b2

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

clang/test/OpenMP/for_order_messages.cpp

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,52 @@ int main(int argc, char **argv) {
4848
#pragma omp target //omp51-error {{construct 'target' not allowed in a region associated with a directive with 'order' clause}} omp60-error {{construct 'target' not allowed in a region associated with a directive with 'order' clause}}
4949
A++;
5050
}
51+
52+
#pragma omp loop bind(parallel) order(concurrent)
53+
for (int i = 0; i < 10; ++i) {
54+
#pragma omp parallel for //omp60-error {{construct 'parallel for' not allowed in a region associated with a directive with 'order' clause}}
55+
for (int j = 0; j < 10; ++j) {
56+
A += j;
57+
}
58+
}
59+
60+
#pragma omp distribute order(concurrent)
61+
for (int i = 0; i < 10; ++i) {
62+
#pragma omp parallel for simd //omp60-error {{construct 'parallel for simd' not allowed in a region associated with a directive with 'order' clause}}
63+
for (int j = 0; j < 10; ++j) {
64+
A += j;
65+
}
66+
}
67+
68+
#pragma omp for order(concurrent)
69+
for (int i = 0; i < 10; ++i) {
70+
#pragma omp parallel master //omp60-error {{construct 'parallel master' not allowed in a region associated with a directive with 'order' clause}}
71+
for (int j = 0; j < 10; ++j) {
72+
A += j;
73+
}
74+
}
75+
76+
#pragma omp for order(concurrent)
77+
for (int i = 0; i < 10; ++i) {
78+
#pragma omp parallel master taskloop //omp60-error {{construct 'parallel master taskloop' not allowed in a region associated with a directive with 'order' clause}}
79+
for (int j = 0; j < 10; ++j) {
80+
A += j;
81+
}
82+
}
83+
84+
#pragma omp for order(concurrent)
85+
for (int i = 0; i < 10; ++i) {
86+
#pragma omp parallel master taskloop simd //omp60-error {{construct 'parallel master taskloop simd' not allowed in a region associated with a directive with 'order' clause}}
87+
for (int j = 0; j < 10; ++j) {
88+
A += j;
89+
}
90+
}
91+
92+
#pragma omp for order(concurrent)
93+
for (int i = 0; i < 10; ++i) {
94+
#pragma omp parallel sections //omp60-error {{construct 'parallel sections' not allowed in a region associated with a directive with 'order' clause}}
95+
{
96+
A++;
97+
}
98+
}
5199
}

0 commit comments

Comments
 (0)