aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/compiler/testdata
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/compiler/testdata')
-rw-r--r--pkg/compiler/testdata/all.txt13
-rw-r--r--pkg/compiler/testdata/errors.txt12
2 files changed, 25 insertions, 0 deletions
diff --git a/pkg/compiler/testdata/all.txt b/pkg/compiler/testdata/all.txt
index a5a097de3..573fb6412 100644
--- a/pkg/compiler/testdata/all.txt
+++ b/pkg/compiler/testdata/all.txt
@@ -213,3 +213,16 @@ u0 [
]
foo$u0(a ptr[in, u0])
+
+# fmt
+
+foo$fmt0(a ptr[in, fmt[dec, int32[1:10]]])
+foo$fmt1(a ptr[in, fmt[hex, flags[int_flags]]])
+foo$fmt2(a ptr[in, fmt[oct, len[b]]], b ptr[in, array[int8]])
+foo$fmt3(a ptr[in, fmt[dec, proc[10, 20]]])
+foo$fmt4(a ptr[in, fmt[dec, r0]])
+foo$fmt5(a ptr[in, struct$fmt0])
+
+struct$fmt0 {
+ f0 fmt[dec, int8]
+}
diff --git a/pkg/compiler/testdata/errors.txt b/pkg/compiler/testdata/errors.txt
index 750916a83..cbfebbfd7 100644
--- a/pkg/compiler/testdata/errors.txt
+++ b/pkg/compiler/testdata/errors.txt
@@ -318,3 +318,15 @@ foo$203(a type0[42]) ### type type0 is not a template
foo$204(a ptr[in, templ_struct0[42, int8]])
foo$205(a ptr[in, templ_struct0[int8, int8]])
foo$207(a ptr[in, templ_struct2[1]])
+
+# fmt
+
+foo$fmt0(a fmt) ### wrong number of arguments for type fmt, expect format, value
+foo$fmt1(a fmt[dec, int8]) ### fmt can't be syscall argument
+foo$fmt2(a ptr[in, fmt[dec, ptr[in, int8]]]) ### bad fmt value ptr, expect an integer
+foo$fmt3(a ptr[in, fmt[foo, int8]]) ### unexpected value foo for format argument of fmt type, expect [dec hex oct]
+foo$fmt4(a ptr[in, fmt[dec, int8:3]]) ### unexpected ':', only struct fields can be bitfields
+
+struct$fmt0 {
+ f0 fmt[dec, int8:3] ### unexpected ':', only struct fields can be bitfields
+}