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

Shilei Tian via flang-commits flang-commits at lists.llvm.org
Fri Apr 26 20:48:47 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;
+}
----------------
shiltian wrote:

format please, empty line EOF.

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


More information about the flang-commits mailing list