summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2011-08-18 14:50:19 +0000
committerGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2011-08-18 14:50:19 +0000
commit50ee6bdf639ffba989968abb9c24a57126ab35a4 (patch)
tree80e123d295a84372b13739b6905d583fa9bbe700 /test
parent62a07ee96d51c29bab9668d8c41bf5f8bdf9e23d (diff)
Presimplification SimplVolatile: cleaned up and integrated.
test/*/Makefile: normalized 'bench' target git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1717 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'test')
-rw-r--r--test/Makefile3
-rw-r--r--test/c/Makefile4
-rw-r--r--test/compression/Makefile2
-rw-r--r--test/raytracer/Makefile2
-rw-r--r--test/regression/Makefile6
-rw-r--r--test/regression/Results/volatile338
-rw-r--r--test/regression/volatile3.c77
-rw-r--r--test/spass/Makefile2
8 files changed, 126 insertions, 8 deletions
diff --git a/test/Makefile b/test/Makefile
index d29cd8d..5771523 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -6,5 +6,8 @@ all:
test:
for i in $(DIRS); do $(MAKE) -C $$i test; done
+bench:
+ for i in $(DIRS); do $(MAKE) -C $$i bench; done
+
clean:
for i in $(DIRS); do $(MAKE) -C $$i clean; done
diff --git a/test/c/Makefile b/test/c/Makefile
index ed70d18..9c57a3f 100644
--- a/test/c/Makefile
+++ b/test/c/Makefile
@@ -46,12 +46,12 @@ test_gcc:
fi; \
done
-time_gcc:
+bench_gcc:
@for i in $(PROGS); do \
echo -n "$$i: "; $(TIME) ./$$i.gcc; \
done
-time:
+bench:
@for i in $(PROGS); do \
echo -n "$$i: "; $(TIME) ./$$i.compcert; \
done
diff --git a/test/compression/Makefile b/test/compression/Makefile
index e211a58..8db55dd 100644
--- a/test/compression/Makefile
+++ b/test/compression/Makefile
@@ -24,7 +24,7 @@ LZSS_OBJS=$(COMMON_OBJS) lzvars.o lzhash.o lzencode.o lzdecode.o lzssmain.o
lzss: $(LZSS_OBJS)
$(CC) $(CFLAGS) -o $@ $(LZSS_OBJS) $(LIBS)
-TESTFILE:=$(firstword $(wildcard /mach_kernel) $(wildcard /boot/vmlinuz) ./lzss)
+TESTFILE:=$(firstword $(wildcard /usr/share/dict/words) ./lzss)
TESTCOMPR=/tmp/testcompr.out
TESTEXPND=/tmp/testexpnd.out
diff --git a/test/raytracer/Makefile b/test/raytracer/Makefile
index f209bb4..db359b1 100644
--- a/test/raytracer/Makefile
+++ b/test/raytracer/Makefile
@@ -54,4 +54,4 @@ test:
fi
bench:
- $(TIME) ./render < kal.gml
+ @echo -n "raytracer: "; $(TIME) ./render < kal.gml
diff --git a/test/regression/Makefile b/test/regression/Makefile
index eb50def..aeba3bd 100644
--- a/test/regression/Makefile
+++ b/test/regression/Makefile
@@ -1,8 +1,7 @@
include ../../Makefile.config
CCOMP=../../ccomp
-CCOMPFLAGS=-stdlib ../../runtime -dparse -dc -dclight -dasm \
- -fstruct-passing -fstruct-assign -fbitfields -fpacked-structs
+CCOMPFLAGS=-stdlib ../../runtime -dparse -dc -dclight -dasm -fall
LIBS=$(LIBMATH)
@@ -10,7 +9,7 @@ LIBS=$(LIBMATH)
TESTS=attribs1 bitfields1 bitfields2 bitfields3 bitfields4 \
bitfields5 bitfields6 bitfields7 \
- expr1 expr6 initializers volatile2 \
+ expr1 expr6 initializers volatile2 volatile3 \
funct3 expr5 struct7 struct8 struct11 casts1 casts2 char1 \
sizeof1 sizeof2 packedstruct1
@@ -44,3 +43,4 @@ test:
fi; \
done
+bench:
diff --git a/test/regression/Results/volatile3 b/test/regression/Results/volatile3
new file mode 100644
index 0000000..3d1f786
--- /dev/null
+++ b/test/regression/Results/volatile3
@@ -0,0 +1,38 @@
+x = 0
+x = 1
+x++ = 1
+x = 2
+x = 44
+x += 12 = 56
+x = 56
+x = 55
+x-- = 55
+x = 54
+x = 47
+x -= 3 = 44
+x = 44
+x = 45
+++x = 46
+x = 46
+x = 45
+--x = 44
+x = 44
+c = 0
+c = 1
+c++ = 1
+c = 2
+c = 252
+c += 42 = 38
+c = 38
+c = 37
+c-- = 37
+c = 36
+c = 29
+c -= 3 = 26
+c = 26
+c = 27
+++c = 28
+c = 28
+c = 27
+--c = 26
+c = 26
diff --git a/test/regression/volatile3.c b/test/regression/volatile3.c
new file mode 100644
index 0000000..2999609
--- /dev/null
+++ b/test/regression/volatile3.c
@@ -0,0 +1,77 @@
+/* Expansion of read-modify-write operations on volatiles */
+
+#include <stdio.h>
+
+volatile int x;
+volatile unsigned char c;
+
+int main()
+{
+ x = 0;
+ printf("x = %d\n", x);
+
+ x++;
+ printf("x = %d\n", x);
+ printf ("x++ = %d\n", x++);
+ printf("x = %d\n", x);
+
+ x += 42;
+ printf("x = %d\n", x);
+ printf ("x += 12 = %d\n", x += 12);
+ printf("x = %d\n", x);
+
+ x--;
+ printf("x = %d\n", x);
+ printf ("x-- = %d\n", x--);
+ printf("x = %d\n", x);
+
+ x -= 7;
+ printf("x = %d\n", x);
+ printf ("x -= 3 = %d\n", x -= 3);
+ printf("x = %d\n", x);
+
+ ++x;
+ printf("x = %d\n", x);
+ printf ("++x = %d\n", ++x);
+ printf("x = %d\n", x);
+
+ --x;
+ printf("x = %d\n", x);
+ printf ("--x = %d\n", --x);
+ printf("x = %d\n", x);
+
+ c = 0;
+ printf("c = %d\n", c);
+
+ c++;
+ printf("c = %d\n", c);
+ printf ("c++ = %d\n", c++);
+ printf("c = %d\n", c);
+
+ c += 250;
+ printf("c = %d\n", c);
+ printf ("c += 42 = %d\n", c += 42);
+ printf("c = %d\n", c);
+
+ c--;
+ printf("c = %d\n", c);
+ printf ("c-- = %d\n", c--);
+ printf("c = %d\n", c);
+
+ c -= 7;
+ printf("c = %d\n", c);
+ printf ("c -= 3 = %d\n", c -= 3);
+ printf("c = %d\n", c);
+
+ ++c;
+ printf("c = %d\n", c);
+ printf ("++c = %d\n", ++c);
+ printf("c = %d\n", c);
+
+ --c;
+ printf("c = %d\n", c);
+ printf ("--c = %d\n", --c);
+ printf("c = %d\n", c);
+
+ return 0;
+}
diff --git a/test/spass/Makefile b/test/spass/Makefile
index 30832f8..536488b 100644
--- a/test/spass/Makefile
+++ b/test/spass/Makefile
@@ -28,7 +28,7 @@ TIME=xtime -o /dev/null # Xavier's hack
#TIME=time >/dev/null # Otherwise
bench:
- $(TIME) ./spass problem.dfg
+ @echo -n "spass: "; $(TIME) ./spass problem.dfg
depend:
gcc -MM $(SRCS) > .depend