summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2010-04-02 07:55:14 +0000
committerGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2010-04-02 07:55:14 +0000
commite7b822497b940e181dab799a8c17dc49e2062f0a (patch)
tree435131d5b79a3305fd97fa8441cb9115fafdb19d /test
parentc5b0c22b818f5a7a07da999c562abad9ed757715 (diff)
In cparser/SimplExpr.ml:
- wrong simplification of && and || in the Set case - generated nicer code for && and || in the Eval case git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1308 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'test')
-rw-r--r--test/regression/Makefile2
-rw-r--r--test/regression/Results/expr51
-rw-r--r--test/regression/expr5.c13
3 files changed, 15 insertions, 1 deletions
diff --git a/test/regression/Makefile b/test/regression/Makefile
index 8407329..1ec2264 100644
--- a/test/regression/Makefile
+++ b/test/regression/Makefile
@@ -7,7 +7,7 @@ CCOMPFLAGS=-stdlib ../../runtime -dparse -dclight -dasm \
LIBS=$(LIBMATH)
# Can run and have reference output in Results
-TESTS=bitfields1 expr1 initializers volatile2 funct3
+TESTS=bitfields1 expr1 initializers volatile2 funct3 expr5
# Other tests: should compile to .s without errors (but expect warnings)
EXTRAS=commaprec expr2 expr3 expr4 extern1 funct2 funptr1 init1 \
diff --git a/test/regression/Results/expr5 b/test/regression/Results/expr5
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/test/regression/Results/expr5
@@ -0,0 +1 @@
+1
diff --git a/test/regression/expr5.c b/test/regression/expr5.c
new file mode 100644
index 0000000..b41aeb8
--- /dev/null
+++ b/test/regression/expr5.c
@@ -0,0 +1,13 @@
+#include <stdio.h>
+
+int foo(void)
+{
+ return 2;
+}
+
+int main(void)
+{
+ int g_46 = 0 || foo();
+ printf ("%d\n", g_46);
+ return 0;
+}