@@ -455,11 +455,23 @@ func.func @map_input_output_shape_mismatch(
455
455
456
456
// -----
457
457
458
- func.func @map_no_operands (
458
+ func.func @map_no_operands1 () {
459
+ // expected-error @+1 {{'linalg.map' op requires one region}}
460
+ linalg.map { arith.addf }
461
+ }
462
+
463
+ // -----
464
+
465
+ func.func @map_no_operands2 () {
466
+ // expected-error @+1 {{'linalg.map' op requires one region}}
467
+ " linalg.map" () : () -> ()
468
+ }
469
+
470
+ // -----
471
+
472
+ func.func @map_no_operands3 (
459
473
%lhs: tensor <64 xf32 >, %rhs: tensor <64 xf32 >, %init: tensor <64 xf32 >)
460
474
-> tensor <64 xf32 > {
461
- // This must not crash the parser.
462
- linalg.map { arith.addf }
463
475
// expected-error @+1 {{cannot name an operation with no results}}
464
476
%add = linalg.map { arith.addf }
465
477
func.return %add : tensor <64 xf32 >
@@ -688,9 +700,23 @@ func.func @transpose_input_init_rank_mismatch(%input: tensor<16x32xf32>,
688
700
689
701
// -----
690
702
691
- func.func @transpose_no_operands () -> tensor < 32 x 64 x 16 x f32 > {
692
- // This must not crash the parser.
703
+ func.func @transpose_no_operands1 () {
704
+ // expected-error @+1 {{'linalg.transpose' op expected 2 operands, but found 0}}
693
705
linalg.transpose permutation = [1 , 0 , 2 ]
706
+ }
707
+
708
+ // -----
709
+
710
+ func.func @transpose_no_operands2 () {
711
+ // expected-error @+1 {{'linalg.transpose' op expected 2 operands, but found 0}}
712
+ " linalg.transpose" () <{permutation = array<i64 : 1 , 0 , 2 >}> ({
713
+ ^bb0 :
714
+ }) : () -> ()
715
+ }
716
+
717
+ // -----
718
+
719
+ func.func @transpose_no_operands3 () -> tensor <32 x64 x16 xf32 > {
694
720
// expected-error @+1 {{cannot name an operation with no results}}
695
721
%transpose = linalg.transpose permutation = [1 , 0 , 2 ]
696
722
func.return %transpose : tensor <32 x64 x16 xf32 >
@@ -747,11 +773,27 @@ func.func @broadcast_size_1_extension_not_supported(
747
773
dimensions = [1 ]
748
774
func.return %bcast : tensor <4 x?x16 xf32 >
749
775
}
776
+
750
777
// -----
751
778
752
- func.func @broadcast_no_operands ()
753
- -> tensor < 4 x?x 16 x f32 > {
779
+ func.func @broadcast_no_operands1 () {
780
+ // expected-error @+1 {{'linalg.broadcast' op expected 2 operands, but found 0}}
754
781
linalg.broadcast dimensions = [1 ]
782
+ }
783
+
784
+ // -----
785
+
786
+ func.func @broadcast_no_operands2 () {
787
+ // expected-error @+1 {{'linalg.broadcast' op expected 2 operands, but found 0}}
788
+ " linalg.broadcast" () <{dimensions = array<i64 : 1 >}> ({
789
+ ^bb0 :
790
+ }) : () -> ()
791
+ }
792
+
793
+ // -----
794
+
795
+ func.func @broadcast_no_operands3 ()
796
+ -> tensor <4 x?x16 xf32 > {
755
797
// expected-error @+1 {{cannot name an operation with no results}}
756
798
%broadcast = linalg.broadcast dimensions = [1 ]
757
799
func.return %broadcast : tensor <32 x64 x16 xf32 >
0 commit comments