1 // RUN: mlir-opt -split-input-file -verify-diagnostics %s
3 func.func @unknown_clause() {
4 // expected-error@+1 {{expected '{' to begin a region}}
13 func.func @if_once(%n : i1) {
14 // expected-error@+1 {{`if` clause can appear at most once in the expansion of the oilist directive}}
15 omp.parallel if(%n) if(%n) {
23 func.func @num_threads_once(%n : si32) {
24 // expected-error@+1 {{`num_threads` clause can appear at most once in the expansion of the oilist directive}}
25 omp.parallel num_threads(%n : si32) num_threads(%n : si32) {
33 func.func @nowait_not_allowed(%n : memref<i32>) {
34 // expected-error@+1 {{expected '{' to begin a region}}
35 omp.parallel nowait {}
41 func.func @linear_not_allowed(%data_var : memref<i32>, %linear_var : i32) {
42 // expected-error@+1 {{expected '{' to begin a region}}
43 omp.parallel linear(%data_var = %linear_var : memref<i32>) {}
49 func.func @schedule_not_allowed() {
50 // expected-error@+1 {{expected '{' to begin a region}}
51 omp.parallel schedule(static) {}
57 func.func @collapse_not_allowed() {
58 // expected-error@+1 {{expected '{' to begin a region}}
59 omp.parallel collapse(3) {}
65 func.func @order_not_allowed() {
66 // expected-error@+1 {{expected '{' to begin a region}}
67 omp.parallel order(concurrent) {}
73 func.func @ordered_not_allowed() {
74 // expected-error@+1 {{expected '{' to begin a region}}
75 omp.parallel ordered(2) {}
80 func.func @proc_bind_once() {
81 // expected-error@+1 {{`proc_bind` clause can appear at most once in the expansion of the oilist directive}}
82 omp.parallel proc_bind(close) proc_bind(spread) {
90 func.func @invalid_parent(%lb : index, %ub : index, %step : index) {
91 // expected-error@+1 {{op expects parent op to be a loop wrapper}}
92 omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
99 func.func @type_mismatch(%lb : index, %ub : index, %step : index) {
101 // expected-error@+1 {{range argument type does not match corresponding IV type}}
102 "omp.loop_nest" (%lb, %ub, %step) ({
105 }) : (index, index, index) -> ()
111 func.func @iv_number_mismatch(%lb : index, %ub : index, %step : index) {
113 // expected-error@+1 {{number of range arguments and IVs do not match}}
114 "omp.loop_nest" (%lb, %ub, %step) ({
115 ^bb0(%iv1 : index, %iv2 : index):
117 }) : (index, index, index) -> ()
123 func.func @no_wrapper(%lb : index, %ub : index, %step : index) {
124 // expected-error @below {{op loop wrapper does not contain exactly one nested op}}
126 %0 = arith.constant 0 : i32
127 omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
135 func.func @invalid_nested_wrapper(%lb : index, %ub : index, %step : index) {
136 // expected-error @below {{only supported nested wrapper is 'omp.simd'}}
140 omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
150 func.func @no_loops(%lb : index, %ub : index, %step : index) {
152 // expected-error@+1 {{op must represent at least one loop}}
153 "omp.loop_nest" () ({
162 func.func @inclusive_not_a_clause(%lb : index, %ub : index, %step : index) {
163 // expected-error @below {{expected '{'}}
164 omp.wsloop nowait inclusive {
165 omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
173 func.func @order_value(%lb : index, %ub : index, %step : index) {
174 // expected-error @below {{invalid clause value: 'default'}}
175 omp.wsloop order(default) {
176 omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
183 func.func @reproducible_order(%lb : index, %ub : index, %step : index) {
184 // expected-error @below {{invalid clause value: 'default'}}
185 omp.wsloop order(reproducible:default) {
186 omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
192 func.func @unconstrained_order(%lb : index, %ub : index, %step : index) {
193 // expected-error @below {{invalid clause value: 'default'}}
194 omp.wsloop order(unconstrained:default) {
195 omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
202 func.func @if_not_allowed(%lb : index, %ub : index, %step : index, %bool_var : i1) {
203 // expected-error @below {{expected '{'}}
204 omp.wsloop if(%bool_var) {
205 omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
213 func.func @num_threads_not_allowed(%lb : index, %ub : index, %step : index, %int_var : i32) {
214 // expected-error @below {{expected '{'}}
215 omp.wsloop num_threads(%int_var: i32) {
216 omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
224 func.func @proc_bind_not_allowed(%lb : index, %ub : index, %step : index) {
225 // expected-error @below {{expected '{'}}
226 omp.wsloop proc_bind(close) {
227 omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
235 llvm.func @test_omp_wsloop_dynamic_bad_modifier(%lb : i64, %ub : i64, %step : i64) -> () {
236 // expected-error @+1 {{unknown modifier type: ginandtonic}}
237 omp.wsloop schedule(dynamic, ginandtonic) {
238 omp.loop_nest (%iv) : i64 = (%lb) to (%ub) step (%step) {
247 llvm.func @test_omp_wsloop_dynamic_many_modifier(%lb : i64, %ub : i64, %step : i64) -> () {
248 // expected-error @+1 {{unexpected modifier(s)}}
249 omp.wsloop schedule(dynamic, monotonic, monotonic, monotonic) {
250 omp.loop_nest (%iv) : i64 = (%lb) to (%ub) step (%step) {
259 llvm.func @test_omp_wsloop_dynamic_wrong_modifier(%lb : i64, %ub : i64, %step : i64) -> () {
260 // expected-error @+1 {{incorrect modifier order}}
261 omp.wsloop schedule(dynamic, simd, monotonic) {
262 omp.loop_nest (%iv) : i64 = (%lb) to (%ub) step (%step) {
271 llvm.func @test_omp_wsloop_dynamic_wrong_modifier2(%lb : i64, %ub : i64, %step : i64) -> () {
272 // expected-error @+1 {{incorrect modifier order}}
273 omp.wsloop schedule(dynamic, monotonic, monotonic) {
274 omp.loop_nest (%iv) : i64 = (%lb) to (%ub) step (%step) {
283 llvm.func @test_omp_wsloop_dynamic_wrong_modifier3(%lb : i64, %ub : i64, %step : i64) -> () {
284 // expected-error @+1 {{incorrect modifier order}}
285 omp.wsloop schedule(dynamic, simd, simd) {
286 omp.loop_nest (%iv) : i64 = (%lb) to (%ub) step (%step) {
295 func.func @omp_simd() -> () {
296 // expected-error @below {{op loop wrapper does not contain exactly one nested op}}
303 func.func @omp_simd_nested_wrapper(%lb : index, %ub : index, %step : index) -> () {
304 // expected-error @below {{op must wrap an 'omp.loop_nest' directly}}
307 omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
317 func.func @omp_simd_pretty_aligned(%lb : index, %ub : index, %step : index,
318 %data_var : memref<i32>) -> () {
319 // expected-error @below {{expected '->'}}
320 omp.simd aligned(%data_var : memref<i32>) {
321 omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
330 func.func @omp_simd_aligned_mismatch(%arg0 : index, %arg1 : index,
331 %arg2 : index, %arg3 : memref<i32>,
332 %arg4 : memref<i32>) -> () {
333 // expected-error @below {{op expected as many alignment values as aligned variables}}
334 "omp.simd"(%arg3, %arg4) ({
335 omp.loop_nest (%iv) : index = (%arg0) to (%arg1) step (%arg2) {
338 }) {alignments = [128],
339 operandSegmentSizes = array<i32: 2, 0, 0, 0, 0, 0, 0>} : (memref<i32>, memref<i32>) -> ()
345 func.func @omp_simd_aligned_negative(%arg0 : index, %arg1 : index,
346 %arg2 : index, %arg3 : memref<i32>,
347 %arg4 : memref<i32>) -> () {
348 // expected-error @below {{op alignment should be greater than 0}}
349 "omp.simd"(%arg3, %arg4) ({
350 omp.loop_nest (%iv) : index = (%arg0) to (%arg1) step (%arg2) {
353 }) {alignments = [-1, 128], operandSegmentSizes = array<i32: 2, 0, 0, 0, 0, 0, 0>} : (memref<i32>, memref<i32>) -> ()
359 func.func @omp_simd_unexpected_alignment(%arg0 : index, %arg1 : index,
360 %arg2 : index, %arg3 : memref<i32>,
361 %arg4 : memref<i32>) -> () {
362 // expected-error @below {{unexpected alignment values attribute}}
364 omp.loop_nest (%iv) : index = (%arg0) to (%arg1) step (%arg2) {
367 }) {alignments = [1, 128]} : () -> ()
373 func.func @omp_simd_aligned_float(%arg0 : index, %arg1 : index,
374 %arg2 : index, %arg3 : memref<i32>,
375 %arg4 : memref<i32>) -> () {
376 // expected-error @below {{failed to satisfy constraint: 64-bit integer array attribute}}
377 "omp.simd"(%arg3, %arg4) ({
378 omp.loop_nest (%iv) : index = (%arg0) to (%arg1) step (%arg2) {
381 }) {alignments = [1.5, 128], operandSegmentSizes = array<i32: 2, 0, 0, 0, 0, 0, 0>} : (memref<i32>, memref<i32>) -> ()
387 func.func @omp_simd_aligned_the_same_var(%arg0 : index, %arg1 : index,
388 %arg2 : index, %arg3 : memref<i32>,
389 %arg4 : memref<i32>) -> () {
390 // expected-error @below {{aligned variable used more than once}}
391 "omp.simd"(%arg3, %arg3) ({
392 omp.loop_nest (%iv) : index = (%arg0) to (%arg1) step (%arg2) {
395 }) {alignments = [1, 128], operandSegmentSizes = array<i32: 2, 0, 0, 0, 0, 0, 0>} : (memref<i32>, memref<i32>) -> ()
401 func.func @omp_simd_nontemporal_the_same_var(%arg0 : index, %arg1 : index,
403 %arg3 : memref<i32>) -> () {
404 // expected-error @below {{nontemporal variable used more than once}}
405 "omp.simd"(%arg3, %arg3) ({
406 omp.loop_nest (%iv) : index = (%arg0) to (%arg1) step (%arg2) {
409 }) {operandSegmentSizes = array<i32: 0, 0, 0, 0, 2, 0, 0>} : (memref<i32>, memref<i32>) -> ()
415 func.func @omp_simd_order_value(%lb : index, %ub : index, %step : index) {
416 // expected-error @below {{invalid clause value: 'default'}}
417 omp.simd order(default) {
418 omp.loop_nest (%iv) : index = (%arg0) to (%arg1) step (%arg2) {
427 func.func @omp_simd_reproducible_order(%lb : index, %ub : index, %step : index) {
428 // expected-error @below {{invalid clause value: 'default'}}
429 omp.simd order(reproducible:default) {
430 omp.loop_nest (%iv) : index = (%arg0) to (%arg1) step (%arg2) {
437 func.func @omp_simd_unconstrained_order(%lb : index, %ub : index, %step : index) {
438 // expected-error @below {{invalid clause value: 'default'}}
439 omp.simd order(unconstrained:default) {
440 omp.loop_nest (%iv) : index = (%arg0) to (%arg1) step (%arg2) {
447 func.func @omp_simd_pretty_simdlen(%lb : index, %ub : index, %step : index) -> () {
448 // expected-error @below {{op attribute 'simdlen' failed to satisfy constraint: 64-bit signless integer attribute whose value is positive}}
449 omp.simd simdlen(0) {
450 omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
459 func.func @omp_simd_pretty_safelen(%lb : index, %ub : index, %step : index) -> () {
460 // expected-error @below {{op attribute 'safelen' failed to satisfy constraint: 64-bit signless integer attribute whose value is positive}}
461 omp.simd safelen(0) {
462 omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
471 func.func @omp_simd_pretty_simdlen_safelen(%lb : index, %ub : index, %step : index) -> () {
472 // expected-error @below {{op simdlen clause and safelen clause are both present, but the simdlen value is not less than or equal to safelen value}}
473 omp.simd simdlen(2) safelen(1) {
474 omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
483 // expected-error @below {{op expects alloc region to yield a value of the reduction type}}
484 omp.declare_reduction @add_f32 : f32
487 // nonsense test code
488 %0 = arith.constant 0.0 : f64
492 ^bb0(%arg0: f32, %arg1: f32):
493 %0 = arith.constant 0.0 : f32
497 ^bb1(%arg0: f32, %arg1: f32):
498 %1 = arith.addf %arg0, %arg1 : f32
504 // expected-error @below {{op expects two arguments to the initializer region when an allocation region is used}}
505 omp.declare_reduction @add_f32 : f32
508 // nonsense test code
509 omp.yield (%arg : f32)
513 %0 = arith.constant 0.0 : f32
517 ^bb1(%arg0: f32, %arg1: f32):
518 %1 = arith.addf %arg0, %arg1 : f32
524 // expected-error @below {{op expects one argument to the initializer region when no allocation region is used}}
525 omp.declare_reduction @add_f32 : f32
527 ^bb0(%arg: f32, %arg2: f32):
528 %0 = arith.constant 0.0 : f32
532 ^bb1(%arg0: f32, %arg1: f32):
533 %1 = arith.addf %arg0, %arg1 : f32
539 // expected-error @below {{op expects initializer region argument to match the reduction type}}
540 omp.declare_reduction @add_f32 : f64
543 %0 = arith.constant 0.0 : f32
547 ^bb1(%arg0: f32, %arg1: f32):
548 %1 = arith.addf %arg0, %arg1 : f32
554 // expected-error @below {{expects initializer region to yield a value of the reduction type}}
555 omp.declare_reduction @add_f32 : f32
558 %0 = arith.constant 0.0 : f64
562 ^bb1(%arg0: f32, %arg1: f32):
563 %1 = arith.addf %arg0, %arg1 : f32
569 // expected-error @below {{expects reduction region with two arguments of the reduction type}}
570 omp.declare_reduction @add_f32 : f32
573 %0 = arith.constant 0.0 : f32
577 ^bb1(%arg0: f64, %arg1: f64):
578 %1 = arith.addf %arg0, %arg1 : f64
584 // expected-error @below {{expects reduction region to yield a value of the reduction type}}
585 omp.declare_reduction @add_f32 : f32
588 %0 = arith.constant 0.0 : f32
592 ^bb1(%arg0: f32, %arg1: f32):
593 %1 = arith.addf %arg0, %arg1 : f32
594 %2 = arith.extf %1 : f32 to f64
600 // expected-error @below {{expects atomic reduction region with two arguments of the same type}}
601 omp.declare_reduction @add_f32 : f32
604 %0 = arith.constant 0.0 : f32
608 ^bb1(%arg0: f32, %arg1: f32):
609 %1 = arith.addf %arg0, %arg1 : f32
613 ^bb2(%arg0: memref<f32>, %arg1: memref<f64>):
619 // expected-error @below {{expects atomic reduction region arguments to be accumulators containing the reduction type}}
620 omp.declare_reduction @add_f32 : f32
623 %0 = arith.constant 0.0 : f32
627 ^bb1(%arg0: f32, %arg1: f32):
628 %1 = arith.addf %arg0, %arg1 : f32
632 ^bb2(%arg0: memref<f64>, %arg1: memref<f64>):
638 // expected-error @below {{op expects cleanup region with one argument of the reduction type}}
639 omp.declare_reduction @add_f32 : f32
642 %0 = arith.constant 0.0 : f32
646 ^bb1(%arg0: f32, %arg1: f32):
647 %1 = arith.addf %arg0, %arg1 : f32
657 // expected-error @below {{op region #0 ('allocRegion') failed to verify constraint: region with at most 1 blocks}}
658 omp.declare_reduction @alloc_reduction : !llvm.ptr
660 ^bb0(%arg: !llvm.ptr):
661 %c1 = arith.constant 1 : i32
662 %0 = llvm.alloca %c1 x f32 : (i32) -> !llvm.ptr
663 cf.br ^bb1(%0: !llvm.ptr)
664 ^bb1(%ret: !llvm.ptr):
665 omp.yield (%ret : !llvm.ptr)
668 ^bb0(%arg: !llvm.ptr):
669 %cst = arith.constant 1.0 : f32
670 llvm.store %cst, %arg : f32, !llvm.ptr
671 omp.yield (%arg : !llvm.ptr)
674 ^bb1(%arg0: !llvm.ptr, %arg1: !llvm.ptr):
675 %0 = llvm.load %arg0 : !llvm.ptr -> f32
676 %1 = llvm.load %arg1 : !llvm.ptr -> f32
677 %2 = arith.addf %0, %1 : f32
678 llvm.store %2, %arg0 : f32, !llvm.ptr
679 omp.yield (%arg0 : !llvm.ptr)
684 func.func @foo(%lb : index, %ub : index, %step : index) {
685 %c1 = arith.constant 1 : i32
686 %0 = llvm.alloca %c1 x i32 : (i32) -> !llvm.ptr
687 %1 = llvm.alloca %c1 x i32 : (i32) -> !llvm.ptr
689 // expected-error @below {{expected symbol reference @foo to point to a reduction declaration}}
690 omp.wsloop reduction(@foo %0 -> %prv : !llvm.ptr) {
691 omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
692 %2 = arith.constant 2.0 : f32
701 omp.declare_reduction @add_f32 : f32
704 %0 = arith.constant 0.0 : f32
708 ^bb1(%arg0: f32, %arg1: f32):
709 %1 = arith.addf %arg0, %arg1 : f32
713 func.func @foo(%lb : index, %ub : index, %step : index) {
714 %c1 = arith.constant 1 : i32
715 %0 = llvm.alloca %c1 x i32 : (i32) -> !llvm.ptr
717 // expected-error @below {{accumulator variable used more than once}}
718 omp.wsloop reduction(@add_f32 %0 -> %prv, @add_f32 %0 -> %prv1 : !llvm.ptr, !llvm.ptr) {
719 omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
720 %2 = arith.constant 2.0 : f32
729 omp.declare_reduction @add_f32 : f32
732 %0 = arith.constant 0.0 : f32
736 ^bb1(%arg0: f32, %arg1: f32):
737 %1 = arith.addf %arg0, %arg1 : f32
741 ^bb2(%arg2: !llvm.ptr, %arg3: !llvm.ptr):
742 %2 = llvm.load %arg3 : !llvm.ptr -> f32
743 llvm.atomicrmw fadd %arg2, %2 monotonic : !llvm.ptr, f32
747 func.func @foo(%lb : index, %ub : index, %step : index, %mem : memref<1xf32>) {
748 %c1 = arith.constant 1 : i32
750 // expected-error @below {{expected accumulator ('memref<1xf32>') to be the same type as reduction declaration ('!llvm.ptr')}}
751 omp.wsloop reduction(@add_f32 %mem -> %prv : memref<1xf32>) {
752 omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
753 %2 = arith.constant 2.0 : f32
762 func.func @omp_critical2() -> () {
763 // expected-error @below {{expected symbol reference @excl to point to a critical declaration}}
764 omp.critical(@excl) {
772 // expected-error @below {{the hints omp_sync_hint_uncontended and omp_sync_hint_contended cannot be combined}}
773 omp.critical.declare @mutex hint(uncontended, contended)
777 // expected-error @below {{the hints omp_sync_hint_nonspeculative and omp_sync_hint_speculative cannot be combined}}
778 omp.critical.declare @mutex hint(nonspeculative, speculative)
782 // expected-error @below {{invalid_hint is not a valid hint}}
783 omp.critical.declare @mutex hint(invalid_hint)
787 func.func @omp_ordered_region1(%x : i32) -> () {
789 omp.loop_nest (%i) : i32 = (%x) to (%x) step (%x) {
790 // expected-error @below {{op must be nested inside of a worksharing, simd or worksharing simd loop}}
802 func.func @omp_ordered_region2(%x : i32) -> () {
804 omp.loop_nest (%i) : i32 = (%x) to (%x) step (%x) {
805 // expected-error @below {{the enclosing worksharing-loop region must have an ordered clause}}
817 func.func @omp_ordered_region3(%x : i32) -> () {
818 omp.wsloop ordered(1) {
819 omp.loop_nest (%i) : i32 = (%x) to (%x) step (%x) {
820 // expected-error @below {{the enclosing loop's ordered clause must not have a parameter present}}
832 func.func @omp_ordered1(%vec0 : i64) -> () {
833 // expected-error @below {{op must be nested inside of a loop}}
834 omp.ordered depend_type(dependsink) depend_vec(%vec0 : i64) {doacross_num_loops = 1 : i64}
840 func.func @omp_ordered2(%arg1 : i32, %arg2 : i32, %arg3 : i32, %vec0 : i64) -> () {
842 omp.loop_nest (%0) : i32 = (%arg1) to (%arg2) step (%arg3) {
843 // expected-error @below {{op must be nested inside of a worksharing, simd or worksharing simd loop}}
844 omp.ordered depend_type(dependsink) depend_vec(%vec0 : i64) {doacross_num_loops = 1 : i64}
853 func.func @omp_ordered3(%arg1 : i32, %arg2 : i32, %arg3 : i32, %vec0 : i64) -> () {
855 omp.loop_nest (%0) : i32 = (%arg1) to (%arg2) step (%arg3) {
856 // expected-error @below {{the enclosing worksharing-loop region must have an ordered clause}}
857 omp.ordered depend_type(dependsink) depend_vec(%vec0 : i64) {doacross_num_loops = 1 : i64}
866 func.func @omp_ordered4(%arg1 : i32, %arg2 : i32, %arg3 : i32, %vec0 : i64) -> () {
867 omp.wsloop ordered(0) {
868 omp.loop_nest (%0) : i32 = (%arg1) to (%arg2) step (%arg3) {
869 // expected-error @below {{the enclosing loop's ordered clause must have a parameter present}}
870 omp.ordered depend_type(dependsink) depend_vec(%vec0 : i64) {doacross_num_loops = 1 : i64}
879 func.func @omp_ordered5(%arg1 : i32, %arg2 : i32, %arg3 : i32, %vec0 : i64, %vec1 : i64) -> () {
880 omp.wsloop ordered(1) {
881 omp.loop_nest (%0) : i32 = (%arg1) to (%arg2) step (%arg3) {
882 // expected-error @below {{number of variables in depend clause does not match number of iteration variables in the doacross loop}}
883 omp.ordered depend_type(dependsource) depend_vec(%vec0, %vec1 : i64, i64) {doacross_num_loops = 2 : i64}
892 func.func @omp_atomic_read1(%x: memref<i32>, %v: memref<i32>) {
893 // expected-error @below {{the hints omp_sync_hint_nonspeculative and omp_sync_hint_speculative cannot be combined.}}
894 omp.atomic.read %v = %x hint(speculative, nonspeculative) : memref<i32>, memref<i32>, i32
900 func.func @omp_atomic_read2(%x: memref<i32>, %v: memref<i32>) {
901 // expected-error @below {{invalid clause value: 'xyz'}}
902 omp.atomic.read %v = %x memory_order(xyz) : memref<i32>, memref<i32>, i32
908 func.func @omp_atomic_read3(%x: memref<i32>, %v: memref<i32>) {
909 // expected-error @below {{memory-order must not be acq_rel or release for atomic reads}}
910 omp.atomic.read %v = %x memory_order(acq_rel) : memref<i32>, memref<i32>, i32
916 func.func @omp_atomic_read4(%x: memref<i32>, %v: memref<i32>) {
917 // expected-error @below {{memory-order must not be acq_rel or release for atomic reads}}
918 omp.atomic.read %v = %x memory_order(release) : memref<i32>, memref<i32>, i32
924 func.func @omp_atomic_read5(%x: memref<i32>, %v: memref<i32>) {
925 // expected-error @below {{`memory_order` clause can appear at most once in the expansion of the oilist directive}}
926 omp.atomic.read %v = %x memory_order(acquire) memory_order(relaxed) : memref<i32>, memref<i32>, i32
932 func.func @omp_atomic_read6(%x: memref<i32>, %v: memref<i32>) {
933 // expected-error @below {{`hint` clause can appear at most once in the expansion of the oilist directive}}
934 omp.atomic.read %v = %x hint(speculative) hint(contended) : memref<i32>, memref<i32>, i32
940 func.func @omp_atomic_read6(%x: memref<i32>, %v: memref<i32>) {
941 // expected-error @below {{read and write must not be to the same location for atomic reads}}
942 omp.atomic.read %x = %x hint(speculative) : memref<i32>, memref<i32>, i32
948 func.func @omp_atomic_write1(%addr : memref<i32>, %val : i32) {
949 // expected-error @below {{the hints omp_sync_hint_uncontended and omp_sync_hint_contended cannot be combined}}
950 omp.atomic.write %addr = %val hint(contended, uncontended) : memref<i32>, i32
956 func.func @omp_atomic_write2(%addr : memref<i32>, %val : i32) {
957 // expected-error @below {{memory-order must not be acq_rel or acquire for atomic writes}}
958 omp.atomic.write %addr = %val memory_order(acq_rel) : memref<i32>, i32
964 func.func @omp_atomic_write3(%addr : memref<i32>, %val : i32) {
965 // expected-error @below {{memory-order must not be acq_rel or acquire for atomic writes}}
966 omp.atomic.write %addr = %val memory_order(acquire) : memref<i32>, i32
972 func.func @omp_atomic_write4(%addr : memref<i32>, %val : i32) {
973 // expected-error @below {{`memory_order` clause can appear at most once in the expansion of the oilist directive}}
974 omp.atomic.write %addr = %val memory_order(release) memory_order(seq_cst) : memref<i32>, i32
980 func.func @omp_atomic_write5(%addr : memref<i32>, %val : i32) {
981 // expected-error @below {{`hint` clause can appear at most once in the expansion of the oilist directive}}
982 omp.atomic.write %addr = %val hint(contended) hint(speculative) : memref<i32>, i32
988 func.func @omp_atomic_write6(%addr : memref<i32>, %val : i32) {
989 // expected-error @below {{invalid clause value: 'xyz'}}
990 omp.atomic.write %addr = %val memory_order(xyz) : memref<i32>, i32
996 func.func @omp_atomic_write(%addr : memref<memref<i32>>, %val : i32) {
997 // expected-error @below {{address must dereference to value type}}
998 omp.atomic.write %addr = %val : memref<memref<i32>>, i32
1004 func.func @omp_atomic_update1(%x: memref<i32>, %expr: f32) {
1005 // expected-error @below {{the type of the operand must be a pointer type whose element type is the same as that of the region argument}}
1006 omp.atomic.update %x : memref<i32> {
1008 %newval = llvm.fadd %xval, %expr : f32
1009 omp.yield (%newval : f32)
1016 func.func @omp_atomic_update2(%x: memref<i32>, %expr: i32) {
1017 // expected-error @+2 {{op expects regions to end with 'omp.yield', found 'omp.terminator'}}
1018 // expected-note @below {{in custom textual format, the absence of terminator implies 'omp.yield'}}
1019 omp.atomic.update %x : memref<i32> {
1021 %newval = llvm.add %xval, %expr : i32
1029 func.func @omp_atomic_update3(%x: memref<i32>, %expr: i32) {
1030 // expected-error @below {{memory-order must not be acq_rel or acquire for atomic updates}}
1031 omp.atomic.update memory_order(acq_rel) %x : memref<i32> {
1033 %newval = llvm.add %xval, %expr : i32
1034 omp.yield (%newval : i32)
1041 func.func @omp_atomic_update4(%x: memref<i32>, %expr: i32) {
1042 // expected-error @below {{memory-order must not be acq_rel or acquire for atomic updates}}
1043 omp.atomic.update memory_order(acquire) %x : memref<i32> {
1045 %newval = llvm.add %xval, %expr : i32
1046 omp.yield (%newval : i32)
1053 func.func @omp_atomic_update5(%x: memref<i32>, %expr: i32) {
1054 // expected-error @below {{invalid kind of type specified}}
1055 omp.atomic.update %x : i32 {
1057 %newval = llvm.add %xval, %expr : i32
1058 omp.yield (%newval : i32)
1065 func.func @omp_atomic_update6(%x: memref<i32>, %expr: i32) {
1066 // expected-error @below {{only updated value must be returned}}
1067 omp.atomic.update %x : memref<i32> {
1069 %newval = llvm.add %xval, %expr : i32
1070 omp.yield (%newval, %expr : i32, i32)
1077 func.func @omp_atomic_update7(%x: memref<i32>, %expr: i32, %y: f32) {
1078 // expected-error @below {{input and yielded value must have the same type}}
1079 omp.atomic.update %x : memref<i32> {
1081 %newval = llvm.add %xval, %expr : i32
1089 func.func @omp_atomic_update8(%x: memref<i32>, %expr: i32) {
1090 // expected-error @below {{the region must accept exactly one argument}}
1091 omp.atomic.update %x : memref<i32> {
1092 ^bb0(%xval: i32, %tmp: i32):
1093 %newval = llvm.add %xval, %expr : i32
1094 omp.yield (%newval : i32)
1101 func.func @omp_atomic_update(%x: memref<i32>, %expr: i32) {
1102 // expected-error @below {{the hints omp_sync_hint_uncontended and omp_sync_hint_contended cannot be combined}}
1103 omp.atomic.update hint(uncontended, contended) %x : memref<i32> {
1105 %newval = llvm.add %xval, %expr : i32
1106 omp.yield (%newval : i32)
1113 func.func @omp_atomic_update(%x: memref<i32>, %expr: i32) {
1114 // expected-error @below {{the hints omp_sync_hint_nonspeculative and omp_sync_hint_speculative cannot be combined}}
1115 omp.atomic.update hint(nonspeculative, speculative) %x : memref<i32> {
1117 %newval = llvm.add %xval, %expr : i32
1118 omp.yield (%newval : i32)
1125 func.func @omp_atomic_update(%x: memref<i32>, %expr: i32) {
1126 // expected-error @below {{invalid_hint is not a valid hint}}
1127 omp.atomic.update hint(invalid_hint) %x : memref<i32> {
1129 %newval = llvm.add %xval, %expr : i32
1130 omp.yield (%newval : i32)
1137 func.func @omp_atomic_capture(%x: memref<i32>, %v: memref<i32>, %expr: i32) {
1138 // expected-error @below {{expected three operations in atomic.capture region}}
1139 omp.atomic.capture {
1140 omp.atomic.read %v = %x : memref<i32>, memref<i32>, i32
1148 func.func @omp_atomic_capture(%x: memref<i32>, %v: memref<i32>, %expr: i32) {
1149 omp.atomic.capture {
1150 // expected-error @below {{invalid sequence of operations in the capture region}}
1151 omp.atomic.read %v = %x : memref<i32>, memref<i32>, i32
1152 omp.atomic.read %v = %x : memref<i32>, memref<i32>, i32
1160 func.func @omp_atomic_capture(%x: memref<i32>, %v: memref<i32>, %expr: i32) {
1161 omp.atomic.capture {
1162 // expected-error @below {{invalid sequence of operations in the capture region}}
1163 omp.atomic.update %x : memref<i32> {
1165 %newval = llvm.add %xval, %expr : i32
1166 omp.yield (%newval : i32)
1168 omp.atomic.update %x : memref<i32> {
1170 %newval = llvm.add %xval, %expr : i32
1171 omp.yield (%newval : i32)
1180 func.func @omp_atomic_capture(%x: memref<i32>, %v: memref<i32>, %expr: i32) {
1181 omp.atomic.capture {
1182 // expected-error @below {{invalid sequence of operations in the capture region}}
1183 omp.atomic.write %x = %expr : memref<i32>, i32
1184 omp.atomic.write %x = %expr : memref<i32>, i32
1192 func.func @omp_atomic_capture(%x: memref<i32>, %v: memref<i32>, %expr: i32) {
1193 omp.atomic.capture {
1194 // expected-error @below {{invalid sequence of operations in the capture region}}
1195 omp.atomic.write %x = %expr : memref<i32>, i32
1196 omp.atomic.update %x : memref<i32> {
1198 %newval = llvm.add %xval, %expr : i32
1199 omp.yield (%newval : i32)
1208 func.func @omp_atomic_capture(%x: memref<i32>, %v: memref<i32>, %expr: i32) {
1209 omp.atomic.capture {
1210 // expected-error @below {{invalid sequence of operations in the capture region}}
1211 omp.atomic.update %x : memref<i32> {
1213 %newval = llvm.add %xval, %expr : i32
1214 omp.yield (%newval : i32)
1216 omp.atomic.write %x = %expr : memref<i32>, i32
1224 func.func @omp_atomic_capture(%x: memref<i32>, %v: memref<i32>, %expr: i32) {
1225 omp.atomic.capture {
1226 // expected-error @below {{invalid sequence of operations in the capture region}}
1227 omp.atomic.write %x = %expr : memref<i32>, i32
1228 omp.atomic.read %v = %x : memref<i32>, memref<i32>, i32
1236 func.func @omp_atomic_capture(%x: memref<i32>, %y: memref<i32>, %v: memref<i32>, %expr: i32) {
1237 omp.atomic.capture {
1238 // expected-error @below {{updated variable in atomic.update must be captured in second operation}}
1239 omp.atomic.update %x : memref<i32> {
1241 %newval = llvm.add %xval, %expr : i32
1242 omp.yield (%newval : i32)
1244 omp.atomic.read %v = %y : memref<i32>, memref<i32>, i32
1251 func.func @omp_atomic_capture(%x: memref<i32>, %y: memref<i32>, %v: memref<i32>, %expr: i32) {
1252 omp.atomic.capture {
1253 // expected-error @below {{captured variable in atomic.read must be updated in second operation}}
1254 omp.atomic.read %v = %y : memref<i32>, memref<i32>, i32
1255 omp.atomic.update %x : memref<i32> {
1257 %newval = llvm.add %xval, %expr : i32
1258 omp.yield (%newval : i32)
1266 func.func @omp_atomic_capture(%x: memref<i32>, %y: memref<i32>, %v: memref<i32>, %expr: i32) {
1267 omp.atomic.capture {
1268 // expected-error @below {{captured variable in atomic.read must be updated in second operation}}
1269 omp.atomic.read %v = %x : memref<i32>, memref<i32>, i32
1270 omp.atomic.write %y = %expr : memref<i32>, i32
1277 func.func @omp_atomic_capture(%x: memref<i32>, %v: memref<i32>, %expr: i32) {
1278 // expected-error @below {{the hints omp_sync_hint_uncontended and omp_sync_hint_contended cannot be combined}}
1279 omp.atomic.capture hint(contended, uncontended) {
1280 omp.atomic.update %x : memref<i32> {
1282 %newval = llvm.add %xval, %expr : i32
1283 omp.yield(%newval : i32)
1285 omp.atomic.read %v = %x : memref<i32>, memref<i32>, i32
1292 func.func @omp_atomic_capture(%x: memref<i32>, %v: memref<i32>, %expr: i32) {
1293 // expected-error @below {{the hints omp_sync_hint_nonspeculative and omp_sync_hint_speculative cannot be combined}}
1294 omp.atomic.capture hint(nonspeculative, speculative) {
1295 omp.atomic.update %x : memref<i32> {
1297 %newval = llvm.add %xval, %expr : i32
1298 omp.yield(%newval : i32)
1300 omp.atomic.read %v = %x : memref<i32>, memref<i32>, i32
1307 func.func @omp_atomic_capture(%x: memref<i32>, %v: memref<i32>, %expr: i32) {
1308 // expected-error @below {{invalid_hint is not a valid hint}}
1309 omp.atomic.capture hint(invalid_hint) {
1310 omp.atomic.update %x : memref<i32> {
1312 %newval = llvm.add %xval, %expr : i32
1313 omp.yield(%newval : i32)
1315 omp.atomic.read %v = %x : memref<i32>, memref<i32>, i32
1322 func.func @omp_atomic_capture(%x: memref<i32>, %v: memref<i32>, %expr: i32) {
1323 // expected-error @below {{operations inside capture region must not have hint clause}}
1324 omp.atomic.capture {
1325 omp.atomic.update hint(uncontended) %x : memref<i32> {
1327 %newval = llvm.add %xval, %expr : i32
1328 omp.yield(%newval : i32)
1330 omp.atomic.read %v = %x : memref<i32>, memref<i32>, i32
1337 func.func @omp_atomic_capture(%x: memref<i32>, %v: memref<i32>, %expr: i32) {
1338 // expected-error @below {{operations inside capture region must not have memory_order clause}}
1339 omp.atomic.capture {
1340 omp.atomic.update memory_order(seq_cst) %x : memref<i32> {
1342 %newval = llvm.add %xval, %expr : i32
1343 omp.yield(%newval : i32)
1345 omp.atomic.read %v = %x : memref<i32>, memref<i32>, i32
1352 func.func @omp_atomic_capture(%x: memref<i32>, %v: memref<i32>, %expr: i32) {
1353 // expected-error @below {{operations inside capture region must not have memory_order clause}}
1354 omp.atomic.capture {
1355 omp.atomic.update %x : memref<i32> {
1357 %newval = llvm.add %xval, %expr : i32
1358 omp.yield(%newval : i32)
1360 omp.atomic.read %v = %x memory_order(seq_cst) : memref<i32>, memref<i32>, i32
1367 func.func @omp_teams_parent() {
1369 // expected-error @below {{expected to be nested inside of omp.target or not nested in any OpenMP dialect operations}}
1380 func.func @omp_teams_allocate(%data_var : memref<i32>) {
1382 // expected-error @below {{expected equal sizes for allocate and allocator variables}}
1383 "omp.teams" (%data_var) ({
1385 }) {operandSegmentSizes = array<i32: 1,0,0,0,0,0,0,0>} : (memref<i32>) -> ()
1393 func.func @omp_teams_num_teams1(%lb : i32) {
1395 // expected-error @below {{expected num_teams upper bound to be defined if the lower bound is defined}}
1396 "omp.teams" (%lb) ({
1398 }) {operandSegmentSizes = array<i32: 0,0,0,1,0,0,0,0>} : (i32) -> ()
1406 func.func @omp_teams_num_teams2(%lb : i32, %ub : i16) {
1408 // expected-error @below {{expected num_teams upper bound and lower bound to be the same type}}
1409 omp.teams num_teams(%lb : i32 to %ub : i16) {
1419 func.func @omp_sections(%data_var : memref<i32>) -> () {
1420 // expected-error @below {{expected equal sizes for allocate and allocator variables}}
1421 "omp.sections" (%data_var) ({
1423 }) {operandSegmentSizes = array<i32: 1,0,0,0>} : (memref<i32>) -> ()
1429 func.func @omp_sections(%data_var : memref<i32>) -> () {
1430 // expected-error @below {{expected as many reduction symbol references as reduction variables}}
1431 "omp.sections" (%data_var) ({
1432 ^bb0(%arg0: memref<i32>):
1434 }) {operandSegmentSizes = array<i32: 0,0,0,1>} : (memref<i32>) -> ()
1440 func.func @omp_sections(%data_var : memref<i32>) -> () {
1441 // expected-error @below {{expected omp.section op or terminator op inside region}}
1443 "test.payload" () : () -> ()
1450 func.func @omp_sections(%cond : i1) {
1451 // expected-error @below {{expected '{' to begin a region}}
1452 omp.sections if(%cond) {
1460 func.func @omp_sections() {
1461 // expected-error @below {{expected '{' to begin a region}}
1462 omp.sections num_threads(10) {
1470 func.func @omp_sections() {
1471 // expected-error @below {{expected '{' to begin a region}}
1472 omp.sections proc_bind(close) {
1480 func.func @omp_sections(%data_var : memref<i32>, %linear_var : i32) {
1481 // expected-error @below {{expected '{' to begin a region}}
1482 omp.sections linear(%data_var = %linear_var : memref<i32>) {
1490 func.func @omp_sections() {
1491 // expected-error @below {{expected '{' to begin a region}}
1492 omp.sections schedule(static, none) {
1500 func.func @omp_sections() {
1501 // expected-error @below {{expected '{' to begin a region}}
1502 omp.sections collapse(3) {
1510 func.func @omp_sections() {
1511 // expected-error @below {{expected '{' to begin a region}}
1512 omp.sections ordered(2) {
1520 func.func @omp_sections() {
1521 // expected-error @below {{expected '{' to begin a region}}
1522 omp.sections order(concurrent) {
1530 func.func @omp_sections() {
1531 // expected-error @below {{failed to verify constraint: region with 1 blocks}}
1545 omp.declare_reduction @add_f32 : f32
1548 %0 = arith.constant 0.0 : f32
1549 omp.yield (%0 : f32)
1552 ^bb1(%arg0: f32, %arg1: f32):
1553 %1 = arith.addf %arg0, %arg1 : f32
1554 omp.yield (%1 : f32)
1557 func.func @omp_sections(%x : !llvm.ptr) {
1558 omp.sections reduction(@add_f32 %x -> %arg0 : !llvm.ptr) {
1559 // expected-error @below {{op expected at least 1 entry block argument(s)}}
1570 func.func @omp_single(%data_var : memref<i32>) -> () {
1571 // expected-error @below {{expected equal sizes for allocate and allocator variables}}
1572 "omp.single" (%data_var) ({
1574 }) {operandSegmentSizes = array<i32: 1,0,0,0>} : (memref<i32>) -> ()
1580 func.func @omp_single_copyprivate(%data_var : memref<i32>) -> () {
1581 // expected-error @below {{inconsistent number of copyprivate vars (= 1) and functions (= 0), both must be equal}}
1582 "omp.single" (%data_var) ({
1584 }) {operandSegmentSizes = array<i32: 0,0,1,0>} : (memref<i32>) -> ()
1590 func.func @omp_single_copyprivate(%data_var : memref<i32>) -> () {
1591 // expected-error @below {{expected symbol reference @copy_func to point to a copy function}}
1592 omp.single copyprivate(%data_var -> @copy_func : memref<i32>) {
1600 func.func private @copy_func(memref<i32>)
1602 func.func @omp_single_copyprivate(%data_var : memref<i32>) -> () {
1603 // expected-error @below {{expected copy function @copy_func to have 2 operands}}
1604 omp.single copyprivate(%data_var -> @copy_func : memref<i32>) {
1612 func.func private @copy_func(memref<i32>, memref<f32>)
1614 func.func @omp_single_copyprivate(%data_var : memref<i32>) -> () {
1615 // expected-error @below {{expected copy function @copy_func arguments to have the same type}}
1616 omp.single copyprivate(%data_var -> @copy_func : memref<i32>) {
1624 func.func private @copy_func(memref<f32>, memref<f32>)
1626 func.func @omp_single_copyprivate(%data_var : memref<i32>) -> () {
1627 // expected-error @below {{expected copy function arguments' type ('memref<f32>') to be the same as copyprivate variable's type ('memref<i32>')}}
1628 omp.single copyprivate(%data_var -> @copy_func : memref<i32>) {
1636 func.func @omp_task_depend(%data_var: memref<i32>) {
1637 // expected-error @below {{op expected as many depend values as depend variables}}
1638 "omp.task"(%data_var) ({
1639 "omp.terminator"() : () -> ()
1640 }) {depend_kinds = [], operandSegmentSizes = array<i32: 0, 0, 1, 0, 0, 0, 0, 0>} : (memref<i32>) -> ()
1641 "func.return"() : () -> ()
1646 func.func @omp_task(%ptr: !llvm.ptr) {
1647 // expected-error @below {{op expected symbol reference @add_f32 to point to a reduction declaration}}
1648 omp.task in_reduction(@add_f32 %ptr -> %arg0 : !llvm.ptr) {
1649 // CHECK: "test.foo"() : () -> ()
1650 "test.foo"() : () -> ()
1651 // CHECK: omp.terminator
1658 omp.declare_reduction @add_f32 : f32
1661 %0 = arith.constant 0.0 : f32
1662 omp.yield (%0 : f32)
1665 ^bb1(%arg0: f32, %arg1: f32):
1666 %1 = arith.addf %arg0, %arg1 : f32
1667 omp.yield (%1 : f32)
1670 func.func @omp_task(%ptr: !llvm.ptr) {
1671 // expected-error @below {{op accumulator variable used more than once}}
1672 omp.task in_reduction(@add_f32 %ptr -> %arg0, @add_f32 %ptr -> %arg1 : !llvm.ptr, !llvm.ptr) {
1673 // CHECK: "test.foo"() : () -> ()
1674 "test.foo"() : () -> ()
1675 // CHECK: omp.terminator
1682 omp.declare_reduction @add_i32 : i32
1685 %0 = arith.constant 0 : i32
1686 omp.yield (%0 : i32)
1689 ^bb1(%arg0: i32, %arg1: i32):
1690 %1 = arith.addi %arg0, %arg1 : i32
1691 omp.yield (%1 : i32)
1694 ^bb2(%arg2: !llvm.ptr, %arg3: !llvm.ptr):
1695 %2 = llvm.load %arg3 : !llvm.ptr -> i32
1696 llvm.atomicrmw add %arg2, %2 monotonic : !llvm.ptr, i32
1700 func.func @omp_task(%mem: memref<1xf32>) {
1701 // expected-error @below {{op expected accumulator ('memref<1xf32>') to be the same type as reduction declaration ('!llvm.ptr')}}
1702 omp.task in_reduction(@add_i32 %mem -> %arg0 : memref<1xf32>) {
1703 // CHECK: "test.foo"() : () -> ()
1704 "test.foo"() : () -> ()
1705 // CHECK: omp.terminator
1713 func.func @omp_cancel() {
1715 // expected-error @below {{cancel parallel must appear inside a parallel region}}
1716 omp.cancel cancellation_construct_type(parallel)
1717 // CHECK: omp.terminator
1725 func.func @omp_cancel1() {
1727 // expected-error @below {{cancel sections must appear inside a sections region}}
1728 omp.cancel cancellation_construct_type(sections)
1729 // CHECK: omp.terminator
1737 func.func @omp_cancel2() {
1739 // expected-error @below {{cancel loop must appear inside a worksharing-loop region}}
1740 omp.cancel cancellation_construct_type(loop)
1741 // CHECK: omp.terminator
1749 func.func @omp_cancel3(%arg1 : i32, %arg2 : i32, %arg3 : i32) -> () {
1751 omp.loop_nest (%0) : i32 = (%arg1) to (%arg2) step (%arg3) {
1752 // expected-error @below {{A worksharing construct that is canceled must not have a nowait clause}}
1753 omp.cancel cancellation_construct_type(loop)
1763 func.func @omp_cancel4(%arg1 : i32, %arg2 : i32, %arg3 : i32) -> () {
1764 omp.wsloop ordered(1) {
1765 omp.loop_nest (%0) : i32 = (%arg1) to (%arg2) step (%arg3) {
1766 // expected-error @below {{A worksharing construct that is canceled must not have an ordered clause}}
1767 omp.cancel cancellation_construct_type(loop)
1777 func.func @omp_cancel5() -> () {
1778 omp.sections nowait {
1780 // expected-error @below {{A sections construct that is canceled must not have a nowait clause}}
1781 omp.cancel cancellation_construct_type(sections)
1784 // CHECK: omp.terminator
1792 func.func @omp_cancellationpoint() {
1794 // expected-error @below {{cancellation point parallel must appear inside a parallel region}}
1795 omp.cancellation_point cancellation_construct_type(parallel)
1796 // CHECK: omp.terminator
1804 func.func @omp_cancellationpoint1() {
1806 // expected-error @below {{cancellation point sections must appear inside a sections region}}
1807 omp.cancellation_point cancellation_construct_type(sections)
1808 // CHECK: omp.terminator
1816 func.func @omp_cancellationpoint2() {
1818 // expected-error @below {{cancellation point loop must appear inside a worksharing-loop region}}
1819 omp.cancellation_point cancellation_construct_type(loop)
1820 // CHECK: omp.terminator
1828 func.func @taskloop(%lb: i32, %ub: i32, %step: i32) {
1829 %testmemref = "test.memref"() : () -> (memref<i32>)
1830 // expected-error @below {{expected equal sizes for allocate and allocator variables}}
1831 "omp.taskloop"(%testmemref) ({
1832 omp.loop_nest (%i, %j) : i32 = (%lb, %ub) to (%ub, %lb) step (%step, %step) {
1835 }) {operandSegmentSizes = array<i32: 1, 0, 0, 0, 0, 0, 0, 0, 0, 0>} : (memref<i32>) -> ()
1841 func.func @taskloop(%lb: i32, %ub: i32, %step: i32) {
1842 %testf32 = "test.f32"() : () -> (!llvm.ptr)
1843 %testf32_2 = "test.f32"() : () -> (!llvm.ptr)
1844 // expected-error @below {{expected as many reduction symbol references as reduction variables}}
1845 "omp.taskloop"(%testf32, %testf32_2) ({
1846 ^bb0(%arg0: !llvm.ptr, %arg1: !llvm.ptr):
1847 omp.loop_nest (%i, %j) : i32 = (%lb, %ub) to (%ub, %lb) step (%step, %step) {
1850 }) {operandSegmentSizes = array<i32: 0, 0, 0, 0, 0, 0, 0, 0, 0, 2>, reduction_syms = [@add_f32]} : (!llvm.ptr, !llvm.ptr) -> ()
1856 func.func @taskloop(%lb: i32, %ub: i32, %step: i32) {
1857 %testf32 = "test.f32"() : () -> (!llvm.ptr)
1858 // expected-error @below {{expected as many reduction symbol references as reduction variables}}
1859 "omp.taskloop"(%testf32) ({
1860 ^bb0(%arg0: !llvm.ptr):
1861 omp.loop_nest (%i, %j) : i32 = (%lb, %ub) to (%ub, %lb) step (%step, %step) {
1864 }) {operandSegmentSizes = array<i32: 0, 0, 0, 0, 0, 0, 0, 0, 0, 1>, reduction_syms = [@add_f32, @add_f32]} : (!llvm.ptr) -> ()
1870 func.func @taskloop(%lb: i32, %ub: i32, %step: i32) {
1871 %testf32 = "test.f32"() : () -> (!llvm.ptr)
1872 %testf32_2 = "test.f32"() : () -> (!llvm.ptr)
1873 // expected-error @below {{expected as many reduction symbol references as reduction variables}}
1874 "omp.taskloop"(%testf32, %testf32_2) ({
1875 ^bb0(%arg0: !llvm.ptr, %arg1: !llvm.ptr):
1876 omp.loop_nest (%i, %j) : i32 = (%lb, %ub) to (%ub, %lb) step (%step, %step) {
1879 }) {in_reduction_syms = [@add_f32], operandSegmentSizes = array<i32: 0, 0, 0, 0, 0, 2, 0, 0, 0, 0>} : (!llvm.ptr, !llvm.ptr) -> ()
1885 func.func @taskloop(%lb: i32, %ub: i32, %step: i32) {
1886 %testf32 = "test.f32"() : () -> (!llvm.ptr)
1887 // expected-error @below {{expected as many reduction symbol references as reduction variables}}
1888 "omp.taskloop"(%testf32) ({
1889 ^bb0(%arg0: !llvm.ptr):
1890 omp.loop_nest (%i, %j) : i32 = (%lb, %ub) to (%ub, %lb) step (%step, %step) {
1893 }) {in_reduction_syms = [@add_f32, @add_f32], operandSegmentSizes = array<i32: 0, 0, 0, 0, 0, 1, 0, 0, 0, 0>} : (!llvm.ptr) -> ()
1899 omp.declare_reduction @add_f32 : f32
1902 %0 = arith.constant 0.0 : f32
1903 omp.yield (%0 : f32)
1906 ^bb1(%arg0: f32, %arg1: f32):
1907 %1 = arith.addf %arg0, %arg1 : f32
1908 omp.yield (%1 : f32)
1911 func.func @taskloop(%lb: i32, %ub: i32, %step: i32) {
1912 %testf32 = "test.f32"() : () -> (!llvm.ptr)
1913 %testf32_2 = "test.f32"() : () -> (!llvm.ptr)
1914 // expected-error @below {{if a reduction clause is present on the taskloop directive, the nogroup clause must not be specified}}
1915 omp.taskloop nogroup reduction(@add_f32 %testf32 -> %arg0, @add_f32 %testf32_2 -> %arg1 : !llvm.ptr, !llvm.ptr) {
1916 omp.loop_nest (%i, %j) : i32 = (%lb, %ub) to (%ub, %lb) step (%step, %step) {
1925 omp.declare_reduction @add_f32 : f32
1928 %0 = arith.constant 0.0 : f32
1929 omp.yield (%0 : f32)
1932 ^bb1(%arg0: f32, %arg1: f32):
1933 %1 = arith.addf %arg0, %arg1 : f32
1934 omp.yield (%1 : f32)
1937 func.func @taskloop(%lb: i32, %ub: i32, %step: i32) {
1938 %testf32 = "test.f32"() : () -> (!llvm.ptr)
1939 // expected-error @below {{the same list item cannot appear in both a reduction and an in_reduction clause}}
1940 omp.taskloop in_reduction(@add_f32 %testf32 -> %arg0 : !llvm.ptr) reduction(@add_f32 %testf32 -> %arg1 : !llvm.ptr) {
1941 omp.loop_nest (%i, %j) : i32 = (%lb, %ub) to (%ub, %lb) step (%step, %step) {
1950 func.func @taskloop(%lb: i32, %ub: i32, %step: i32) {
1951 %testi64 = "test.i64"() : () -> (i64)
1952 // expected-error @below {{the grainsize clause and num_tasks clause are mutually exclusive and may not appear on the same taskloop directive}}
1953 omp.taskloop grainsize(%testi64: i64) num_tasks(%testi64: i64) {
1954 omp.loop_nest (%i, %j) : i32 = (%lb, %ub) to (%ub, %lb) step (%step, %step) {
1963 func.func @taskloop(%lb: i32, %ub: i32, %step: i32) {
1964 // expected-error @below {{op nested in loop wrapper is not another loop wrapper or `omp.loop_nest`}}
1966 %0 = arith.constant 0 : i32
1973 func.func @taskloop(%lb: i32, %ub: i32, %step: i32) {
1974 // expected-error @below {{only supported nested wrapper is 'omp.simd'}}
1977 omp.loop_nest (%iv) : i32 = (%lb) to (%ub) step (%step) {
1987 func.func @omp_threadprivate() {
1988 %1 = llvm.mlir.addressof @_QFsubEx : !llvm.ptr
1989 // expected-error @below {{op failed to verify that all of {sym_addr, tls_addr} have same type}}
1990 %2 = omp.threadprivate %1 : !llvm.ptr -> memref<i32>
1996 func.func @omp_target(%map1: memref<?xi32>) {
1997 %mapv = omp.map.info var_ptr(%map1 : memref<?xi32>, tensor<?xi32>) map_clauses(delete) capture(ByRef) -> memref<?xi32> {name = ""}
1998 // expected-error @below {{to, from, tofrom and alloc map types are permitted}}
1999 omp.target map_entries(%mapv -> %arg0: memref<?xi32>) {
2007 func.func @omp_target_data(%map1: memref<?xi32>) {
2008 %mapv = omp.map.info var_ptr(%map1 : memref<?xi32>, tensor<?xi32>) map_clauses(delete) capture(ByRef) -> memref<?xi32> {name = ""}
2009 // expected-error @below {{to, from, tofrom and alloc map types are permitted}}
2010 omp.target_data map_entries(%mapv : memref<?xi32>){}
2016 func.func @omp_target_data() {
2017 // expected-error @below {{At least one of map, use_device_ptr_vars, or use_device_addr_vars operand must be present}}
2024 func.func @omp_target_enter_data(%map1: memref<?xi32>) {
2025 %mapv = omp.map.info var_ptr(%map1 : memref<?xi32>, tensor<?xi32>) map_clauses(from) capture(ByRef) -> memref<?xi32> {name = ""}
2026 // expected-error @below {{to and alloc map types are permitted}}
2027 omp.target_enter_data map_entries(%mapv : memref<?xi32>){}
2033 func.func @omp_target_enter_data_depend(%a: memref<?xi32>) {
2034 %0 = omp.map.info var_ptr(%a: memref<?xi32>, tensor<?xi32>) map_clauses(to) capture(ByRef) -> memref<?xi32>
2035 // expected-error @below {{op expected as many depend values as depend variables}}
2036 omp.target_enter_data map_entries(%0: memref<?xi32> ) {operandSegmentSizes = array<i32: 1, 0, 0, 0>}
2042 func.func @omp_target_exit_data(%map1: memref<?xi32>) {
2043 %mapv = omp.map.info var_ptr(%map1 : memref<?xi32>, tensor<?xi32>) map_clauses(to) capture(ByRef) -> memref<?xi32> {name = ""}
2044 // expected-error @below {{from, release and delete map types are permitted}}
2045 omp.target_exit_data map_entries(%mapv : memref<?xi32>){}
2051 func.func @omp_target_exit_data_depend(%a: memref<?xi32>) {
2052 %0 = omp.map.info var_ptr(%a: memref<?xi32>, tensor<?xi32>) map_clauses(from) capture(ByRef) -> memref<?xi32>
2053 // expected-error @below {{op expected as many depend values as depend variables}}
2054 omp.target_exit_data map_entries(%0: memref<?xi32> ) {operandSegmentSizes = array<i32: 1, 0, 0, 0>}
2060 func.func @omp_target_update_invalid_motion_type(%map1 : memref<?xi32>) {
2061 %mapv = omp.map.info var_ptr(%map1 : memref<?xi32>, tensor<?xi32>) map_clauses(exit_release_or_enter_alloc) capture(ByRef) -> memref<?xi32> {name = ""}
2063 // expected-error @below {{at least one of to or from map types must be specified, other map types are not permitted}}
2064 omp.target_update map_entries(%mapv : memref<?xi32>)
2070 func.func @omp_target_update_invalid_motion_type_2(%map1 : memref<?xi32>) {
2071 %mapv = omp.map.info var_ptr(%map1 : memref<?xi32>, tensor<?xi32>) map_clauses(delete) capture(ByRef) -> memref<?xi32> {name = ""}
2073 // expected-error @below {{at least one of to or from map types must be specified, other map types are not permitted}}
2074 omp.target_update map_entries(%mapv : memref<?xi32>)
2080 func.func @omp_target_update_invalid_motion_modifier(%map1 : memref<?xi32>) {
2081 %mapv = omp.map.info var_ptr(%map1 : memref<?xi32>, tensor<?xi32>) map_clauses(always, to) capture(ByRef) -> memref<?xi32> {name = ""}
2083 // expected-error @below {{present, mapper and iterator map type modifiers are permitted}}
2084 omp.target_update map_entries(%mapv : memref<?xi32>)
2090 func.func @omp_target_update_invalid_motion_modifier_2(%map1 : memref<?xi32>) {
2091 %mapv = omp.map.info var_ptr(%map1 : memref<?xi32>, tensor<?xi32>) map_clauses(close, to) capture(ByRef) -> memref<?xi32> {name = ""}
2093 // expected-error @below {{present, mapper and iterator map type modifiers are permitted}}
2094 omp.target_update map_entries(%mapv : memref<?xi32>)
2100 func.func @omp_target_update_invalid_motion_modifier_3(%map1 : memref<?xi32>) {
2101 %mapv = omp.map.info var_ptr(%map1 : memref<?xi32>, tensor<?xi32>) map_clauses(implicit, to) capture(ByRef) -> memref<?xi32> {name = ""}
2103 // expected-error @below {{present, mapper and iterator map type modifiers are permitted}}
2104 omp.target_update map_entries(%mapv : memref<?xi32>)
2110 func.func @omp_target_update_invalid_motion_modifier_4(%map1 : memref<?xi32>) {
2111 %mapv = omp.map.info var_ptr(%map1 : memref<?xi32>, tensor<?xi32>) map_clauses(implicit, tofrom) capture(ByRef) -> memref<?xi32> {name = ""}
2113 // expected-error @below {{either to or from map types can be specified, not both}}
2114 omp.target_update map_entries(%mapv : memref<?xi32>)
2120 func.func @omp_target_update_invalid_motion_modifier_5(%map1 : memref<?xi32>) {
2121 %mapv = omp.map.info var_ptr(%map1 : memref<?xi32>, tensor<?xi32>) map_clauses(to) capture(ByRef) -> memref<?xi32> {name = ""}
2122 %mapv2 = omp.map.info var_ptr(%map1 : memref<?xi32>, tensor<?xi32>) map_clauses(from) capture(ByRef) -> memref<?xi32> {name = ""}
2124 // expected-error @below {{either to or from map types can be specified, not both}}
2125 omp.target_update map_entries(%mapv, %mapv2 : memref<?xi32>, memref<?xi32>)
2128 llvm.mlir.global internal @_QFsubEx() : i32
2132 func.func @omp_target_update_data_depend(%a: memref<?xi32>) {
2133 %0 = omp.map.info var_ptr(%a: memref<?xi32>, tensor<?xi32>) map_clauses(to) capture(ByRef) -> memref<?xi32>
2134 // expected-error @below {{op expected as many depend values as depend variables}}
2135 omp.target_update map_entries(%0: memref<?xi32> ) {operandSegmentSizes = array<i32: 1, 0, 0, 0>}
2141 func.func @omp_target_depend(%data_var: memref<i32>) {
2142 // expected-error @below {{op expected as many depend values as depend variables}}
2143 "omp.target"(%data_var) ({
2144 "omp.terminator"() : () -> ()
2145 }) {depend_kinds = [], operandSegmentSizes = array<i32: 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0>} : (memref<i32>) -> ()
2146 "func.return"() : () -> ()
2151 func.func @omp_distribute_schedule(%chunk_size : i32, %lb : i32, %ub : i32, %step : i32) -> () {
2152 // expected-error @below {{op chunk size set without dist_schedule_static being present}}
2153 "omp.distribute"(%chunk_size) <{operandSegmentSizes = array<i32: 0, 0, 1, 0>}> ({
2154 omp.loop_nest (%iv) : i32 = (%lb) to (%ub) step (%step) {
2155 "omp.yield"() : () -> ()
2162 func.func @omp_distribute_allocate(%data_var : memref<i32>, %lb : i32, %ub : i32, %step : i32) -> () {
2163 // expected-error @below {{expected equal sizes for allocate and allocator variables}}
2164 "omp.distribute"(%data_var) <{operandSegmentSizes = array<i32: 1, 0, 0, 0>}> ({
2165 omp.loop_nest (%iv) : i32 = (%lb) to (%ub) step (%step) {
2166 "omp.yield"() : () -> ()
2168 }) : (memref<i32>) -> ()
2173 func.func @omp_distribute_nested_wrapper(%lb: index, %ub: index, %step: index) -> () {
2174 // expected-error @below {{an 'omp.wsloop' nested wrapper is only allowed when 'omp.parallel' is the direct parent}}
2177 omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
2178 "omp.yield"() : () -> ()
2180 }) {omp.composite} : () -> ()
2186 func.func @omp_distribute_nested_wrapper2(%lb: index, %ub: index, %step: index) -> () {
2187 // expected-error @below {{only supported nested wrappers are 'omp.simd' and 'omp.wsloop'}}
2190 omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
2191 "omp.yield"() : () -> ()
2199 func.func @omp_distribute_nested_wrapper3(%lb: index, %ub: index, %step: index) -> () {
2200 // expected-error @below {{'omp.composite' attribute missing from composite wrapper}}
2203 omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
2204 "omp.yield"() : () -> ()
2206 }) {omp.composite} : () -> ()
2212 func.func @omp_distribute_order() -> () {
2213 // expected-error @below {{invalid clause value: 'default'}}
2214 omp.distribute order(default) {
2215 omp.loop_nest (%iv) : i32 = (%arg0) to (%arg0) step (%arg0) {
2222 func.func @omp_distribute_reproducible_order() -> () {
2223 // expected-error @below {{invalid clause value: 'default'}}
2224 omp.distribute order(reproducible:default) {
2225 omp.loop_nest (%iv) : i32 = (%arg0) to (%arg0) step (%arg0) {
2232 func.func @omp_distribute_unconstrained_order() -> () {
2233 // expected-error @below {{invalid clause value: 'default'}}
2234 omp.distribute order(unconstrained:default) {
2235 omp.loop_nest (%iv) : i32 = (%arg0) to (%arg0) step (%arg0) {
2242 omp.private {type = private} @x.privatizer : i32 alloc {
2244 %0 = arith.constant 0.0 : f32
2245 // expected-error @below {{Invalid yielded value. Expected type: 'i32', got: 'f32'}}
2251 omp.private {type = private} @x.privatizer : i32 alloc {
2253 // expected-error @below {{Invalid yielded value. Expected type: 'i32', got: None}}
2259 omp.private {type = private} @x.privatizer : f32 alloc {
2261 omp.yield(%arg0 : f32)
2264 // expected-error @below {{Did not expect any values to be yielded.}}
2265 omp.yield(%arg0 : f32)
2270 omp.private {type = private} @x.privatizer : i32 alloc {
2272 // expected-error @below {{expected exit block terminator to be an `omp.yield` op.}}
2278 // expected-error @below {{`alloc`: expected 1 region arguments, got: 2}}
2279 omp.private {type = private} @x.privatizer : f32 alloc {
2280 ^bb0(%arg0: f32, %arg1: f32):
2281 omp.yield(%arg0 : f32)
2286 // expected-error @below {{`copy`: expected 2 region arguments, got: 1}}
2287 omp.private {type = firstprivate} @x.privatizer : f32 alloc {
2289 omp.yield(%arg0 : f32)
2292 omp.yield(%arg0 : f32)
2297 // expected-error @below {{`dealloc`: expected 1 region arguments, got: 2}}
2298 omp.private {type = private} @x.privatizer : f32 alloc {
2300 omp.yield(%arg0 : f32)
2302 ^bb0(%arg0: f32, %arg1: f32):
2308 // expected-error @below {{`private` clauses require only an `alloc` region.}}
2309 omp.private {type = private} @x.privatizer : f32 alloc {
2311 omp.yield(%arg0 : f32)
2313 ^bb0(%arg0: f32, %arg1 : f32):
2314 omp.yield(%arg0 : f32)
2319 // expected-error @below {{`firstprivate` clauses require both `alloc` and `copy` regions.}}
2320 omp.private {type = firstprivate} @x.privatizer : f32 alloc {
2322 omp.yield(%arg0 : f32)
2327 func.func @private_type_mismatch(%arg0: index) {
2328 // expected-error @below {{type mismatch between a private variable and its privatizer op, var type: 'index' vs. privatizer op type: '!llvm.ptr'}}
2329 omp.parallel private(@var1.privatizer %arg0 -> %arg2 : index) {
2336 omp.private {type = private} @var1.privatizer : !llvm.ptr alloc {
2337 ^bb0(%arg0: !llvm.ptr):
2338 omp.yield(%arg0 : !llvm.ptr)
2343 func.func @firstprivate_type_mismatch(%arg0: index) {
2344 // expected-error @below {{type mismatch between a firstprivate variable and its privatizer op, var type: 'index' vs. privatizer op type: '!llvm.ptr'}}
2345 omp.parallel private(@var1.privatizer %arg0 -> %arg2 : index) {
2352 omp.private {type = firstprivate} @var1.privatizer : !llvm.ptr alloc {
2353 ^bb0(%arg0: !llvm.ptr):
2354 omp.yield(%arg0 : !llvm.ptr)
2356 ^bb0(%arg0: !llvm.ptr, %arg1: !llvm.ptr):
2357 omp.yield(%arg0 : !llvm.ptr)
2362 func.func @undefined_privatizer(%arg0: index) {
2363 // expected-error @below {{failed to lookup privatizer op with symbol: '@var1.privatizer'}}
2364 omp.parallel private(@var1.privatizer %arg0 -> %arg2 : index) {
2372 func.func @undefined_privatizer(%arg0: !llvm.ptr) {
2373 // expected-error @below {{inconsistent number of private variables and privatizer op symbols, private vars: 1 vs. privatizer op symbols: 2}}
2374 "omp.parallel"(%arg0) <{operandSegmentSizes = array<i32: 0, 0, 0, 0, 1, 0>, private_syms = [@x.privatizer, @y.privatizer]}> ({
2375 ^bb0(%arg2: !llvm.ptr):
2377 }) : (!llvm.ptr) -> ()
2383 omp.private {type = private} @var1.privatizer : !llvm.ptr alloc {
2384 ^bb0(%arg0: !llvm.ptr):
2385 omp.yield(%arg0 : !llvm.ptr)
2387 ^bb0(%arg0: !llvm.ptr, %arg1: !llvm.ptr):
2388 omp.yield(%arg0 : !llvm.ptr)
2391 func.func @byref_in_private(%arg0: index) {
2392 // expected-error @below {{expected attribute value}}
2393 // expected-error @below {{custom op 'omp.parallel' invalid `private` format}}
2394 omp.parallel private(byref @var1.privatizer %arg0 -> %arg2 : index) {
2402 func.func @masked_arg_type_mismatch(%arg0: f32) {
2403 // expected-error @below {{'omp.masked' op operand #0 must be integer or index, but got 'f32'}}
2404 "omp.masked"(%arg0) ({
2411 func.func @masked_arg_count_mismatch(%arg0: i32, %arg1: i32) {
2412 // expected-error @below {{'omp.masked' op operand group starting at #0 requires 0 or 1 element, but found 2}}
2413 "omp.masked"(%arg0, %arg1) ({
2415 }) : (i32, i32) -> ()
2420 func.func @omp_parallel_missing_composite(%lb: index, %ub: index, %step: index) -> () {
2421 // expected-error@+1 {{'omp.composite' attribute missing from composite operation}}
2425 omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
2436 func.func @omp_parallel_invalid_composite(%lb: index, %ub: index, %step: index) -> () {
2437 // expected-error @below {{'omp.composite' attribute present in non-composite operation}}
2440 omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
2450 func.func @omp_parallel_invalid_composite2(%lb: index, %ub: index, %step: index) -> () {
2451 // expected-error @below {{unexpected OpenMP operation inside of composite 'omp.parallel'}}
2456 omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
2467 func.func @omp_wsloop_missing_composite(%lb: index, %ub: index, %step: index) -> () {
2468 // expected-error @below {{'omp.composite' attribute missing from composite wrapper}}
2471 omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
2480 func.func @omp_wsloop_invalid_composite(%lb: index, %ub: index, %step: index) -> () {
2481 // expected-error @below {{'omp.composite' attribute present in non-composite wrapper}}
2483 omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
2491 func.func @omp_wsloop_missing_composite_2(%lb: index, %ub: index, %step: index) -> () {
2494 // expected-error @below {{'omp.composite' attribute missing from composite wrapper}}
2496 omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
2507 func.func @omp_simd_missing_composite(%lb: index, %ub: index, %step: index) -> () {
2509 // expected-error @below {{'omp.composite' attribute missing from composite wrapper}}
2511 omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
2520 func.func @omp_simd_invalid_composite(%lb: index, %ub: index, %step: index) -> () {
2521 // expected-error @below {{'omp.composite' attribute present in non-composite wrapper}}
2523 omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
2531 func.func @omp_distribute_missing_composite(%lb: index, %ub: index, %step: index) -> () {
2533 // expected-error @below {{'omp.composite' attribute missing from composite wrapper}}
2536 omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
2547 func.func @omp_distribute_invalid_composite(%lb: index, %ub: index, %step: index) -> () {
2548 // expected-error @below {{'omp.composite' attribute present in non-composite wrapper}}
2550 omp.loop_nest (%0) : index = (%lb) to (%ub) step (%step) {
2558 func.func @omp_taskloop_missing_composite(%lb: index, %ub: index, %step: index) -> () {
2559 // expected-error @below {{'omp.composite' attribute missing from composite wrapper}}
2562 omp.loop_nest (%i) : index = (%lb) to (%ub) step (%step) {
2571 func.func @omp_taskloop_invalid_composite(%lb: index, %ub: index, %step: index) -> () {
2572 // expected-error @below {{'omp.composite' attribute present in non-composite wrapper}}
2574 omp.loop_nest (%i) : index = (%lb) to (%ub) step (%step) {
2583 func.func @omp_loop_invalid_nesting(%lb : index, %ub : index, %step : index) {
2585 // expected-error @below {{`omp.loop` expected to be a standalone loop wrapper}}
2588 omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
2599 func.func @omp_loop_invalid_nesting2(%lb : index, %ub : index, %step : index) {
2602 // expected-error @below {{`omp.loop` expected to be a standalone loop wrapper}}
2604 omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
2615 func.func @omp_loop_invalid_binding(%lb : index, %ub : index, %step : index) {
2617 // expected-error @below {{custom op 'omp.loop' invalid clause value: 'dummy_value'}}
2618 omp.loop bind(dummy_value) {
2619 omp.loop_nest (%iv) : index = (%lb) to (%ub) step (%step) {
2627 func.func @nested_wrapper(%idx : index) {
2629 // expected-error @below {{cannot be composite}}
2630 omp.workshare.loop_wrapper {
2632 omp.loop_nest (%iv) : index = (%idx) to (%idx) step (%idx) {
2643 func.func @not_wrapper() {
2645 // expected-error @below {{op nested in loop wrapper is not another loop wrapper or `omp.loop_nest`}}
2646 omp.workshare.loop_wrapper {
2647 %0 = arith.constant 0 : index
2655 func.func @missing_workshare(%idx : index) {
2656 // expected-error @below {{must be nested in an omp.workshare}}
2657 omp.workshare.loop_wrapper {
2658 omp.loop_nest (%iv) : index = (%idx) to (%idx) step (%idx) {