From c5b0c22b818f5a7a07da999c562abad9ed757715 Mon Sep 17 00:00:00 2001 From: xleroy Date: Thu, 1 Apr 2010 07:16:05 +0000 Subject: cparser/AddCasts.ml: forgot to materialize cast at return statement. git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1307 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e --- test/regression/Makefile | 2 +- test/regression/Results/funct3 | 2 ++ test/regression/funct3.c | 14 ++++++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 test/regression/Results/funct3 create mode 100644 test/regression/funct3.c (limited to 'test/regression') diff --git a/test/regression/Makefile b/test/regression/Makefile index a86f7d93..8407329f 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 +TESTS=bitfields1 expr1 initializers volatile2 funct3 # 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/funct3 b/test/regression/Results/funct3 new file mode 100644 index 00000000..62a2d00a --- /dev/null +++ b/test/regression/Results/funct3 @@ -0,0 +1,2 @@ +7616 +226 diff --git a/test/regression/funct3.c b/test/regression/funct3.c new file mode 100644 index 00000000..8a1acded --- /dev/null +++ b/test/regression/funct3.c @@ -0,0 +1,14 @@ +#include + +unsigned char foo (unsigned short n) +{ + printf("%d\n", n); + return -30; +} + +int main (void) +{ + int x = foo(-123456); + printf("%d\n", x); + return 0; +} -- cgit