@@ -2391,7 +2391,7 @@ func.func @omp_distribute_allocate(%data_var : memref<i32>, %lb : i32, %ub : i32
23912391// -----
23922392
23932393func.func @omp_distribute_nested_wrapper (%lb: index , %ub: index , %step: index ) -> () {
2394- // expected-error @below {{an 'omp.wsloop' nested wrapper is only allowed when 'omp.parallel' is the direct parent}}
2394+ // expected-error @below {{an 'omp.wsloop' nested wrapper is only allowed when a composite 'omp.parallel' is the direct parent}}
23952395 omp.distribute {
23962396 " omp.wsloop" () ({
23972397 omp.loop_nest (%iv ) : index = (%lb ) to (%ub ) step (%step ) {
@@ -2429,6 +2429,22 @@ func.func @omp_distribute_nested_wrapper3(%lb: index, %ub: index, %step: index)
24292429
24302430// -----
24312431
2432+ func.func @omp_distribute_nested_wrapper4 (%lb: index , %ub: index , %step: index ) -> () {
2433+ omp.parallel {
2434+ // expected-error @below {{an 'omp.wsloop' nested wrapper is only allowed when a composite 'omp.parallel' is the direct parent}}
2435+ omp.distribute {
2436+ " omp.wsloop" () ({
2437+ omp.loop_nest (%iv ) : index = (%lb ) to (%ub ) step (%step ) {
2438+ " omp.yield" () : () -> ()
2439+ }
2440+ }) {omp.composite } : () -> ()
2441+ } {omp.composite }
2442+ omp.terminator
2443+ }
2444+ }
2445+
2446+ // -----
2447+
24322448func.func @omp_distribute_order () -> () {
24332449// expected-error @below {{invalid clause value: 'default'}}
24342450 omp.distribute order (default ) {
@@ -2623,15 +2639,13 @@ func.func @masked_arg_count_mismatch(%arg0: i32, %arg1: i32) {
26232639
26242640// -----
26252641func.func @omp_parallel_missing_composite (%lb: index , %ub: index , %step: index ) -> () {
2626- // expected-error@+1 {{'omp.composite' attribute missing from composite operation}}
2642+ // expected-error @below {{'omp.composite' attribute missing from composite operation}}
26272643 omp.parallel {
26282644 omp.distribute {
2629- omp.wsloop {
2630- omp.loop_nest (%iv ) : index = (%lb ) to (%ub ) step (%step ) {
2631- omp.yield
2632- }
2633- } {omp.composite }
2634- } {omp.composite }
2645+ omp.loop_nest (%iv ) : index = (%lb ) to (%ub ) step (%step ) {
2646+ omp.yield
2647+ }
2648+ }
26352649 omp.terminator
26362650 }
26372651 return
@@ -2653,7 +2667,7 @@ func.func @omp_parallel_invalid_composite(%lb: index, %ub: index, %step: index)
26532667
26542668// -----
26552669func.func @omp_parallel_invalid_composite2 (%lb: index , %ub: index , %step: index ) -> () {
2656- // expected-error @below {{unexpected OpenMP operation inside of composite 'omp.parallel'}}
2670+ // expected-error @below {{unexpected OpenMP operation inside of composite 'omp.parallel': omp.barrier }}
26572671 omp.parallel {
26582672 omp.barrier
26592673 omp.distribute {
@@ -2668,6 +2682,29 @@ func.func @omp_parallel_invalid_composite2(%lb: index, %ub: index, %step: index)
26682682 return
26692683}
26702684
2685+ // -----
2686+ func.func @omp_parallel_invalid_composite3 (%lb: index , %ub: index , %step: index ) -> () {
2687+ // expected-error @below {{multiple 'omp.distribute' nested inside of 'omp.parallel'}}
2688+ omp.parallel {
2689+ omp.distribute {
2690+ omp.wsloop {
2691+ omp.loop_nest (%iv ) : index = (%lb ) to (%ub ) step (%step ) {
2692+ omp.yield
2693+ }
2694+ } {omp.composite }
2695+ } {omp.composite }
2696+ omp.distribute {
2697+ omp.wsloop {
2698+ omp.loop_nest (%iv ) : index = (%lb ) to (%ub ) step (%step ) {
2699+ omp.yield
2700+ }
2701+ } {omp.composite }
2702+ } {omp.composite }
2703+ omp.terminator
2704+ } {omp.composite }
2705+ return
2706+ }
2707+
26712708// -----
26722709func.func @omp_wsloop_missing_composite (%lb: index , %ub: index , %step: index ) -> () {
26732710 // expected-error @below {{'omp.composite' attribute missing from composite wrapper}}
@@ -2787,7 +2824,7 @@ func.func @omp_taskloop_invalid_composite(%lb: index, %ub: index, %step: index)
27872824
27882825func.func @omp_loop_invalid_nesting (%lb : index , %ub : index , %step : index ) {
27892826
2790- // expected-error @below {{` omp.loop` expected to be a standalone loop wrapper}}
2827+ // expected-error @below {{' omp.loop' op expected to be a standalone loop wrapper}}
27912828 omp.loop {
27922829 omp.simd {
27932830 omp.loop_nest (%iv ) : index = (%lb ) to (%ub ) step (%step ) {
@@ -2804,7 +2841,7 @@ func.func @omp_loop_invalid_nesting(%lb : index, %ub : index, %step : index) {
28042841func.func @omp_loop_invalid_nesting2 (%lb : index , %ub : index , %step : index ) {
28052842
28062843 omp.simd {
2807- // expected-error @below {{` omp.loop` expected to be a standalone loop wrapper}}
2844+ // expected-error @below {{' omp.loop' op expected to be a standalone loop wrapper}}
28082845 omp.loop {
28092846 omp.loop_nest (%iv ) : index = (%lb ) to (%ub ) step (%step ) {
28102847 omp.yield
@@ -2831,7 +2868,7 @@ func.func @omp_loop_invalid_binding(%lb : index, %ub : index, %step : index) {
28312868// -----
28322869func.func @nested_wrapper (%idx : index ) {
28332870 omp.workshare {
2834- // expected-error @below {{cannot be composite }}
2871+ // expected-error @below {{'omp.workshare.loop_wrapper' op expected to be a standalone loop wrapper }}
28352872 omp.workshare.loop_wrapper {
28362873 omp.simd {
28372874 omp.loop_nest (%iv ) : index = (%idx ) to (%idx ) step (%idx ) {
0 commit comments