summaryrefslogtreecommitdiffstats
path: root/testasmcomp/main.c
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>1995-12-05 09:16:53 +0000
committerXavier Leroy <xavier.leroy@inria.fr>1995-12-05 09:16:53 +0000
commitc34a58a12edf215cba39e2a57a1890a84d9db476 (patch)
tree5cdf9e5f4716f726be2196de0c4d74173969be71 /testasmcomp/main.c
parent87651e58b8475d48a66a6120c23bec61781c8c91 (diff)
Ajout d'un test pour checkbound.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@502 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'testasmcomp/main.c')
-rw-r--r--testasmcomp/main.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/testasmcomp/main.c b/testasmcomp/main.c
index eecd117fa..feeea9ff4 100644
--- a/testasmcomp/main.c
+++ b/testasmcomp/main.c
@@ -77,5 +77,27 @@ int main(argc, argv)
}
#endif
#endif
+#ifdef CHECKBOUND
+ { extern void checkbound1(), checkbound2();
+ extern void call_gen_code();
+ long x, y;
+ x = atoi(argv[1]);
+ if (argc >= 3) {
+ y = atoi(argv[2]);
+ if ((unsigned long) x < (unsigned long) y)
+ printf("Should not trap\n");
+ else
+ printf("Should trap\n");
+ call_gen_code(checkbound2, y, x);
+ } else {
+ if (2 < (unsigned long) x)
+ printf("Should not trap\n");
+ else
+ printf("Should trap\n");
+ call_gen_code(checkbound1, x);
+ }
+ printf("OK\n");
+ }
+#endif
return 0;
}