diff --git a/flang/test/Lower/OpenMP/flush02.f90 b/flang/test/Lower/OpenMP/flush02.f90 new file mode 100644 index 000000000000..b372e700e1a1 --- /dev/null +++ b/flang/test/Lower/OpenMP/flush02.f90 @@ -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>>>) + ! CHECK: omp.flush({{.*}} : !fir.ref) + ! CHECK: omp.flush({{.*}} : !fir.ref}>>) + ! CHECK: omp.flush({{.*}} : !fir.class>) + !$omp flush(a) + !$omp flush(p) + !$omp flush(dt) + !$omp flush(pt) + end subroutine +end module flush02_mod diff --git a/mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td b/mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td index 036c6a6e350a..ac80926053a2 100644 --- a/mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td +++ b/mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td @@ -889,7 +889,7 @@ def FlushOp : OpenMP_Op<"flush", clauses = [ specified or implied. }] # clausesDescription; - let arguments = !con((ins Variadic:$varList), + let arguments = !con((ins Variadic:$varList), clausesArgs); // Override inherited assembly format to include `varList`.