Skip to content

Commit deafb36

Browse files
authored
[flang][OpenMP] Add OpenMP versions to some tests (#89295)
Some constructs used in the tests are only allowed in certain OpenMP spec versions. Add a flag with the minimum required OpenMP version (other than the default version) to these tests that need it.
1 parent 76ea5fe commit deafb36

File tree

7 files changed

+20
-11
lines changed

7 files changed

+20
-11
lines changed

flang/test/Lower/OpenMP/FIR/if-clause.f90

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
! This test checks lowering of OpenMP IF clauses.
22

3-
! RUN: bbc -fopenmp -emit-fir %s -o - | FileCheck %s
4-
! RUN: %flang_fc1 -fopenmp -emit-fir %s -o - | FileCheck %s
3+
! The "if" clause was added to the "simd" directive in OpenMP 5.0, and
4+
! to the "teams" directive in OpenMP 5.2.
5+
! RUN: bbc -fopenmp -fopenmp-version=52 -emit-fir %s -o - | FileCheck %s
6+
! RUN: %flang_fc1 -fopenmp -fopenmp-version=52 -emit-fir %s -o - | FileCheck %s
57

68
program main
79
integer :: i

flang/test/Lower/OpenMP/FIR/simd.f90

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
! Tests for 2.9.3.1 Simd
22

3-
! RUN: bbc -fopenmp -emit-fir -hlfir=false %s -o - | FileCheck %s
3+
! The "if" clause was added to the "simd" directive in OpenMP 5.0.
4+
! RUN: bbc -fopenmp -fopenmp-version=50 -emit-fir -hlfir=false %s -o - | FileCheck %s
45

56
!CHECK-LABEL: func @_QPsimd()
67
subroutine simd

flang/test/Lower/OpenMP/FIR/target.f90

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
!RUN: %flang_fc1 -emit-fir -flang-deprecated-no-hlfir -fopenmp %s -o - | FileCheck %s
1+
! The "thread_limit" clause was added to the "target" construct in OpenMP 5.1.
2+
! RUN: %flang_fc1 -emit-fir -flang-deprecated-no-hlfir -fopenmp -fopenmp-version=51 %s -o - | FileCheck %s
23

34
!===============================================================================
45
! Target_Enter Simple

flang/test/Lower/OpenMP/if-clause.f90

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
! This test checks lowering of OpenMP IF clauses.
22

3-
! RUN: bbc -fopenmp -emit-hlfir %s -o - | FileCheck %s
4-
! RUN: %flang_fc1 -fopenmp -emit-hlfir %s -o - | FileCheck %s
3+
! The "if" clause was added to the "simd" directive in OpenMP 5.0, and
4+
! to the "teams" directive in OpenMP 5.2.
5+
! RUN: bbc -fopenmp -fopenmp-version=52 -emit-hlfir %s -o - | FileCheck %s
6+
! RUN: %flang_fc1 -fopenmp -fopenmp-version=52 -emit-hlfir %s -o - | FileCheck %s
57

68
program main
79
integer :: i

flang/test/Lower/OpenMP/simd.f90

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
! Tests for 2.9.3.1 Simd
22

3-
!RUN: %flang_fc1 -flang-experimental-hlfir -emit-hlfir -fopenmp %s -o - | FileCheck %s
4-
!RUN: bbc -hlfir -emit-hlfir -fopenmp %s -o - | FileCheck %s
3+
! The "if" clause was added to the "simd" directive in OpenMP 5.0.
4+
! RUN: %flang_fc1 -flang-experimental-hlfir -emit-hlfir -fopenmp -fopenmp-version=50 %s -o - | FileCheck %s
5+
! RUN: bbc -hlfir -emit-hlfir -fopenmp -fopenmp-version=50 %s -o - | FileCheck %s
56

67
!CHECK-LABEL: func @_QPsimd()
78
subroutine simd

flang/test/Lower/OpenMP/target.f90

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
!RUN: %flang_fc1 -emit-hlfir -fopenmp %s -o - | FileCheck %s
1+
! The "thread_limit" clause was added to the "target" construct in OpenMP 5.1.
2+
! RUN: %flang_fc1 -emit-hlfir -fopenmp -fopenmp-version=51 %s -o - | FileCheck %s
23

34
!===============================================================================
45
! Target_Enter Simple

flang/test/Lower/OpenMP/use-device-ptr-to-use-device-addr.f90

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
!RUN: %flang_fc1 -emit-hlfir -fopenmp %s -o - | FileCheck %s
2-
!RUN: bbc -emit-hlfir -fopenmp %s -o - | FileCheck %s
1+
! The "use_device_addr" was added to the "target data" directive in OpenMP 5.0.
2+
! RUN: %flang_fc1 -emit-hlfir -fopenmp -fopenmp-version=50 %s -o - | FileCheck %s
3+
! RUN: bbc -emit-hlfir -fopenmp -fopenmp-version=50 %s -o - | FileCheck %s
34

45
! This tests primary goal is to check the promotion of
56
! non-CPTR arguments from use_device_ptr to

0 commit comments

Comments
 (0)