[Mlir-commits] [mlir] a1ac771 - [MLIR][OpenMP][NFC] Move the modifier testcases to correct directory

Shraiysh Vaishay llvmlistbot at llvm.org
Thu Mar 10 08:02:11 PST 2022


Author: Shraiysh Vaishay
Date: 2022-03-10T21:32:00+05:30
New Revision: a1ac771247dd3e8caa6dd1bac8cd17f5e5fbbc9d

URL: https://github.com/llvm/llvm-project/commit/a1ac771247dd3e8caa6dd1bac8cd17f5e5fbbc9d
DIFF: https://github.com/llvm/llvm-project/commit/a1ac771247dd3e8caa6dd1bac8cd17f5e5fbbc9d.diff

LOG: [MLIR][OpenMP][NFC] Move the modifier testcases to correct directory

This patch moves the testcases from
`mlir/test/Target/LLVMIR/openmp-llvm-bad-schedule-modifier.mlir` to
`mlir/test/Dialect/OpenMP/invalid.mlir` as they test the verifier
(not the translation to LLVM IR).

Reviewed By: NimishMishra

Differential Revision: https://reviews.llvm.org/D120877

Added: 
    

Modified: 
    mlir/test/Dialect/OpenMP/invalid.mlir

Removed: 
    mlir/test/Target/LLVMIR/openmp-llvm-bad-schedule-modifier.mlir


################################################################################
diff  --git a/mlir/test/Dialect/OpenMP/invalid.mlir b/mlir/test/Dialect/OpenMP/invalid.mlir
index eefc6f8f2dbb8..bbfc1e9525f14 100644
--- a/mlir/test/Dialect/OpenMP/invalid.mlir
+++ b/mlir/test/Dialect/OpenMP/invalid.mlir
@@ -132,6 +132,56 @@ func @proc_bind_not_allowed(%lb : index, %ub : index, %step : index) {
 
 // -----
 
+llvm.func @test_omp_wsloop_dynamic_bad_modifier(%lb : i64, %ub : i64, %step : i64) -> () {
+  // expected-error @+1 {{unknown modifier type: ginandtonic}}
+  omp.wsloop (%iv) : i64 = (%lb) to (%ub) step (%step) schedule(dynamic, ginandtonic) {
+    omp.yield
+  }
+  llvm.return
+}
+
+// -----
+
+llvm.func @test_omp_wsloop_dynamic_many_modifier(%lb : i64, %ub : i64, %step : i64) -> () {
+  // expected-error @+1 {{unexpected modifier(s)}}
+  omp.wsloop (%iv) : i64 = (%lb) to (%ub) step (%step) schedule(dynamic, monotonic, monotonic, monotonic) {
+    omp.yield
+  }
+  llvm.return
+}
+
+// -----
+
+llvm.func @test_omp_wsloop_dynamic_wrong_modifier(%lb : i64, %ub : i64, %step : i64) -> () {
+  // expected-error @+1 {{incorrect modifier order}}
+  omp.wsloop (%iv) : i64 = (%lb) to (%ub) step (%step) schedule(dynamic, simd, monotonic) {
+    omp.yield
+  }
+  llvm.return
+}
+
+// -----
+
+llvm.func @test_omp_wsloop_dynamic_wrong_modifier2(%lb : i64, %ub : i64, %step : i64) -> () {
+  // expected-error @+1 {{incorrect modifier order}}
+  omp.wsloop (%iv) : i64 = (%lb) to (%ub) step (%step) schedule(dynamic, monotonic, monotonic) {
+    omp.yield
+  }
+  llvm.return
+}
+
+// -----
+
+llvm.func @test_omp_wsloop_dynamic_wrong_modifier3(%lb : i64, %ub : i64, %step : i64) -> () {
+  // expected-error @+1 {{incorrect modifier order}}
+  omp.wsloop (%iv) : i64 = (%lb) to (%ub) step (%step) schedule(dynamic, simd, simd) {
+    omp.yield
+  }
+  llvm.return
+}
+
+// -----
+
 // expected-error @below {{op expects initializer region with one argument of the reduction type}}
 omp.reduction.declare @add_f32 : f64
 init {

diff  --git a/mlir/test/Target/LLVMIR/openmp-llvm-bad-schedule-modifier.mlir b/mlir/test/Target/LLVMIR/openmp-llvm-bad-schedule-modifier.mlir
deleted file mode 100644
index c7b8c4e981239..0000000000000
--- a/mlir/test/Target/LLVMIR/openmp-llvm-bad-schedule-modifier.mlir
+++ /dev/null
@@ -1,49 +0,0 @@
-// RUN: not mlir-translate -mlir-to-llvmir -split-input-file %s 2>&1 | FileCheck %s
-
-llvm.func @test_omp_wsloop_dynamic_bad_modifier(%lb : i64, %ub : i64, %step : i64) -> () {
-  omp.wsloop (%iv) : i64 = (%lb) to (%ub) step (%step) schedule(dynamic, ginandtonic) {
-    // CHECK: unknown modifier type: ginandtonic
-    omp.yield
-  }
-  llvm.return
-}
-
-// -----
-
-llvm.func @test_omp_wsloop_dynamic_many_modifier(%lb : i64, %ub : i64, %step : i64) -> () {
-  omp.wsloop (%iv) : i64 = (%lb) to (%ub) step (%step) schedule(dynamic, monotonic, monotonic, monotonic) {
-    // CHECK: unexpected modifier(s)
-    omp.yield
-  }
-  llvm.return
-}
-
-// -----
-
-llvm.func @test_omp_wsloop_dynamic_wrong_modifier(%lb : i64, %ub : i64, %step : i64) -> () {
-  omp.wsloop (%iv) : i64 = (%lb) to (%ub) step (%step) schedule(dynamic, simd, monotonic) {
-    // CHECK: incorrect modifier order
-    omp.yield
-  }
-  llvm.return
-}
-
-// -----
-
-llvm.func @test_omp_wsloop_dynamic_wrong_modifier2(%lb : i64, %ub : i64, %step : i64) -> () {
-  omp.wsloop (%iv) : i64 = (%lb) to (%ub) step (%step) schedule(dynamic, monotonic, monotonic) {
-    // CHECK: incorrect modifier order
-    omp.yield
-  }
-  llvm.return
-}
-
-// -----
-
-llvm.func @test_omp_wsloop_dynamic_wrong_modifier3(%lb : i64, %ub : i64, %step : i64) -> () {
-  omp.wsloop (%iv) : i64 = (%lb) to (%ub) step (%step) schedule(dynamic, simd, simd) {
-    // CHECK: incorrect modifier order
-    omp.yield
-  }
-  llvm.return
-}


        


More information about the Mlir-commits mailing list