[WebAssembly] Fix asan issue from https://reviews.llvm.org/D121349
[llvm-project.git] / flang / test / Semantics / omp-reduction02.f90
blob634381437a4e4e38bc817b3d5efabd46ba2b5ac2
1 ! RUN: %python %S/test_errors.py %s %flang_fc1 -fopenmp
2 ! OpenMP Version 4.5
3 ! 2.15.3.6 Reduction Clause
4 program omp_reduction
6 integer :: i
7 integer :: k = 10
8 integer :: j = 10
10 !ERROR: 'k' appears in more than one data-sharing clause on the same OpenMP directive
11 !$omp parallel do reduction(+:k), reduction(-:k)
12 do i = 1, 10
13 k = k + 1
14 end do
15 !$omp end parallel do
17 !ERROR: 'k' appears in more than one data-sharing clause on the same OpenMP directive
18 !$omp parallel do reduction(+:k), reduction(-:j), reduction(+:k)
19 do i = 1, 10
20 k = k + 1
21 end do
22 !$omp end parallel do
24 !ERROR: 'k' appears in more than one data-sharing clause on the same OpenMP directive
25 !$omp parallel do reduction(+:j), reduction(-:k), reduction(+:k)
26 do i = 1, 10
27 k = k + 1
28 end do
29 !$omp end parallel do
31 !ERROR: 'k' appears in more than one data-sharing clause on the same OpenMP directive
32 !$omp parallel do reduction(+:j), reduction(-:k), private(k)
33 do i = 1, 10
34 k = k + 1
35 end do
36 !$omp end parallel do
37 end program omp_reduction