aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/compiler/testdata
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2019-05-14 16:21:19 +0200
committerDmitry Vyukov <dvyukov@google.com>2019-05-14 19:28:01 +0200
commit2376f0f937b8e6b457ef1fdf088b8b7059dcb0e2 (patch)
tree6a66d085190a488475a843ec8a138fd6a3c8e8a1 /pkg/compiler/testdata
parent9a4969814ea6a65b306ca7d3192c23381c778ad4 (diff)
pkg/compiler: allow to refer to syscall arguments in len paths
This allows to use len[syscall:arg] expressions.
Diffstat (limited to 'pkg/compiler/testdata')
-rw-r--r--pkg/compiler/testdata/all.txt3
-rw-r--r--pkg/compiler/testdata/errors2.txt2
2 files changed, 4 insertions, 1 deletions
diff --git a/pkg/compiler/testdata/all.txt b/pkg/compiler/testdata/all.txt
index 7acb47743..25461ff9a 100644
--- a/pkg/compiler/testdata/all.txt
+++ b/pkg/compiler/testdata/all.txt
@@ -72,6 +72,7 @@ foo$len_var1(a ptr[in, array[string]], b ptr[in, len[a, int32]])
len_expr1 {
f11 len_expr2
+ f12 bytesize[syscall:b, int32]
}
len_expr2 {
@@ -95,7 +96,7 @@ len_expr4 {
f41 int32
}
-foo$len_expr(a ptr[in, len_expr1])
+foo$len_expr(a ptr[in, len_expr1], b ptr[in, array[int8, 3]])
# Pointer type.
diff --git a/pkg/compiler/testdata/errors2.txt b/pkg/compiler/testdata/errors2.txt
index 6b7737ef5..311be3ea9 100644
--- a/pkg/compiler/testdata/errors2.txt
+++ b/pkg/compiler/testdata/errors2.txt
@@ -145,6 +145,8 @@ slen1 {
f3 len[f0:parent, int32] ### parent can't be part of path expressions
f4 len[slen2:f, int32] ### len path slen2 does not refer to a struct
f5 len[slen22:f, int32] ### len path slen22 does not refer to a struct
+ f6 len[syscall, int32] ### no argument name after syscall reference
+ f7 len[syscall:b, int32] ### len target b does not exist
slen2 ptr[in, array[slen2]]
slen21 slen2
slen22 array[slen2]