summary refs log tree commit diff stats
path: root/tests/ccgbugs
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2016-01-30 17:17:28 +0100
committerAndreas Rumpf <rumpf_a@web.de>2016-01-30 17:17:28 +0100
commit83e0e32f934a47eeab661288cb3d63a7258ec06f (patch)
tree76f513f2e6dcc494782bb9922c47340e05b4dd94 /tests/ccgbugs
parent1a9c8b44d3db629cdaeaf0d9c0eab3ae9f2bcc5c (diff)
downloadNim-83e0e32f934a47eeab661288cb3d63a7258ec06f.tar.gz
added test case for #3736
Diffstat (limited to 'tests/ccgbugs')
-rw-r--r--tests/ccgbugs/tunsafeaddr.nim9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/ccgbugs/tunsafeaddr.nim b/tests/ccgbugs/tunsafeaddr.nim
index 518e05b25..8d0a9d8cb 100644
--- a/tests/ccgbugs/tunsafeaddr.nim
+++ b/tests/ccgbugs/tunsafeaddr.nim
@@ -16,4 +16,13 @@ proc main =
   let foo = [8, 3, 1]
   echo sum(unsafeAddr foo[0], foo.len)
 
+
+# bug #3736
+
+proc p(x: seq[int]) = discard x[0].unsafeAddr # works
+proc q(x: seq[SomeInteger]) = discard x[0].unsafeAddr # doesn't work
+
+p(@[1])
+q(@[1])
+
 main()