[flang-commits] [flang] 7201475 - [flang][OpenMP] Remove dependency on openmp-runtime where not needed,… (#224122)

via flang-commits flang-commits at lists.llvm.org
Wed Sep 16 13:04:20 PDT 2026


Author: Krzysztof Parzyszek
Date: 2026-09-16T15:04:14-05:00
New Revision: 7201475cdcca3c4e2f8abf3ba8a2ea52e6fe56df

URL: https://github.com/llvm/llvm-project/commit/7201475cdcca3c4e2f8abf3ba8a2ea52e6fe56df
DIFF: https://github.com/llvm/llvm-project/commit/7201475cdcca3c4e2f8abf3ba8a2ea52e6fe56df.diff

LOG: [flang][OpenMP] Remove dependency on openmp-runtime where not needed,… (#224122)

… NFC

Several tests claimed dependence on openmp-runtime and had USE omp_lib
statements even though they didn't use anything from it.

Added: 
    

Modified: 
    flang/test/Parser/OpenMP/target_device_parse.f90
    flang/test/Parser/OpenMP/target_device_unparse.f90
    flang/test/Semantics/OpenMP/allocate-clause01.f90
    flang/test/Semantics/OpenMP/allocate07.f90
    flang/test/Semantics/OpenMP/allocators02.f90
    flang/test/Semantics/OpenMP/allocators03.f90
    flang/test/Semantics/OpenMP/atomic-capture-invalid.f90
    flang/test/Semantics/OpenMP/atomic02.f90
    flang/test/Semantics/OpenMP/atomic03.f90
    flang/test/Semantics/OpenMP/atomic05.f90
    flang/test/Semantics/OpenMP/declare-target01.f90
    flang/test/Semantics/OpenMP/omp-atomic-assignment-stmt.f90
    flang/test/Semantics/OpenMP/parallel-sections01.f90
    flang/test/Semantics/OpenMP/sections02.f90
    flang/test/Semantics/OpenMP/threadprivate01.f90

Removed: 
    


################################################################################
diff  --git a/flang/test/Parser/OpenMP/target_device_parse.f90 b/flang/test/Parser/OpenMP/target_device_parse.f90
index d3c9c692adcd4..2a3e6cdea3773 100644
--- a/flang/test/Parser/OpenMP/target_device_parse.f90
+++ b/flang/test/Parser/OpenMP/target_device_parse.f90
@@ -1,11 +1,8 @@
-! REQUIRES: openmp_runtime
-
 ! RUN: %flang_fc1 -fdebug-unparse-no-sema %openmp_flags %s | FileCheck --ignore-case %s
 ! RUN: %flang_fc1 -fdebug-dump-parse-tree %openmp_flags %s | FileCheck --check-prefix="PARSE-TREE" %s
 ! Checks the parsing of Openmp 5.0 Target Device constructs
 !
 PROGRAM main
-  USE OMP_LIB
   IMPLICIT NONE
   INTEGER :: X, Y
   INTEGER :: M = 1

diff  --git a/flang/test/Parser/OpenMP/target_device_unparse.f90 b/flang/test/Parser/OpenMP/target_device_unparse.f90
index 403b64887e747..259a3b9863feb 100644
--- a/flang/test/Parser/OpenMP/target_device_unparse.f90
+++ b/flang/test/Parser/OpenMP/target_device_unparse.f90
@@ -1,7 +1,6 @@
 ! RUN: %flang_fc1 -fdebug-unparse-no-sema -fopenmp %s | FileCheck --ignore-case %s
 ! Verifies the unparsing of the Openmp Target Device constructs
 PROGRAM main
-    USE OMP_LIB
     IMPLICIT NONE
     INTEGER:: X, Y
     INTEGER:: M = 1

diff  --git a/flang/test/Semantics/OpenMP/allocate-clause01.f90 b/flang/test/Semantics/OpenMP/allocate-clause01.f90
index 6aa96a19c15cc..36fa495dbd0bc 100644
--- a/flang/test/Semantics/OpenMP/allocate-clause01.f90
+++ b/flang/test/Semantics/OpenMP/allocate-clause01.f90
@@ -1,13 +1,9 @@
-! REQUIRES: openmp_runtime
-
 ! RUN: %python %S/../test_errors.py %s %flang_fc1 %openmp_flags -fopenmp-version=52
 ! OpenMP Version 5.2
 ! The allocate clause's allocator modifier must be of type allocator_handle
 ! and the align modifier must be constant, positive integer expression
 
 subroutine allocate()
-    use omp_lib
-
     integer, allocatable :: a, b, c
 
     !ERROR: The alignment value should be a constant positive integer

diff  --git a/flang/test/Semantics/OpenMP/allocate07.f90 b/flang/test/Semantics/OpenMP/allocate07.f90
index 2e2f8a98d6f57..3509519cae986 100644
--- a/flang/test/Semantics/OpenMP/allocate07.f90
+++ b/flang/test/Semantics/OpenMP/allocate07.f90
@@ -1,12 +1,9 @@
-! REQUIRES: openmp_runtime
-
 ! RUN: %python %S/../test_errors.py %s %flang_fc1 %openmp_flags
 ! OpenMP Version 5.0
 ! 2.11.3 allocate Directive
 ! A type parameter inquiry cannot appear in an allocate directive.
 
 subroutine allocate()
-use omp_lib
   type my_type(kind_param, len_param)
     INTEGER, KIND :: kind_param
     INTEGER, LEN :: len_param

diff  --git a/flang/test/Semantics/OpenMP/allocators02.f90 b/flang/test/Semantics/OpenMP/allocators02.f90
index e0ebb58c0b3c0..3cc1d44c175eb 100644
--- a/flang/test/Semantics/OpenMP/allocators02.f90
+++ b/flang/test/Semantics/OpenMP/allocators02.f90
@@ -1,5 +1,3 @@
-! REQUIRES: openmp_runtime
-
 ! RUN: %python %S/../test_errors.py %s %flang_fc1 %openmp_flags -fopenmp-version=52
 ! OpenMP Version 5.2
 ! 6.7 allocators construct
@@ -7,7 +5,6 @@
 ! structure element) cannot appear in an allocatprs construct.
 
 subroutine allocate()
-use omp_lib
 
   type my_type
     integer, allocatable :: array(:)

diff  --git a/flang/test/Semantics/OpenMP/allocators03.f90 b/flang/test/Semantics/OpenMP/allocators03.f90
index ad4b1f7046301..5d7e8cb0ad5eb 100644
--- a/flang/test/Semantics/OpenMP/allocators03.f90
+++ b/flang/test/Semantics/OpenMP/allocators03.f90
@@ -1,12 +1,9 @@
-! REQUIRES: openmp_runtime
-
 ! RUN: %python %S/../test_errors.py %s %flang_fc1 %openmp_flags -fopenmp-version=52
 ! OpenMP Version 5.2
 ! 6.7 allocators construct
 ! Only the allocate clause is allowed on the allocators construct
 
 subroutine allocate()
-use omp_lib
 
   integer, allocatable :: arr1(:), arr2(:)
 

diff  --git a/flang/test/Semantics/OpenMP/atomic-capture-invalid.f90 b/flang/test/Semantics/OpenMP/atomic-capture-invalid.f90
index cb9c73cc940db..8bfa6d3e94109 100644
--- a/flang/test/Semantics/OpenMP/atomic-capture-invalid.f90
+++ b/flang/test/Semantics/OpenMP/atomic-capture-invalid.f90
@@ -1,9 +1,6 @@
-! REQUIRES: openmp_runtime
-
 ! RUN: %python %S/../test_errors.py %s %flang_fc1 %openmp_flags
 ! Semantic checks on invalid atomic capture clause
 
-use omp_lib
     logical x
     complex y
     !$omp atomic capture

diff  --git a/flang/test/Semantics/OpenMP/atomic02.f90 b/flang/test/Semantics/OpenMP/atomic02.f90
index c3f40b8be78c9..66e6008b5fc1f 100644
--- a/flang/test/Semantics/OpenMP/atomic02.f90
+++ b/flang/test/Semantics/OpenMP/atomic02.f90
@@ -1,5 +1,3 @@
-! REQUIRES: openmp_runtime
-
 ! RUN: %python %S/../test_errors.py %s %flang_fc1 %openmp_flags
 
 ! OpenMP Atomic construct
@@ -7,7 +5,6 @@
 ! operator is one of +, *, -, /, .AND., .OR., .EQV., or .NEQV
 
 program OmpAtomic
-   use omp_lib
    CHARACTER c*3, d*3
    LOGICAL l, m, n
 

diff  --git a/flang/test/Semantics/OpenMP/atomic03.f90 b/flang/test/Semantics/OpenMP/atomic03.f90
index 8e960114bf1ea..8ee7f0350157c 100644
--- a/flang/test/Semantics/OpenMP/atomic03.f90
+++ b/flang/test/Semantics/OpenMP/atomic03.f90
@@ -1,5 +1,3 @@
-! REQUIRES: openmp_runtime
-
 ! RUN: %python %S/../test_errors.py %s %flang_fc1 %openmp_flags
 
 ! OpenMP Atomic construct
@@ -7,7 +5,6 @@
 ! Intrinsic procedure name is one of MAX, MIN, IAND, IOR, or IEOR.
 
 program OmpAtomic
-   use omp_lib
    real x
    integer :: y, z, a, b, c, d
    x = 5.73

diff  --git a/flang/test/Semantics/OpenMP/atomic05.f90 b/flang/test/Semantics/OpenMP/atomic05.f90
index e0103be4cae4a..1c67b9354cf2c 100644
--- a/flang/test/Semantics/OpenMP/atomic05.f90
+++ b/flang/test/Semantics/OpenMP/atomic05.f90
@@ -1,11 +1,8 @@
-! REQUIRES: openmp_runtime
-
 ! RUN: %python %S/../test_errors.py %s %flang %openmp_flags -fopenmp-version=50
 
 ! This tests the various semantics related to the clauses of various OpenMP atomic constructs
 
 program OmpAtomic
-    use omp_lib
     integer :: g, x
 
     !ERROR: At most one clause from the 'memory-order' group is allowed on ATOMIC construct

diff  --git a/flang/test/Semantics/OpenMP/declare-target01.f90 b/flang/test/Semantics/OpenMP/declare-target01.f90
index e1c7cfaf092bb..03ee8da6f2992 100644
--- a/flang/test/Semantics/OpenMP/declare-target01.f90
+++ b/flang/test/Semantics/OpenMP/declare-target01.f90
@@ -1,12 +1,9 @@
-! REQUIRES: openmp_runtime
-
 ! RUN: %python %S/../test_errors.py %s %flang_fc1 %openmp_flags -fopenmp-version=52
 ! OpenMP Version 5.1
 ! Check OpenMP construct validity for the following directives:
 ! 2.14.7 Declare Target Directive
 
 module declare_target01
-  use omp_lib
   type my_type(kind_param, len_param)
     integer, KIND :: kind_param
     integer, LEN :: len_param

diff  --git a/flang/test/Semantics/OpenMP/omp-atomic-assignment-stmt.f90 b/flang/test/Semantics/OpenMP/omp-atomic-assignment-stmt.f90
index 4843e44dd2535..2983eba4256cb 100644
--- a/flang/test/Semantics/OpenMP/omp-atomic-assignment-stmt.f90
+++ b/flang/test/Semantics/OpenMP/omp-atomic-assignment-stmt.f90
@@ -1,10 +1,7 @@
-! REQUIRES: openmp_runtime
-
 ! RUN: %python %S/../test_errors.py %s %flang_fc1 %openmp_flags -fopenmp-version=50
 ! Semantic checks for various assignments related to atomic constructs
 
 program sample
-    use omp_lib
     integer :: x, v
     integer :: y(10)
     integer, allocatable :: k

diff  --git a/flang/test/Semantics/OpenMP/parallel-sections01.f90 b/flang/test/Semantics/OpenMP/parallel-sections01.f90
index 0e4facac9831a..17cb28838cb40 100644
--- a/flang/test/Semantics/OpenMP/parallel-sections01.f90
+++ b/flang/test/Semantics/OpenMP/parallel-sections01.f90
@@ -1,11 +1,8 @@
-! REQUIRES: openmp_runtime
-
 ! RUN: %python %S/../test_errors.py %s %flang %openmp_flags
 ! OpenMP version 5.0.0
 ! 2.13.3 parallel sections Construct
 ! The restrictions for the parallel construct and the sections construct apply
 program OmpConstructSections01
-   use omp_lib
    integer :: section_count = 0
    integer, parameter :: NT = 4
    integer :: i, array(10)

diff  --git a/flang/test/Semantics/OpenMP/sections02.f90 b/flang/test/Semantics/OpenMP/sections02.f90
index 8144b491071d8..55af035d1279d 100644
--- a/flang/test/Semantics/OpenMP/sections02.f90
+++ b/flang/test/Semantics/OpenMP/sections02.f90
@@ -1,11 +1,8 @@
-! REQUIRES: openmp_runtime
-
 ! RUN: %python %S/../test_errors.py %s %flang %openmp_flags
 ! OpenMP version 5.0.0
 ! 2.8.1 sections construct
 ! The code enclosed in a sections construct must be a structured block.
 program OmpConstructSections01
-   use omp_lib
    integer :: section_count = 0
    integer, parameter :: NT = 4
    print *, 'section_count', section_count

diff  --git a/flang/test/Semantics/OpenMP/threadprivate01.f90 b/flang/test/Semantics/OpenMP/threadprivate01.f90
index ebccaaa99d62a..b1598cc0ddf25 100644
--- a/flang/test/Semantics/OpenMP/threadprivate01.f90
+++ b/flang/test/Semantics/OpenMP/threadprivate01.f90
@@ -1,12 +1,9 @@
-! REQUIRES: openmp_runtime
-
 ! RUN: %python %S/../test_errors.py %s %flang_fc1 %openmp_flags
 ! OpenMP Version 5.1
 ! Check OpenMP construct validity for the following directives:
 ! 2.21.2 Threadprivate Directive
 
 module thread_private01
-  use omp_lib
   type my_type(kind_param, len_param)
     integer, KIND :: kind_param
     integer, LEN :: len_param


        


More information about the flang-commits mailing list