File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -1902,6 +1902,10 @@ LogicalResult AffineForOp::verifyRegions() {
19021902 if (failed (verifyDimAndSymbolIdentifiers (*this , getUpperBoundOperands (),
19031903 getUpperBoundMap ().getNumDims ())))
19041904 return failure ();
1905+ if (getLowerBoundMap ().getNumResults () < 1 )
1906+ return emitOpError (" expected lower bound map to have at least one result" );
1907+ if (getUpperBoundMap ().getNumResults () < 1 )
1908+ return emitOpError (" expected upper bound map to have at least one result" );
19051909
19061910 unsigned opNumResults = getNumResults ();
19071911 if (opNumResults == 0 )
Original file line number Diff line number Diff line change @@ -541,3 +541,25 @@ func.func @dynamic_dimension_index() {
541541 }) : () -> ()
542542 return
543543}
544+
545+ // -----
546+
547+ #map = affine_map <() -> ()>
548+ #map1 = affine_map <() -> (1 )>
549+ func.func @no_lower_bound () {
550+ // expected-error@+1 {{'affine.for' op expected lower bound map to have at least one result}}
551+ affine.for %i = max #map () to min #map1 () {
552+ }
553+ return
554+ }
555+
556+ // -----
557+
558+ #map = affine_map <() -> ()>
559+ #map1 = affine_map <() -> (1 )>
560+ func.func @no_upper_bound () {
561+ // expected-error@+1 {{'affine.for' op expected upper bound map to have at least one result}}
562+ affine.for %i = max #map1 () to min #map () {
563+ }
564+ return
565+ }
You can’t perform that action at this time.
0 commit comments