53 lines · plain
1! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp2! OpenMP Version 5.13! Check OpenMP construct validity for the following directives:4! 2.21.2 Threadprivate Directive5 6program main7 integer :: i, N = 108 integer, save :: x1, x2, x3, x4, x5, x6, x7, x8, x99 common /blk1/ y1, /blk2/ y2, /blk3/ y3, /blk4/ y4, /blk5/ y510 11 !$omp threadprivate(x1, x2, x3, x4, x5, x6, x7, x8, x9)12 !$omp threadprivate(/blk1/, /blk2/, /blk3/, /blk4/, /blk5/)13 14 !$omp parallel num_threads(x1)15 !$omp end parallel16 17 !$omp single copyprivate(x2, /blk1/)18 !$omp end single19 20 !$omp single21 !$omp end single copyprivate(x2, /blk1/)22 23 !$omp do schedule(static, x3)24 do i = 1, N25 y1 = x326 end do27 !$omp end do28 29 !$omp parallel copyin(x4, /blk2/)30 !$omp end parallel31 32 !$omp parallel if(x5 > 1)33 !$omp end parallel34 35 !$omp teams thread_limit(x6)36 !$omp end teams37 38 !ERROR: A THREADPRIVATE variable cannot be in PRIVATE clause39 !ERROR: A THREADPRIVATE variable cannot be in PRIVATE clause40 !$omp parallel private(x7, /blk3/)41 !$omp end parallel42 43 !ERROR: A THREADPRIVATE variable cannot be in FIRSTPRIVATE clause44 !ERROR: A THREADPRIVATE variable cannot be in FIRSTPRIVATE clause45 !$omp parallel firstprivate(x8, /blk4/)46 !$omp end parallel47 48 !ERROR: A THREADPRIVATE variable cannot be in SHARED clause49 !ERROR: A THREADPRIVATE variable cannot be in SHARED clause50 !$omp parallel shared(x9, /blk5/)51 !$omp end parallel52end53