Issue |
142833
|
Summary |
[flang][OpenMP] Incorrect signature for omp_get_cancellation()
|
Labels |
flang:openmp
|
Assignees |
|
Reporter |
eugeneepshteyn
|
Currently, `omp_get_cancellation()` is declared like this in openmp/runtime/src/include/omp_lib.F90.var:
```
400 function omp_get_cancellation() bind(c)
401 use omp_lib_kinds
402 integer (kind=omp_integer_kind) omp_get_cancellation
403 end function omp_get_cancellation
```
In OpenMP 5.2 spec, Fortran declaration for this function is as follows:
```
logical function omp_get_cancellation()
```
The return type difference prevents using `omp_get_cancellation()` in logical expressions:
```
use omp_lib
logical :: flag = .TRUE.
flag = flag .and. omp_get_cancellation()
end
```
Error:
```
$ flang -c -fopenmp cancellation.f90
flang-21: warning: OpenMP support in flang is still experimental [-Wexperimental-option]
error: Semantic errors in cancellation.f90
./cancellation.f90:3:8: error: Operands of .AND. must be LOGICAL; have LOGICAL(4) and INTEGER(4)
flag = flag .and. omp_get_cancellation()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```
flang version:
```
$ flang --version
flang version 21.0.0git (https://github.com/eugeneepshteyn/llvm-project.git cf348e886d0b30a4bf3e810efc00b2da0f7a4322)
Target: x86_64-unknown-linux-gnu
Thread model: posix
...
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs