aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/compiler/testdata
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2018-01-18 18:48:39 +0100
committerDmitry Vyukov <dvyukov@google.com>2018-01-18 18:48:39 +0100
commit3661e26e7422758a1a204e69960d9c982c041805 (patch)
tree39cd9fe2feda79ff123cfe94de5aa2bd7215ff1a /pkg/compiler/testdata
parentc77c36d5fa3df46f2dd71417e42ee9ee1e595dc9 (diff)
pkg/compiler: support non-zero-terminated strings
Add stringnoz type.
Diffstat (limited to 'pkg/compiler/testdata')
-rw-r--r--pkg/compiler/testdata/all.txt11
-rw-r--r--pkg/compiler/testdata/errors.txt6
2 files changed, 15 insertions, 2 deletions
diff --git a/pkg/compiler/testdata/all.txt b/pkg/compiler/testdata/all.txt
index 9c557be0f..ad04364b0 100644
--- a/pkg/compiler/testdata/all.txt
+++ b/pkg/compiler/testdata/all.txt
@@ -5,6 +5,17 @@ foo$0(a int8)
foo$1(a int8[C1:C2])
foo$2() ptr[out, array[int32]]
+strings {
+ f1 string
+ f2 string["foo"]
+ f3 string["foo", 10]
+ f4 string[string_flags, 10]
+ f5 stringnoz
+ f6 stringnoz["foo"]
+} [packed]
+
+string_flags = "foo", "barbaz"
+
# Proc type.
proc_struct1 {
diff --git a/pkg/compiler/testdata/errors.txt b/pkg/compiler/testdata/errors.txt
index 26c29c4e0..6a9bcbae3 100644
--- a/pkg/compiler/testdata/errors.txt
+++ b/pkg/compiler/testdata/errors.txt
@@ -111,6 +111,8 @@ foo$53(a proc[20, 10, opt])
foo$54(a ptr[in, string["foo", C1]])
foo$55(a int8[opt[int8]]) ### opt can't have arguments
foo$56(a void) ### void can't be syscall argument
+foo$57(a ptr[in, stringnoz["foo", 10]]) ### fixed-size string can't be non-zero-terminated
+foo$58(a ptr[in, stringnoz[sf2, 10]]) ### fixed-size string can't be non-zero-terminated
opt { ### struct uses reserved name opt
f1 int32
@@ -188,8 +190,8 @@ typestruct {
}
type type0 int8
-type type0 int8 ### type type0 redeclared, previously declared as type alias at errors.txt:190:6
-resource type0[int32] ### type type0 redeclared, previously declared as type alias at errors.txt:190:6
+type type0 int8 ### type type0 redeclared, previously declared as type alias at errors.txt:192:6
+resource type0[int32] ### type type0 redeclared, previously declared as type alias at errors.txt:192:6
type0 = 0, 1
type type1 type1 ### type instantiation loop: type1 -> type1
type type2 int8:4 ### unexpected ':', only struct fields can be bitfields