This PR changes the build system to use use the sources for the module `omp_lib` and the `omp_lib.h` include file from the `openmp` runtime project and not from a separate copy of these files. This will greatly reduce potential for inconsistencies when adding features to the OpenMP runtime implementation. When the OpenMP subproject is not configured, this PR also disables the corresponding LIT tests with a "REQUIRES" directive at the beginning of the OpenMP test files. --------- Co-authored-by: Valentin Clement (バレンタイン クレメン) <clementval@gmail.com>
26 lines
1011 B
Fortran
26 lines
1011 B
Fortran
! REQUIRES: openmp_runtime
|
|
|
|
! RUN: %flang_fc1 -emit-hlfir -fopenmp %s -o - 2>&1 | FileCheck %s
|
|
! RUN: bbc -fopenmp -emit-hlfir -o - %s 2>&1 | FileCheck %s
|
|
! RUN: %flang_fc1 -emit-fir -fopenmp %s -o - 2>&1 | FileCheck %s
|
|
! RUN: bbc -emit-fir -fopenmp -o - %s 2>&1 | FileCheck %s
|
|
!
|
|
! Test that the calls to omp_lib's omp_get_num_threads and omp_set_num_threads
|
|
! get lowered even though their implementation is not in the omp_lib module
|
|
! (and this matters because this is an intrinsic module - and calls to
|
|
! intrinsics are specially resolved).
|
|
|
|
program main
|
|
use omp_lib
|
|
integer(omp_integer_kind) :: num_threads
|
|
integer(omp_integer_kind), parameter :: requested_num_threads = 4
|
|
call omp_set_num_threads(requested_num_threads)
|
|
num_threads = omp_get_num_threads()
|
|
print *, num_threads
|
|
end program
|
|
|
|
!CHECK-NOT: not yet implemented: intrinsic: omp_set_num_threads
|
|
!CHECK-NOT: not yet implemented: intrinsic: omp_get_num_threads
|
|
!CHECK: fir.call @omp_set_num_threads
|
|
!CHECK: fir.call @omp_get_num_threads
|