[LoopReroll] Add an extra defensive check to avoid SCEV assertion.
[llvm-project.git] / flang / test / Semantics / omp-default.f90
blob5955a3a5facd1a9a46ea1f05eaf1a0ed6cf7c870
1 !RUN: %S/test_errors.sh %s %t %flang -fopenmp
2 !REQUIRES: shell
3 ! OpenMP Version 4.5
4 ! 2.15.3.1 default Clause
5 program omp_default
6 integer :: a(10), b(10), c(10),i,k
7 !ERROR: At most one DEFAULT clause can appear on the PARALLEL directive
8 !$omp parallel default(shared), default(private)
9 do i = 1, 10
10 c(i) = a(i) + b(i) + k
11 end do
12 !$omp end parallel
14 !ERROR: At most one DEFAULT clause can appear on the TASK directive
15 !$omp task default(shared), default(none), shared(a,b,c,k,i)
16 do i = 1, 10
17 c(i) = a(i) + b(i) + k
18 end do
19 !$omp end task
21 !ERROR: At most one DEFAULT clause can appear on the TASKLOOP directive
22 !$omp taskloop default(shared), default(private)
23 do i = 1, 10
24 c(i) = a(i) + b(i) + k
25 end do
26 !$omp end taskloop
28 !ERROR: At most one DEFAULT clause can appear on the TEAMS directive
29 !$omp teams default(shared), default(none), shared(i,a,b,k,c)
30 do i = 1, 10
31 c(i) = a(i) + b(i) + k
32 end do
33 !$omp end teams
35 end program omp_default