[flang-commits] [flang] [openmp] [OpenMP] [Flang] Resolved Issue llvm#76121: Implemented Check for Unhandled Arguments in __kmpc_fork_call_if (PR #82221)

chandan singh via flang-commits flang-commits at lists.llvm.org
Fri May 3 01:57:08 PDT 2024


================
@@ -0,0 +1,22 @@
+// RUN: %libomp-compile  -Wno-implicit-function-declaration && %t | FileCheck %s
+
+#include <stdio.h>
+#include <omp.h>
+
+// Microtask function for parallel region
+void microtask(int *global_tid, int *bound_tid) {
+  // CHECK: PASS
+  if (omp_in_parallel()) {
+    printf("FAIL\n");
+  } else {
+    printf("PASS\n");
+  }
+}
+
+int main() {
+  // Condition for parallelization (false in this case)
+  int cond = 0;
+  // Call __kmpc_fork_call_if
+  __kmpc_fork_call_if(NULL, 0, microtask, cond, NULL);
+  return 0;
+}
----------------
chandankds wrote:

Done

https://github.com/llvm/llvm-project/pull/82221


More information about the flang-commits mailing list