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/all.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'pkg/compiler/testdata/all.txt') diff --git a/pkg/compiler/testdata/all.txt b/pkg/compiler/testdata/all.txt index 573fb6412..6fff34284 100644 --- a/pkg/compiler/testdata/all.txt +++ b/pkg/compiler/testdata/all.txt @@ -7,7 +7,9 @@ foo$2(a ptr[out, array[int32]]) foo$3(a union_arg) foo$4() r0 foo$5(a int8['a':'z']) -foo$6(a ptr[in, strings]) +foo$6(a int8[-20:-10]) +foo$7(a int8[-20:20]) +foo$8(a ptr[in, strings]) resource r0[intptr] @@ -38,7 +40,7 @@ strings { string_flags1 = "foo", "barbaz" string_flags2 = "" -int_flags = 0, 1 +int_flags = 0, 1, 0xabc, 'x', -11 _ = 1, 2 _ = C1, C2 -- cgit mrf-deployment