aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/c/Makefile9
-rw-r--r--test/c/knucleotide.c4
-rw-r--r--test/c/mandelbrot.c4
-rw-r--r--test/cminor/Makefile6
-rw-r--r--test/cminor/sha1.cmp2
-rw-r--r--test/cminor/switchtbl.cm16
-rw-r--r--test/harness/mainlists.c5
-rw-r--r--test/harness/mainswitchtbl.c11
8 files changed, 38 insertions, 19 deletions
diff --git a/test/c/Makefile b/test/c/Makefile
index 88969342..3f4ea40a 100644
--- a/test/c/Makefile
+++ b/test/c/Makefile
@@ -1,8 +1,7 @@
CCOMP=../../ccomp
-CCOMPFLAGS=-dump-c -I../lib
+CCOMPFLAGS=-stdlib ../../runtime -dclight -dasm
CC=gcc -arch ppc
-
CFLAGS=-O1 -Wall
LIBS=
@@ -20,11 +19,11 @@ all: $(PROGS:%=%.compcert)
all_gcc: $(PROGS:%=%.gcc)
-%.compcert: %.s
- $(CC) $(CFLAGS) -o $*.compcert $*.s ../lib/libcompcert.a $(LIBS)
+%.compcert: %.c $(CCOMP)
+ $(CCOMP) $(CCOMPFLAGS) -o $*.compcert $*.c $(LIBS)
%.s: %.c ../../ccomp
- $(CCOMP) $(CCOMPFLAGS) $*.c
+ $(CCOMP) $(CCOMPFLAGS) -S $*.c
%.gcc: %.c
$(CC) $(CFLAGS) -o $*.gcc $*.c $(LIBS)
diff --git a/test/c/knucleotide.c b/test/c/knucleotide.c
index 955af7f9..f7438926 100644
--- a/test/c/knucleotide.c
+++ b/test/c/knucleotide.c
@@ -8,11 +8,7 @@
http://cvs.alioth.debian.org/cgi-bin/cvsweb.cgi/shootout/bench/Include/?cvsroot=shootout
*/
-#ifdef __COMPCERT__
-#include <compcert_stdio.h>
-#else
#include <stdio.h>
-#endif
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
diff --git a/test/c/mandelbrot.c b/test/c/mandelbrot.c
index f4c0db1b..93aa8acb 100644
--- a/test/c/mandelbrot.c
+++ b/test/c/mandelbrot.c
@@ -10,11 +10,7 @@
compile flags: -O3 -ffast-math -march=pentium4 -funroll-loops
*/
-#ifdef __COMPCERT__
-#include <compcert_stdio.h>
-#else
#include <stdio.h>
-#endif
#include <stdlib.h>
int main (int argc, char **argv)
diff --git a/test/cminor/Makefile b/test/cminor/Makefile
index 29ebf699..9d2dfdb9 100644
--- a/test/cminor/Makefile
+++ b/test/cminor/Makefile
@@ -1,4 +1,5 @@
CCOMP=../../ccomp
+FLAGS=-S
CPP=cpp -P
CC=gcc
CFLAGS=-arch ppc -g
@@ -69,6 +70,11 @@ marksweep: marksweep.o maingc.o marksweepcheck.o
clean::
rm -f stopcopy
+switchtbl: switchtbl.o mainswitchtbl.o
+ $(CC) $(CFLAGS) -o switchtbl switchtbl.o mainswitchtbl.o
+clean::
+ rm -f switchtbl
+
.SUFFIXES:
.SUFFIXES: .cmp .cm .s .o .c .S
diff --git a/test/cminor/sha1.cmp b/test/cminor/sha1.cmp
index ca245443..31c4b178 100644
--- a/test/cminor/sha1.cmp
+++ b/test/cminor/sha1.cmp
@@ -54,7 +54,7 @@ extern "memset" : int -> int -> int -> void
"SHA1_transform"(ctx) : int -> void
{
- stack 320
+ stack 320;
var i, p, a, b, c, d, e, t;
/* Convert buffer data to 16 big-endian integers */
diff --git a/test/cminor/switchtbl.cm b/test/cminor/switchtbl.cm
new file mode 100644
index 00000000..07bda7ed
--- /dev/null
+++ b/test/cminor/switchtbl.cm
@@ -0,0 +1,16 @@
+"f"(x): int -> int
+{
+ match (x) {
+ case 0: return 00;
+ case 1: return 11;
+ case 2: return 22;
+ case 3: return 33;
+ case 4: return 44;
+ case 5: return 55;
+ case 6: return 66;
+ case 7: return 77;
+ case 8: return 88;
+ case 9: return 99;
+}
+}
+
diff --git a/test/harness/mainlists.c b/test/harness/mainlists.c
index ef11f6ef..281b919f 100644
--- a/test/harness/mainlists.c
+++ b/test/harness/mainlists.c
@@ -2,11 +2,6 @@
#include <stddef.h>
#include <stdlib.h>
-void * compcert_alloc(int sz)
-{
- return malloc(sz);
-}
-
struct cons { int hd; struct cons * tl; };
typedef struct cons * list;
diff --git a/test/harness/mainswitchtbl.c b/test/harness/mainswitchtbl.c
new file mode 100644
index 00000000..24ba17e7
--- /dev/null
+++ b/test/harness/mainswitchtbl.c
@@ -0,0 +1,11 @@
+#include <stdlib.h>
+#include <stdio.h>
+
+extern int f(int);
+
+int main(int argc, char ** argv)
+{
+ int i;
+ for (i = 0; i < 10; i++) printf("%2d -> %2d\n", i, f(i));
+ return 0;
+}