diff options
Diffstat (limited to 'tests/vm/tarrayboundeval.nim')
-rw-r--r-- | tests/vm/tarrayboundeval.nim | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/vm/tarrayboundeval.nim b/tests/vm/tarrayboundeval.nim new file mode 100644 index 000000000..dc8c7ebdc --- /dev/null +++ b/tests/vm/tarrayboundeval.nim @@ -0,0 +1,31 @@ +discard """ + output: '''7 +8 8 +-2''' +""" + +#bug 1063 + +const + KeyMax = 227 + myconst = int((KeyMax + 31) / 32) + +type + FU = array[int((KeyMax + 31) / 32), cuint] + +echo FU.high + +type + PKeyboard* = ptr object + TKeyboardState* = object + display*: pointer + internal: array[int((KeyMax + 31)/32), cuint] + +echo myconst, " ", int((KeyMax + 31) / 32) + +#bug 1304 or something: + +const constArray: array[-3..2, int] = [-3, -2, -1, 0, 1, 2] + +echo constArray[-2] + |