48 lines · plain
1! RUN: %python %S/../test_errors.py %s %flang -fopenmp2 3! 2.15.3 Although variables in common blocks can be accessed by use association4! or host association, common block names cannot. As a result, a common block5! name specified in a data-sharing attribute clause must be declared to be a6! common block in the same scoping unit in which the data-sharing attribute7! clause appears.8 9 common /c/ a, b10 integer a(3), b11 common /tc/ x12 integer x13 !$omp threadprivate(/tc/)14 15 A = 116 B = 217 block18 !ERROR: COMMON block must be declared in the same scoping unit in which the OpenMP directive or clause appears19 !$omp parallel shared(/c/)20 a(1:2) = 321 B = 422 !$omp end parallel23 end block24 print *, a, b25 26 !$omp parallel27 block28 !$omp single29 x = 1830 !ERROR: COMMON block must be declared in the same scoping unit in which the OpenMP directive or clause appears31 !$omp end single copyprivate(/tc/)32 end block33 !$omp end parallel34 35 ! Common block names may be used inside nested OpenMP directives.36 !$omp parallel37 !$omp parallel copyin(/tc/)38 x = x + 1039 !$omp end parallel40 !$omp end parallel41 42 !$omp parallel43 !$omp single44 x = 1845 !$omp end single copyprivate(/tc/)46 !$omp end parallel47end48