summary refs log tree commit diff stats
path: root/tests/accept/run/tovfint.nim
blob: cfb1e649d8bb717c7831fce9812dde7f96777e3b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
discard """
  file: "tovfint.nim"
  output: "works!"
"""
# this tests the new overflow literals

var
  i: int
i = int(0xffffffff)
when defined(cpu64):
  if i == 4294967295:
    write(stdout, "works!\n")
  else:
    write(stdout, "broken!\n")
else:
  if i == -1:
    write(stdout, "works!\n")
  else:
    write(stdout, "broken!\n")

#OUT works!