Skip to content

Commit b340310

Browse files
[NFC][Flang][Test] Add some missing tests (#110468)
- At most one Collapse clause in SIMD construct - A DO loop must follow the SIMD directive
1 parent 2526455 commit b340310

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

flang/test/Semantics/OpenMP/do-collapse.f90

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,11 @@ program omp_doCollapse
3030
do
3131
end do
3232
end do
33-
end program omp_doCollapse
3433

34+
!ERROR: At most one COLLAPSE clause can appear on the SIMD directive
35+
!$omp simd collapse(2) collapse(1)
36+
do i = 1, 4
37+
j = j + i + 1
38+
end do
39+
!$omp end simd
40+
end program omp_doCollapse

flang/test/Semantics/OpenMP/loop-association.f90

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,4 +131,10 @@
131131
!$omp end parallel do simd
132132
!ERROR: The END PARALLEL DO SIMD directive must follow the DO loop associated with the loop construct
133133
!$omp end parallel do simd
134+
135+
!ERROR: A DO loop must follow the SIMD directive
136+
!$omp simd
137+
a = i + 1
138+
!ERROR: The END SIMD directive must follow the DO loop associated with the loop construct
139+
!$omp end simd
134140
end

0 commit comments

Comments
 (0)