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:
16
16
floating types.
17
17
* If ` __bf16 ` is used, the code requires a compiler that supports it, such as
18
18
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 ) .
19
21
* Else the generated code is compatible with C99.
20
22
21
23
These 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(
971
971
return emitError () << " shape must not be empty" ;
972
972
973
973
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" ;
976
976
}
977
977
978
978
if (!elementType)
Original file line number Diff line number Diff line change @@ -36,14 +36,6 @@ func.func @illegal_array_missing_x(
36
36
37
37
// -----
38
38
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
-
47
39
func.func @illegal_array_missing_type (
48
40
// expected-error @+1 {{expected non-function type}}
49
41
%arg0: !emitc.array <10 x>
Original file line number Diff line number Diff line change @@ -17,7 +17,9 @@ func.func @array_types(
17
17
// CHECK-SAME: !emitc.array<30x!emitc.ssize_t>
18
18
%arg5: !emitc.array <30 x!emitc.ssize_t >,
19
19
// 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 >
21
23
) {
22
24
return
23
25
}
You can’t perform that action at this time.
0 commit comments