From 710eefe85a976c438da255499fbefd1a6c989ef6 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Mon, 9 Jul 2018 20:47:07 +0200 Subject: pkg/compiler: support negative integers Currently we have to use 0xffffffffffffffff to represent -1, and we can't express e.g. -20:20 int range. Support negative consts to fix both problems. --- pkg/compiler/testdata/errors2.txt | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'pkg/compiler/testdata/errors2.txt') diff --git a/pkg/compiler/testdata/errors2.txt b/pkg/compiler/testdata/errors2.txt index 1b1adefa5..77db29197 100644 --- a/pkg/compiler/testdata/errors2.txt +++ b/pkg/compiler/testdata/errors2.txt @@ -217,6 +217,11 @@ foo$507(a ptr[in, array[int32, 0:0]]) ### arrays of size 0 are not supported foo$508(a ptr[in, string["foo", 3]]) ### string value "foo\x00" exceeds buffer length 3 foo$509(a int8['b':'a']) ### bad int range [98:97] foo$510(a type500) +foo$511(a int32[-10:-20]) ### bad int range [18446744073709551606:18446744073709551596] +foo$512(a ptr[in, array[int8, -2:-1]]) ### bad size range [18446744073709551614:18446744073709551615] +foo$513(a ptr[in, array[int8, -2:2]]) ### bad size range [18446744073709551614:2] +foo$514(a vma[-2:2]) ### bad size range [18446744073709551614:2] +foo$515(a ptr[in, proc[1, -10, int64]]) ### values starting from 1 with step 18446744073709551606 overflow base type for 32 procs type type500 proc[C1, 8, int8] ### values starting from 1 with step 8 overflow base type for 32 procs type type501 int8 ### unused type type501 -- cgit mrf-deployment