Files
clang-p2996/flang/test/Semantics/OpenMP/threadprivate07.f90
harishch4 fa61f062a5 Fix threadprivate variable scope inside BLOCK construct. (#88921)
When a local variable inside a BLOCK construct is used as threadprivate
variable, llvm-flang throws below error:

> error: The THREADPRIVATE directive and the common block or variable in
it must appear in the same declaration section of a scoping unit
2024-04-17 15:21:45 +05:30

16 lines
301 B
Fortran

! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
! Check Threadprivate Directive with local variable of a BLOCK construct.
program main
call sub1()
print *, 'pass'
end program main
subroutine sub1()
BLOCK
integer, save :: a
!$omp threadprivate(a)
END BLOCK
end subroutine