aboutsummaryrefslogtreecommitdiff
path: root/compiler/tests/verifier/expr_constexpr_limits.good
blob: 536ffa8825d9adec3f0aef486d845c590cd7c9f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34

uint8 aa = 100 + 100 + 50;
uint8 ab = aa + 5;
uint8 ac = aa - 250;
uint8 ad = (0xe bitxor 0x1) << 4;
int8 ba = 120 + 7;
int8 bb = (ba - 127) + -128;

uint16 da = 65534 + 1;
uint16 db = 10 + 1 - 11;
int16 ea = 32766 + 1;
int16 eb = -32767 - 1;
int16 ec = (-32768 + 1) - 1;

uint32 ha = 4294967294 + 1;
uint32 hb = 4294967295 - 1234567890 - 3060399405;
int32 ia = 2147483646 + 1;
int32 ib = -1 - 2147483647;
int32 ic = -1 + (1 -2147483647);

uint64 la = 1 + 18446744073709551614;
uint64 lb = 0xfffffffffffffff bitor 0xf000000000000000;
int64 ma = 1 + (9223372036854775807 - 1);
int64 mb = ((-9223372036854775808 + 0) + 1) - 1;

uint16 shifted1 = (340282366920938463463374607431768211455 >> 112 as uint128) typeassert uint16;
// TODO perhaps we should not allow having more digits than the maximum/minimum number for the type
uint16 zero = 0x00000000000000000000000000000000;
uint16 one = 0x00000000000000000000000000000001;
uint16 shifted2 = 0x00000000000000000000000000000001 << 15;
uint16 lotsofzeros1 = 0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000;
uint16 lotsofzeros2 = 0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 bitxor 1;
uint16 lotsofzeros3 = 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000;
uint16 lotsofzeros4 = 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + 1;
int16 lotsofzeros5 = -0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 - 32767;