[WebAssembly] Fix asan issue from https://reviews.llvm.org/D121349
[llvm-project.git] / flang / test / Semantics / omp-copyprivate01.f90
blob37912ed1ef3d78b0696c2e9cc4820c6898fe46ff
1 ! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
2 ! OpenMP Version 4.5
3 ! 2.15.4.2 copyprivate Clause
4 ! A list item that appears in a copyprivate clause may not appear in a
5 ! private or firstprivate clause on the single construct.
7 program omp_copyprivate
8 integer :: a(10), b(10), k
10 k = 10
11 a = 10
12 b = a * 10
14 !$omp parallel
15 !$omp single private(k)
16 a = a + k
17 !ERROR: COPYPRIVATE variable 'k' may not appear on a PRIVATE or FIRSTPRIVATE clause on a SINGLE construct
18 !$omp end single copyprivate(k)
19 !$omp single firstprivate(k)
20 b = a - k
21 !ERROR: COPYPRIVATE variable 'k' may not appear on a PRIVATE or FIRSTPRIVATE clause on a SINGLE construct
22 !$omp end single copyprivate(k)
23 !$omp end parallel
25 print *, a, b
27 end program omp_copyprivate