Skip to content

Commit

Permalink
add tests for (too) many arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
esumii committed Oct 27, 2016
1 parent e3c86d5 commit 55776cf
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 14 deletions.
3 changes: 2 additions & 1 deletion Makefile
Expand Up @@ -32,7 +32,8 @@ TESTS = print sum-tail gcd sum fib ack even-odd \
adder funcomp cls-rec cls-bug cls-bug2 cls-reg-bug \
shuffle spill spill2 spill3 join-stack join-stack2 join-stack3 \
join-reg join-reg2 non-tail-if non-tail-if2 \
inprod inprod-rec inprod-loop matmul matmul-flat
inprod inprod-rec inprod-loop matmul matmul-flat \
manyargs

do_test: $(TESTS:%=test/%.cmp)

Expand Down
5 changes: 5 additions & 0 deletions test/PowerPC/manyargs.ml
@@ -0,0 +1,5 @@
(* thanks to https://twitter.com/gan13027830/status/791239623959687168 *)
(* exactly one more arguments than registers; does not copmile *)
let x = 42 in
let rec f y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 y13 y14 y15 y16 y17 y18 y19 y20 y21 y22 y23 y24 y25 = print_int (x + y1 + y2 + y3 + y4 + y5 + y6 + y7 + y8 + y9 + y10 + y11 + y12 + y13 + y14 + y15 + y16 + y17 + y18 + y19 + y20 + y21 + y22 + y23 + y24 + y25) in
f 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
5 changes: 5 additions & 0 deletions test/PowerPC/toomanyargs.ml
@@ -0,0 +1,5 @@
(* thanks to https://twitter.com/gan13027830/status/791239623959687168 *)
(* exactly one more arguments than registers; does not copmile *)
let x = 42 in
let rec f y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 y13 y14 y15 y16 y17 y18 y19 y20 y21 y22 y23 y24 y25 y26 = print_int x in
f 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
5 changes: 5 additions & 0 deletions test/SPARC/manyargs.ml
@@ -0,0 +1,5 @@
(* thanks to https://twitter.com/gan13027830/status/791239623959687168 *)
(* exactly one more arguments than registers; does not copmile *)
let x = 42 in
let rec f y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 y13 y14 y15 y16 = print_int (x + y1 + y2 + y3 + y4 + y5 + y6 + y7 + y8 + y9 + y10 + y11 + y12 + y13 + y14 + y15 + y16) in
f 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
5 changes: 5 additions & 0 deletions test/SPARC/toomanyargs.ml
@@ -0,0 +1,5 @@
(* thanks to https://twitter.com/gan13027830/status/791239623959687168 *)
(* exactly one more arguments than registers; does not copmile *)
let x = 42 in
let rec f y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 y13 y14 y15 y16 y17 = print_int x in
f 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
5 changes: 5 additions & 0 deletions test/x86/manyargs.ml
@@ -0,0 +1,5 @@
(* thanks to https://twitter.com/gan13027830/status/791239623959687168 *)
(* exactly one more arguments than registers; does not copmile *)
let x = 42 in
let rec f y1 y2 y3 y4 y5 = print_int (x + y1 + y2 + y3 + y4 + y5) in
f 1 2 3 4 5
2 changes: 1 addition & 1 deletion test/manyargs.ml → test/x86/toomanyargs.ml
@@ -1,5 +1,5 @@
(* thanks to https://twitter.com/gan13027830/status/791239623959687168 *)
(* exactly one more arguments than registers; does not copmile *)
let x = 42 in
let rec f a b c d e f = print_int x in
let rec f y1 y2 y3 y4 y5 y6 = print_int x in
f 1 2 3 4 5 6
8 changes: 4 additions & 4 deletions to_ppc
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
ln -sf PowerPC/{*.ml{,i},libmincaml.S} .
cd shootout; ln -sf PowerPC/Makefile .
cd ../bytemark; ln -sf PowerPC/Makefile .
cd ../min-rt; ln -sf PowerPC/globals.s .
cd ..
cd test; ln -sf PowerPC/{,too}manyargs.ml .; cd ..
cd shootout; ln -sf PowerPC/Makefile .; cd ..
cd bytemark; ln -sf PowerPC/Makefile .; cd ..
cd min-rt; ln -sf PowerPC/globals.s .; cd ..
8 changes: 4 additions & 4 deletions to_sparc
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
ln -sf SPARC/{*.ml{,i},libmincaml.S} .
cd shootout; ln -sf SPARC/Makefile .
cd ../bytemark; ln -sf SPARC/Makefile .
cd ../min-rt; ln -sf SPARC/globals.s .
cd ..
cd test; ln -sf SPARC/{,too}manyargs.ml .; cd ..
cd shootout; ln -sf SPARC/Makefile .; cd ..
cd bytemark; ln -sf SPARC/Makefile .; cd ..
cd min-rt; ln -sf SPARC/globals.s .; cd ..
8 changes: 4 additions & 4 deletions to_x86
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
ln -sf x86/{*.ml{,i},libmincaml.S} .
cd shootout; ln -sf x86/Makefile .
cd ../bytemark; ln -sf x86/Makefile .
cd ../min-rt; ln -sf x86/globals.s .
cd ..
cd test; ln -sf x86/{,too}manyargs.ml .; cd ..
cd shootout; ln -sf x86/Makefile .; cd ..
cd bytemark; ln -sf x86/Makefile .; cd ..
cd min-rt; ln -sf x86/globals.s .; cd ..

0 comments on commit 55776cf

Please sign in to comment.