From a339951e5f3c045290340330bcea3ff4155b8334 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Fri, 2 Mar 2018 14:26:58 +0100 Subject: pkg/compiler: add size attribute for structs The size attribute allows to pad a struct up to the specified size. --- pkg/compiler/testdata/errors2.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'pkg/compiler/testdata/errors2.txt') diff --git a/pkg/compiler/testdata/errors2.txt b/pkg/compiler/testdata/errors2.txt index f00a6afb4..a8d29789a 100644 --- a/pkg/compiler/testdata/errors2.txt +++ b/pkg/compiler/testdata/errors2.txt @@ -73,6 +73,19 @@ s2 { f1 s1 } +s3 { + f1 int8 +} [size[0]] ### size attribute has bad value 0, expect [1, 1<<20] + +s4 { + f1 int8 +} [size[1000000000]] ### size attribute has bad value 1000000000, expect [1, 1<<20] + +s6 { + f1 int8 + f2 array[int8] +} [size[10]] ### varlen struct s6 has size attribute + u1 [ f1 ptr[in, array[int8]] f2 len[f1, int32] ### len target f1 does not exist -- cgit mrf-deployment