diff options
author | Razvan Lupusoru <razvan.lupusoru@gmail.com> | 2023-11-02 16:06:17 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-02 16:06:17 -0700 |
commit | f8c8722dc3c45c72db65177d62af88a2465a338c (patch) | |
tree | fca71812aea886c7d3f8c6f6d0d1e0093931ac83 | |
parent | 14f2025671f82192d38e1db9bc185790e1221cd3 (diff) | |
download | llvm-f8c8722dc3c45c72db65177d62af88a2465a338c.zip llvm-f8c8722dc3c45c72db65177d62af88a2465a338c.tar.gz llvm-f8c8722dc3c45c72db65177d62af88a2465a338c.tar.bz2 |
[flang][openmp] Fix `not yet implemented intrinsic` message for omp_lib (#71101)
PR#70386 removed hardcoded omp_lib name when checking if it is intrinsic
module procedure reference - but instead relied on bind(c) to avoid
generating error when the implementation is external to module.
However, this change only worked for HLFIR. Make it work for FIR flow
and update the test to exercise that as well.
-rw-r--r-- | flang/lib/Lower/ConvertExpr.cpp | 3 | ||||
-rw-r--r-- | flang/test/Lower/OpenMP/omp-lib-num-threads.f90 | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/flang/lib/Lower/ConvertExpr.cpp b/flang/lib/Lower/ConvertExpr.cpp index 76d810e..8c23186 100644 --- a/flang/lib/Lower/ConvertExpr.cpp +++ b/flang/lib/Lower/ConvertExpr.cpp @@ -2534,7 +2534,8 @@ public: procRef.proc().GetSpecificIntrinsic()) return genIntrinsicRef(procRef, resultType, *intrinsic); - if (Fortran::lower::isIntrinsicModuleProcRef(procRef)) + if (Fortran::lower::isIntrinsicModuleProcRef(procRef) && + !Fortran::semantics::IsBindCProcedure(*procRef.proc().GetSymbol())) return genIntrinsicRef(procRef, resultType); if (isStatementFunctionCall(procRef)) diff --git a/flang/test/Lower/OpenMP/omp-lib-num-threads.f90 b/flang/test/Lower/OpenMP/omp-lib-num-threads.f90 index 01c3e93..e1af7d3 100644 --- a/flang/test/Lower/OpenMP/omp-lib-num-threads.f90 +++ b/flang/test/Lower/OpenMP/omp-lib-num-threads.f90 @@ -1,5 +1,7 @@ ! 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 |