aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/compiler/testdata
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/compiler/testdata')
-rw-r--r--pkg/compiler/testdata/all.txt9
-rw-r--r--pkg/compiler/testdata/errors.txt21
-rw-r--r--pkg/compiler/testdata/errors2.txt12
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
+}