forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Revert "[flang] Consider bind(c) when lowering calls to intri…
…nsic module procedures (llvm#70386)"" (llvm#246) This reverts commit 5919156. Issue solved in upstream commit: llvm#71101
- Loading branch information
1 parent
9d9628e
commit bb7c927
Showing
3 changed files
with
36 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
! RUN: %flang_fc1 -emit-hlfir -fopenmp %s -o - 2>&1 | FileCheck %s | ||
! RUN: bbc -fopenmp -emit-hlfir -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 |