summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2014-05-28 11:53:19 -0400
committerGravatar Adam Chlipala <adam@chlipala.net>2014-05-28 11:53:19 -0400
commitbd888246084de50dd7fc96464064e02b146147df (patch)
treee37cdff7a7b7a98a9685f6ad39bf882a0c7f3e97 /tests
parent9c095fdc0f269c75ad126fe8a7977f8785efdb71 (diff)
Align to sizeof(void *) instead of fixed 4
Diffstat (limited to 'tests')
-rw-r--r--tests/listinit.ur43
1 files changed, 43 insertions, 0 deletions
diff --git a/tests/listinit.ur b/tests/listinit.ur
new file mode 100644
index 00000000..8f9fb57d
--- /dev/null
+++ b/tests/listinit.ur
@@ -0,0 +1,43 @@
+fun makeList n =
+ if n = 0 then
+ []
+ else
+ n :: makeList (n-1)
+
+fun sum ls =
+ case ls of
+ [] => 0
+ | n :: ls' => n + sum ls'
+
+val ls = 1 :: 2 :: 3 :: 4 :: 5 :: 6 :: 7 :: 8 :: 9 :: 10
+ :: 1 :: 2 :: 3 :: 4 :: 5 :: 6 :: 7 :: 8 :: 9 :: 10
+ :: 1 :: 2 :: 3 :: 4 :: 5 :: 6 :: 7 :: 8 :: 9 :: 10
+ :: 1 :: 2 :: 3 :: 4 :: 5 :: 6 :: 7 :: 8 :: 9 :: 10
+ :: 1 :: 2 :: 3 :: 4 :: 5 :: 6 :: 7 :: 8 :: 9 :: 10
+ :: 1 :: 2 :: 3 :: 4 :: 5 :: 6 :: 7 :: 8 :: 9 :: 10
+ :: 1 :: 2 :: 3 :: 4 :: 5 :: 6 :: 7 :: 8 :: 9 :: 10
+ :: 1 :: 2 :: 3 :: 4 :: 5 :: 6 :: 7 :: 8 :: 9 :: 10
+ :: 1 :: 2 :: 3 :: 4 :: 5 :: 6 :: 7 :: 8 :: 9 :: 10
+ :: 1 :: 2 :: 3 :: 4 :: 5 :: 6 :: 7 :: 8 :: 9 :: 10
+ :: 1 :: 2 :: 3 :: 4 :: 5 :: 6 :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