1 // RUN: mlir-opt -split-input-file -convert-arith-to-emitc -verify-diagnostics %s
3 func.func @arith_cast_tensor(%arg0: tensor<5xf32>) -> tensor<5xi32> {
4 // expected-error @+1 {{failed to legalize operation 'arith.fptosi'}}
5 %t = arith.fptosi %arg0 : tensor<5xf32> to tensor<5xi32>
6 return %t: tensor<5xi32>
11 func.func @arith_cast_vector(%arg0: vector<5xf32>) -> vector<5xi32> {
12 // expected-error @+1 {{failed to legalize operation 'arith.fptosi'}}
13 %t = arith.fptosi %arg0 : vector<5xf32> to vector<5xi32>
14 return %t: vector<5xi32>
18 func.func @arith_cast_f80(%arg0: f80) -> i32 {
19 // expected-error @+1 {{failed to legalize operation 'arith.fptosi'}}
20 %t = arith.fptosi %arg0 : f80 to i32
26 func.func @arith_cast_f128(%arg0: f128) -> i32 {
27 // expected-error @+1 {{failed to legalize operation 'arith.fptosi'}}
28 %t = arith.fptosi %arg0 : f128 to i32
35 func.func @arith_cast_to_f80(%arg0: i32) -> f80 {
36 // expected-error @+1 {{failed to legalize operation 'arith.sitofp'}}
37 %t = arith.sitofp %arg0 : i32 to f80
43 func.func @arith_cast_to_f128(%arg0: i32) -> f128 {
44 // expected-error @+1 {{failed to legalize operation 'arith.sitofp'}}
45 %t = arith.sitofp %arg0 : i32 to f128
51 func.func @arith_cast_fptosi_i1(%arg0: f32) -> i1 {
52 // expected-error @+1 {{failed to legalize operation 'arith.fptosi'}}
53 %t = arith.fptosi %arg0 : f32 to i1
59 func.func @arith_cast_fptoui_i1(%arg0: f32) -> i1 {
60 // expected-error @+1 {{failed to legalize operation 'arith.fptoui'}}
61 %t = arith.fptoui %arg0 : f32 to i1
67 func.func @arith_cmpf_vector(%arg0: vector<5xf32>, %arg1: vector<5xf32>) -> vector<5xi1> {
68 // expected-error @+1 {{failed to legalize operation 'arith.cmpf'}}
69 %t = arith.cmpf uno, %arg0, %arg1 : vector<5xf32>
70 return %t: vector<5xi1>
75 func.func @arith_cmpf_tensor(%arg0: tensor<5xf32>, %arg1: tensor<5xf32>) -> tensor<5xi1> {
76 // expected-error @+1 {{failed to legalize operation 'arith.cmpf'}}
77 %t = arith.cmpf uno, %arg0, %arg1 : tensor<5xf32>
78 return %t: tensor<5xi1>
83 func.func @arith_negf_f80(%arg0: f80) -> f80 {
84 // expected-error @+1 {{failed to legalize operation 'arith.negf'}}
85 %n = arith.negf %arg0 : f80
91 func.func @arith_negf_tensor(%arg0: tensor<5xf32>) -> tensor<5xf32> {
92 // expected-error @+1 {{failed to legalize operation 'arith.negf'}}
93 %n = arith.negf %arg0 : tensor<5xf32>
94 return %n: tensor<5xf32>
99 func.func @arith_negf_vector(%arg0: vector<5xf32>) -> vector<5xf32> {
100 // expected-error @+1 {{failed to legalize operation 'arith.negf'}}
101 %n = arith.negf %arg0 : vector<5xf32>
102 return %n: vector<5xf32>
107 func.func @arith_extsi_i1_to_i32(%arg0: i1) {
108 // expected-error @+1 {{failed to legalize operation 'arith.extsi'}}
109 %idx = arith.extsi %arg0 : i1 to i32
115 func.func @arith_shli_i1(%arg0: i1, %arg1: i1) {
116 // expected-error @+1 {{failed to legalize operation 'arith.shli'}}
117 %shli = arith.shli %arg0, %arg1 : i1
123 func.func @arith_shrsi_i1(%arg0: i1, %arg1: i1) {
124 // expected-error @+1 {{failed to legalize operation 'arith.shrsi'}}
125 %shrsi = arith.shrsi %arg0, %arg1 : i1
131 func.func @arith_shrui_i1(%arg0: i1, %arg1: i1) {
132 // expected-error @+1 {{failed to legalize operation 'arith.shrui'}}
133 %shrui = arith.shrui %arg0, %arg1 : i1
139 func.func @arith_divui_vector(%arg0: vector<5xi32>, %arg1: vector<5xi32>) -> vector<5xi32> {
140 // expected-error @+1 {{failed to legalize operation 'arith.divui'}}
141 %divui = arith.divui %arg0, %arg1 : vector<5xi32>
142 return %divui: vector<5xi32>
147 func.func @arith_remui_vector(%arg0: vector<5xi32>, %arg1: vector<5xi32>) -> vector<5xi32> {
148 // expected-error @+1 {{failed to legalize operation 'arith.remui'}}
149 %divui = arith.remui %arg0, %arg1 : vector<5xi32>
150 return %divui: vector<5xi32>