diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2022-01-05 20:05:11 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2022-01-11 16:30:08 +0100 |
| commit | 2cfe62f82077ba012aef55db5288985bc0c426d9 (patch) | |
| tree | 501d83deb358a230d157c9d7efc6fc393e239472 /pkg/compiler/testdata | |
| parent | 16e21d13ea26a631e9b3a30c94635b1d565fd78f (diff) | |
pkg/compiler: add out_overlay field attribute
Diffstat (limited to 'pkg/compiler/testdata')
| -rw-r--r-- | pkg/compiler/testdata/all.txt | 9 | ||||
| -rw-r--r-- | pkg/compiler/testdata/errors.txt | 21 | ||||
| -rw-r--r-- | pkg/compiler/testdata/errors2.txt | 12 |
3 files changed, 41 insertions, 1 deletions
diff --git a/pkg/compiler/testdata/all.txt b/pkg/compiler/testdata/all.txt index b1adf2321..c9a02f592 100644 --- a/pkg/compiler/testdata/all.txt +++ b/pkg/compiler/testdata/all.txt @@ -287,7 +287,14 @@ s5 { f_inout1 int32[0:1] (inout) } -foo_s0(a ptr[in, s0], b ptr[in, s1], c ptr[in, s2], d ptr[in, s4], e ptr[in, s5]) +s6 { + f0 int32 + f1 r0 + f2 int32 (out_overlay) + f3 r0 +} + +foo_s0(a ptr[in, s0], b ptr[in, s1], c ptr[in, s2], d ptr[in, s4], e ptr[in, s5], f ptr[in, s6]) # Unions. diff --git a/pkg/compiler/testdata/errors.txt b/pkg/compiler/testdata/errors.txt index 65eaf8a97..6cc2e2b0f 100644 --- a/pkg/compiler/testdata/errors.txt +++ b/pkg/compiler/testdata/errors.txt @@ -391,3 +391,24 @@ struct$perfielddir { f5 int32 (out, inout) ### arg/field has multiple direction attributes f6 int32 (in, out, inout) ### arg/field has multiple direction attributes } + +struct$overlay0 { + f0 int32 (out_overlay) ### out_overlay attribute must not be specified on the first field + f1 int32 (out_overlay) ### multiple out_overlay attributes +} + +struct$overlay1 { + f0 int32 + f1 int32 (out_overlay, out_overlay) ### duplicate arg/field f1 attribute out_overlay + f2 int32 (out_overlay) ### multiple out_overlay attributes +} + +struct$overlay2 { + f0 int32 (in) + f1 int32 (out_overlay) ### mix of direction and out_overlay attributes is not supported +} + +union$overlay0 [ + f0 int32 + f1 int32 (out_overlay) ### unknown arg/field f1 attribute out_overlay +] diff --git a/pkg/compiler/testdata/errors2.txt b/pkg/compiler/testdata/errors2.txt index 111db587f..e5a51b4a9 100644 --- a/pkg/compiler/testdata/errors2.txt +++ b/pkg/compiler/testdata/errors2.txt @@ -386,3 +386,15 @@ s405 { f3 int64:16[-65541:-10] ### int range [18446744073709486075:18446744073709551606] is too large for base type of size 16 f4 int16:8[-255:0] ### int range [18446744073709551361:0] is too large for base type of size 8 } + +# Field attributes. + +foo$overlay(a ptr[in, struct$overlay0]) + +struct$overlay0 { + f0 int32 + f1 const[0, int32] (out_overlay) ### const type must not be used as output + f2 ptr[in, int32] ### ptr type must not be used as output + f3 proc[0, 1, int32] ### proc type must not be used as output + f4 bytesize[f1, int32] ### bytesize type must not be used as output +} |
