Tim Keith | 99aa87a | 2020-05-11 18:38:53 | [diff] [blame^] | 1 | ! RUN: %S/test_errors.sh %s %t %f18 -fopenmp |
Jinxin Yang | f396157 | 2019-09-16 06:08:29 | [diff] [blame] | 2 | |
| 3 | ! 2.15.3 Although variables in common blocks can be accessed by use association |
| 4 | ! or host association, common block names cannot. As a result, a common block |
| 5 | ! name specified in a data-sharing attribute clause must be declared to be a |
| 6 | ! common block in the same scoping unit in which the data-sharing attribute |
| 7 | ! clause appears. |
| 8 | |
| 9 | common /c/ a, b |
| 10 | integer a(3), b |
| 11 | |
| 12 | A = 1 |
| 13 | B = 2 |
| 14 | block |
| 15 | !ERROR: COMMON block must be declared in the same scoping unit in which the OpenMP directive or clause appears |
| 16 | !$omp parallel shared(/c/) |
| 17 | a(1:2) = 3 |
| 18 | B = 4 |
| 19 | !$omp end parallel |
| 20 | end block |
| 21 | print *, a, b |
| 22 | end |