xref: /llvm-project/flang/test/Lower/OpenMP/ordered-threads.f90 (revision d84252e064b3f35aa879c10e207f77e931f351d9)
16d30d945SKiran Chandramohan! This test checks lowering of OpenMP ordered directive with threads Clause.
26d30d945SKiran Chandramohan! Without clause in ordered direcitve, it behaves as if threads clause is
36d30d945SKiran Chandramohan! specified.
46d30d945SKiran Chandramohan
56d30d945SKiran Chandramohan!RUN: %flang_fc1 -emit-hlfir -fopenmp %s -o - | FileCheck %s
66d30d945SKiran Chandramohan
76d30d945SKiran Chandramohansubroutine ordered
86d30d945SKiran Chandramohan        integer :: i
96d30d945SKiran Chandramohan        integer :: a(20)
106d30d945SKiran Chandramohan
11*d84252e0SSergio Afonso!CHECK: omp.ordered.region  {
126d30d945SKiran Chandramohan!$OMP ORDERED
136d30d945SKiran Chandramohan        a(i) = a(i-1) + 1
146d30d945SKiran Chandramohan!CHECK:   omp.terminator
156d30d945SKiran Chandramohan!CHECK-NEXT: }
166d30d945SKiran Chandramohan!$OMP END ORDERED
176d30d945SKiran Chandramohan
18*d84252e0SSergio Afonso!CHECK: omp.ordered.region  {
196d30d945SKiran Chandramohan!$OMP ORDERED THREADS
206d30d945SKiran Chandramohan        a(i) = a(i-1) + 1
216d30d945SKiran Chandramohan!CHECK:   omp.terminator
226d30d945SKiran Chandramohan!CHECK-NEXT: }
236d30d945SKiran Chandramohan!$OMP END ORDERED
246d30d945SKiran Chandramohan
256d30d945SKiran Chandramohanend
26