Skip to content

[NFC][Flang][Test] Add some missing tests #110468

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
Oct 18, 2024

Conversation

Thirumalai-Shaktivel
Copy link
Member

  • At most one Collapse clause in SIMD construct
  • A DO loop must follow the SIMD directive

- At most one Collapse clause in SIMD construct
- A DO loop must follow the SIMD directive
@llvmbot
Copy link
Member

llvmbot commented Sep 30, 2024

@llvm/pr-subscribers-flang-semantics

Author: Thirumalai Shaktivel (Thirumalai-Shaktivel)

Changes
  • At most one Collapse clause in SIMD construct
  • A DO loop must follow the SIMD directive

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

2 Files Affected:

  • (modified) flang/test/Semantics/OpenMP/do-collapse.f90 (+7-1)
  • (modified) flang/test/Semantics/OpenMP/loop-association.f90 (+6)
diff --git a/flang/test/Semantics/OpenMP/do-collapse.f90 b/flang/test/Semantics/OpenMP/do-collapse.f90
index 4f2512937ace4e..480bd45b79b839 100644
--- a/flang/test/Semantics/OpenMP/do-collapse.f90
+++ b/flang/test/Semantics/OpenMP/do-collapse.f90
@@ -30,5 +30,11 @@ program omp_doCollapse
       do
       end do
     end do
-end program omp_doCollapse
 
+  !ERROR: At most one COLLAPSE clause can appear on the SIMD directive
+  !$omp simd collapse(2) collapse(1)
+  do i = 1, 4
+    j = j + i + 1
+  end do
+  !$omp end simd
+end program omp_doCollapse
diff --git a/flang/test/Semantics/OpenMP/loop-association.f90 b/flang/test/Semantics/OpenMP/loop-association.f90
index d2167663c5ddea..9fac508e6128a7 100644
--- a/flang/test/Semantics/OpenMP/loop-association.f90
+++ b/flang/test/Semantics/OpenMP/loop-association.f90
@@ -131,4 +131,10 @@
   !$omp end parallel do simd
   !ERROR: The END PARALLEL DO SIMD directive must follow the DO loop associated with the loop construct
   !$omp end parallel do simd
+
+  !ERROR: A DO loop must follow the SIMD directive
+  !$omp simd
+    a = i + 1
+  !ERROR: The END SIMD directive must follow the DO loop associated with the loop construct
+  !$omp end simd
 end

@llvmbot
Copy link
Member

llvmbot commented Sep 30, 2024

@llvm/pr-subscribers-flang-openmp

Author: Thirumalai Shaktivel (Thirumalai-Shaktivel)

Changes
  • At most one Collapse clause in SIMD construct
  • A DO loop must follow the SIMD directive

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

2 Files Affected:

  • (modified) flang/test/Semantics/OpenMP/do-collapse.f90 (+7-1)
  • (modified) flang/test/Semantics/OpenMP/loop-association.f90 (+6)
diff --git a/flang/test/Semantics/OpenMP/do-collapse.f90 b/flang/test/Semantics/OpenMP/do-collapse.f90
index 4f2512937ace4e..480bd45b79b839 100644
--- a/flang/test/Semantics/OpenMP/do-collapse.f90
+++ b/flang/test/Semantics/OpenMP/do-collapse.f90
@@ -30,5 +30,11 @@ program omp_doCollapse
       do
       end do
     end do
-end program omp_doCollapse
 
+  !ERROR: At most one COLLAPSE clause can appear on the SIMD directive
+  !$omp simd collapse(2) collapse(1)
+  do i = 1, 4
+    j = j + i + 1
+  end do
+  !$omp end simd
+end program omp_doCollapse
diff --git a/flang/test/Semantics/OpenMP/loop-association.f90 b/flang/test/Semantics/OpenMP/loop-association.f90
index d2167663c5ddea..9fac508e6128a7 100644
--- a/flang/test/Semantics/OpenMP/loop-association.f90
+++ b/flang/test/Semantics/OpenMP/loop-association.f90
@@ -131,4 +131,10 @@
   !$omp end parallel do simd
   !ERROR: The END PARALLEL DO SIMD directive must follow the DO loop associated with the loop construct
   !$omp end parallel do simd
+
+  !ERROR: A DO loop must follow the SIMD directive
+  !$omp simd
+    a = i + 1
+  !ERROR: The END SIMD directive must follow the DO loop associated with the loop construct
+  !$omp end simd
 end

Copy link
Contributor

@kiranchandramohan kiranchandramohan left a comment

Choose a reason for hiding this comment

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

LG. Please add NFC also to the title.

@Thirumalai-Shaktivel Thirumalai-Shaktivel changed the title [Flang][Test] Add some missing tests [NFC][Flang][Test] Add some missing tests Oct 1, 2024
Copy link
Contributor

@NimishMishra NimishMishra left a comment

Choose a reason for hiding this comment

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

Looks good. Thanks

@Thirumalai-Shaktivel
Copy link
Member Author

Thanks for the reviews. As this PR is approved, I'm merging it.

@Thirumalai-Shaktivel Thirumalai-Shaktivel merged commit b340310 into llvm:main Oct 18, 2024
12 checks passed
@Thirumalai-Shaktivel Thirumalai-Shaktivel deleted the llvm/simd_02 branch October 18, 2024 04:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flang:openmp flang:semantics flang Flang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants