Skip to content

[FLANG][OpenMP][Taskloop] - Add testcase for reduction and in_reduction clause in taskloop construct #139704

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 14, 2025

Conversation

kaviya2510
Copy link
Contributor

Added a testcase for reduction and in_reduction clause in taskloop construct.
Reduction and in_reduction clauses are not supported in taskloop so below error is issued: "not yet implemented: Unhandled clause REDUCTION/IN_REDUCTION in TASKLOOP construct"

@llvmbot llvmbot added flang Flang issues not falling into any other category flang:fir-hlfir flang:openmp labels May 13, 2025
@llvmbot
Copy link
Member

llvmbot commented May 13, 2025

@llvm/pr-subscribers-flang-fir-hlfir

@llvm/pr-subscribers-flang-openmp

Author: Kaviya Rajendiran (kaviya2510)

Changes

Added a testcase for reduction and in_reduction clause in taskloop construct.
Reduction and in_reduction clauses are not supported in taskloop so below error is issued: "not yet implemented: Unhandled clause REDUCTION/IN_REDUCTION in TASKLOOP construct"


Full diff: https://github.com/llvm/llvm-project/pull/139704.diff

2 Files Affected:

  • (added) flang/test/Lower/OpenMP/Todo/taskloop-inreduction.f90 (+13)
  • (added) flang/test/Lower/OpenMP/Todo/taskloop-reduction.f90 (+13)
diff --git a/flang/test/Lower/OpenMP/Todo/taskloop-inreduction.f90 b/flang/test/Lower/OpenMP/Todo/taskloop-inreduction.f90
new file mode 100644
index 0000000000000..8acc399a92abe
--- /dev/null
+++ b/flang/test/Lower/OpenMP/Todo/taskloop-inreduction.f90
@@ -0,0 +1,13 @@
+! RUN: %not_todo_cmd bbc -emit-fir -fopenmp -fopenmp-version=50 -o - %s 2>&1 | FileCheck %s
+! RUN: %not_todo_cmd %flang_fc1 -emit-fir -fopenmp -fopenmp-version=50 -o - %s 2>&1 | FileCheck %s
+
+! CHECK: not yet implemented: Unhandled clause IN_REDUCTION in TASKLOOP construct
+subroutine omp_taskloop_inreduction()
+   integer x
+   x = 0
+   !$omp taskloop in_reduction(+:x)
+   do i = 1, 100
+      x = x + 1
+   end do
+   !$omp end taskloop
+end subroutine omp_taskloop_inreduction
diff --git a/flang/test/Lower/OpenMP/Todo/taskloop-reduction.f90 b/flang/test/Lower/OpenMP/Todo/taskloop-reduction.f90
new file mode 100644
index 0000000000000..0c16bd227257f
--- /dev/null
+++ b/flang/test/Lower/OpenMP/Todo/taskloop-reduction.f90
@@ -0,0 +1,13 @@
+! RUN: %not_todo_cmd bbc -emit-fir -fopenmp -fopenmp-version=50 -o - %s 2>&1 | FileCheck %s
+! RUN: %not_todo_cmd %flang_fc1 -emit-fir -fopenmp -fopenmp-version=50 -o - %s 2>&1 | FileCheck %s
+
+! CHECK: not yet implemented: Unhandled clause REDUCTION in TASKLOOP construct
+subroutine omp_taskloop_reduction()
+   integer x
+   x = 0
+   !$omp taskloop reduction(+:x)
+   do i = 1, 100
+      x = x + 1
+   end do
+   !$omp end taskloop
+end subroutine omp_taskloop_reduction

Copy link
Contributor

@tblah tblah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks

@kaviya2510 kaviya2510 merged commit 0b490f1 into llvm:main May 14, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flang:fir-hlfir flang:openmp flang Flang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants