[Openmp-commits] [openmp] [OpenMP][Flang]Fix omp_get_cancellation return type from integer to logical (PR #142990)

Yang Zaizhou via Openmp-commits openmp-commits at lists.llvm.org
Thu Jun 5 08:20:34 PDT 2025


https://github.com/Mxfg-incense created https://github.com/llvm/llvm-project/pull/142990

Fix #142833
According to the OpenMP 5.2 spec, modify the return type of `omp_get_cancellation()` to logical.

>From 006ce4e5d1afec935465394405b5a6523f9bf033 Mon Sep 17 00:00:00 2001
From: Zaizhou Yang <yangzzh at shanghaitech.edu.cn>
Date: Thu, 5 Jun 2025 22:52:58 +0800
Subject: [PATCH] [OpenMP][Flang]Fix omp_get_cancellation return type from
 integer to logical

---
 openmp/runtime/src/include/omp_lib.F90.var | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/openmp/runtime/src/include/omp_lib.F90.var b/openmp/runtime/src/include/omp_lib.F90.var
index 3463b698291e1..20639f60b5d97 100644
--- a/openmp/runtime/src/include/omp_lib.F90.var
+++ b/openmp/runtime/src/include/omp_lib.F90.var
@@ -399,7 +399,7 @@
 
           function omp_get_cancellation() bind(c)
             use omp_lib_kinds
-            integer (kind=omp_integer_kind) omp_get_cancellation
+            logical (kind=omp_logical_kind) omp_get_cancellation
           end function omp_get_cancellation
 
           function omp_is_initial_device() bind(c)



More information about the Openmp-commits mailing list