mirror of
https://github.com/OpenMP/Examples.git
synced 2025-04-07 23:22:11 +01:00
24 lines
396 B
C
24 lines
396 B
C
/*
|
|
* @@name: nesting_restrict.4c
|
|
* @@type: C
|
|
* @@compilable: no
|
|
* @@linkable: no
|
|
* @@expect: failure
|
|
*/
|
|
void work(int i, int j) {}
|
|
void wrong4(int n)
|
|
{
|
|
|
|
#pragma omp parallel default(shared)
|
|
{
|
|
int i;
|
|
#pragma omp for
|
|
for (i=0; i<n; i++) {
|
|
work(i, 0);
|
|
/* incorrect nesting of barrier region in a loop region */
|
|
#pragma omp barrier
|
|
work(i, 1);
|
|
}
|
|
}
|
|
}
|