File tree Expand file tree Collapse file tree 4 files changed +7
-11
lines changed Expand file tree Collapse file tree 4 files changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ The following convention is followed:
1616 floating types.
1717* If ` __bf16 ` is used, the code requires a compiler that supports it, such as
1818 GCC or Clang.
19+ * If ` emitc.array ` with a dimension of size zero is used, then the code
20+ requires [ a GCC extension] ( https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html ) .
1921* Else the generated code is compatible with C99.
2022
2123These restrictions are neither inherent to the EmitC dialect itself nor to the
Original file line number Diff line number Diff line change @@ -971,8 +971,8 @@ LogicalResult emitc::ArrayType::verify(
971971 return emitError () << " shape must not be empty" ;
972972
973973 for (int64_t dim : shape) {
974- if (dim <= 0 )
975- return emitError () << " dimensions must have positive size" ;
974+ if (dim < 0 )
975+ return emitError () << " dimensions must have non-negative size" ;
976976 }
977977
978978 if (!elementType)
Original file line number Diff line number Diff line change @@ -36,14 +36,6 @@ func.func @illegal_array_missing_x(
3636
3737// -----
3838
39- func.func @illegal_array_non_positive_dimenson (
40- // expected-error @+1 {{dimensions must have positive size}}
41- %arg0: !emitc.array <0xi32 >
42- ) {
43- }
44-
45- // -----
46-
4739func.func @illegal_array_missing_type (
4840 // expected-error @+1 {{expected non-function type}}
4941 %arg0: !emitc.array <10 x>
Original file line number Diff line number Diff line change @@ -17,7 +17,9 @@ func.func @array_types(
1717 // CHECK-SAME: !emitc.array<30x!emitc.ssize_t>
1818 %arg5: !emitc.array <30 x!emitc.ssize_t >,
1919 // CHECK-SAME: !emitc.array<30x!emitc.ptrdiff_t>
20- %arg6: !emitc.array <30 x!emitc.ptrdiff_t >
20+ %arg6: !emitc.array <30 x!emitc.ptrdiff_t >,
21+ // CHECK-SAME: !emitc.array<0xi64>
22+ %arg7: !emitc.array <0xi64 >
2123) {
2224 return
2325}
You can’t perform that action at this time.
0 commit comments