Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions flang/test/Lower/OpenMP/flush02.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
! This test checks lowering of OpenMP Flush Directive.

!RUN: %flang_fc1 -emit-hlfir -fopenmp %s -o - | FileCheck %s

module flush02_mod
type t1
integer(kind=4) :: x = 4
end type t1

type :: t2
type(t1) :: y = t1(2)
end type t2


contains

subroutine sub01(pt)
class(t1), intent(inout) :: pt
type(t2) :: dt
integer, allocatable :: a(:)
integer, pointer :: b(:)

! CHECK: omp.flush({{.*}} : !fir.ref<!fir.box<!fir.heap<!fir.array<?xi32>>>>)
! CHECK: omp.flush({{.*}} : !fir.ref<f32>)
! CHECK: omp.flush({{.*}} : !fir.ref<!fir.type<_QMflush02_modTt2{y:!fir.type<_QMflush02_modTt1{x:i32}>}>>)
! CHECK: omp.flush({{.*}} : !fir.class<!fir.type<_QMflush02_modTt1{x:i32}>>)
!$omp flush(a)
!$omp flush(p)
!$omp flush(dt)
!$omp flush(pt)
end subroutine
end module flush02_mod
2 changes: 1 addition & 1 deletion mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td
Original file line number Diff line number Diff line change
Expand Up @@ -889,7 +889,7 @@ def FlushOp : OpenMP_Op<"flush", clauses = [
specified or implied.
}] # clausesDescription;

let arguments = !con((ins Variadic<OpenMP_PointerLikeType>:$varList),
let arguments = !con((ins Variadic<AnyType>:$varList),
clausesArgs);

// Override inherited assembly format to include `varList`.
Expand Down