summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2017-12-08 10:06:20 +0100
committerAraq <rumpf_a@web.de>2017-12-08 10:06:20 +0100
commiteae1aaa37728578bf93263b0ca24064a31ca4b16 (patch)
treec90ecc0070f5024255684d8bfc7c112bcda555ec /tests
parent00a230e5d86598f37fb2708bae97c7ab1c0ebe0e (diff)
downloadNim-eae1aaa37728578bf93263b0ca24064a31ca4b16.tar.gz
fixes another sighashes problem
Diffstat (limited to 'tests')
-rw-r--r--tests/ccgbugs/tuple_canon.nim13
-rw-r--r--tests/cpp/tcasts.nim1
2 files changed, 14 insertions, 0 deletions
diff --git a/tests/ccgbugs/tuple_canon.nim b/tests/ccgbugs/tuple_canon.nim
index 45fed8eee..1a4a4d611 100644
--- a/tests/ccgbugs/tuple_canon.nim
+++ b/tests/ccgbugs/tuple_canon.nim
@@ -85,3 +85,16 @@ proc go() =
     echo "vidx ", $vidx(hg, 1, 2, hiC)
 
 go()
+
+# another sighashes problem: In tuples we have to ignore ranges.
+
+type
+  Position = tuple[x, y: int16]
+  n16 = range[0'i16..high(int16)]
+
+proc print(pos: Position) =
+  echo $pos.x, ",", $pos.y
+
+var x = 0.n16
+var y = 0.n16
+print((x, y))
diff --git a/tests/cpp/tcasts.nim b/tests/cpp/tcasts.nim
index 35f06234d..24ebb8f62 100644
--- a/tests/cpp/tcasts.nim
+++ b/tests/cpp/tcasts.nim
@@ -1,6 +1,7 @@
 discard """
   cmd: "nim cpp $file"
   output: ""
+  targets: "cpp"
 """
 
 block: #5979