Skip to content

Commit

Permalink
[flang][OpenMP] Add %flang_fc1 RUN to delayed privatization tests (
Browse files Browse the repository at this point in the history
…#84296)

I did not know how `-mmlir` flag works and was deferring the addition of
`--openm-enabled-delayed-privatization` until later because I thought
some work needs to be done to do that. This commit just adds some extra
`RUN` lines to delayed privatization tests to run them from `flang` as
well.
  • Loading branch information
ergawy committed Mar 7, 2024
1 parent d5aecf0 commit 59e405b
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
! Test delayed privatization for the `private` clause.

! RUN: bbc -emit-fir -hlfir=false -fopenmp --openmp-enable-delayed-privatization -o - %s 2>&1 | FileCheck %s
! RUN: %flang_fc1 -emit-fir -flang-deprecated-no-hlfir -fopenmp -mmlir \
! RUN: --openmp-enable-delayed-privatization -o - %s 2>&1 | FileCheck %s
! RUN: bbc -emit-fir -hlfir=false -fopenmp --openmp-enable-delayed-privatization \
! RUN: -o - %s 2>&1 | FileCheck %s

subroutine delayed_privatization_firstprivate
implicit none
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
! Test delayed privatization for the `private` clause.

! RUN: bbc -emit-fir -hlfir=false -fopenmp --openmp-enable-delayed-privatization -o - %s 2>&1 | FileCheck %s
! RUN: %flang_fc1 -emit-fir -flang-deprecated-no-hlfir -fopenmp -mmlir \
! RUN: --openmp-enable-delayed-privatization -o - %s 2>&1 | FileCheck %s
! RUN: bbc -emit-fir -hlfir=false -fopenmp --openmp-enable-delayed-privatization \
! RUN: -o - %s 2>&1 | FileCheck %s

subroutine delayed_privatization_private
implicit none
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
! Test delayed privatization for the `firstprivate` clause.

! RUN: bbc -emit-hlfir -fopenmp --openmp-enable-delayed-privatization -o - %s 2>&1 | FileCheck %s
! RUN: %flang_fc1 -emit-hlfir -fopenmp -mmlir --openmp-enable-delayed-privatization \
! RUN: -o - %s 2>&1 | FileCheck %s
! RUN: bbc -emit-hlfir -fopenmp --openmp-enable-delayed-privatization -o - %s 2>&1 \
! RUN: | FileCheck %s

subroutine delayed_privatization_firstprivate
implicit none
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
! Test delayed privatization for both `private` and `firstprivate` clauses.

! RUN: bbc -emit-hlfir -fopenmp --openmp-enable-delayed-privatization -o - %s 2>&1 | FileCheck %s
! RUN: %flang_fc1 -emit-hlfir -fopenmp -mmlir --openmp-enable-delayed-privatization \
! RUN: -o - %s 2>&1 | FileCheck %s
! RUN: bbc -emit-hlfir -fopenmp --openmp-enable-delayed-privatization -o - %s 2>&1 \
! RUN: | FileCheck %s

subroutine delayed_privatization_private_firstprivate
implicit none
Expand Down
5 changes: 4 additions & 1 deletion flang/test/Lower/OpenMP/delayed-privatization-private.f90
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
! Test delayed privatization for the `private` clause.

! RUN: bbc -emit-hlfir -fopenmp --openmp-enable-delayed-privatization -o - %s 2>&1 | FileCheck %s
! RUN: %flang_fc1 -emit-hlfir -fopenmp -mmlir --openmp-enable-delayed-privatization \
! RUN: -o - %s 2>&1 | FileCheck %s
! RUN: bbc -emit-hlfir -fopenmp --openmp-enable-delayed-privatization -o - %s 2>&1 \
! RUN: | FileCheck %s

subroutine delayed_privatization_private
implicit none
Expand Down
5 changes: 4 additions & 1 deletion flang/test/Lower/OpenMP/delayed-privatization-reduction.f90
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
! that the block arguments are added in the proper order (reductions first and
! then delayed privatization.

! RUN: bbc -emit-hlfir -fopenmp --openmp-enable-delayed-privatization -o - %s 2>&1 | FileCheck %s
! RUN: %flang_fc1 -emit-hlfir -fopenmp -mmlir --openmp-enable-delayed-privatization \
! RUN: -o - %s 2>&1 | FileCheck %s
! RUN: bbc -emit-hlfir -fopenmp --openmp-enable-delayed-privatization -o - %s 2>&1 \
! RUN: | FileCheck %s

subroutine red_and_delayed_private
integer :: red
Expand Down

0 comments on commit 59e405b

Please sign in to comment.