diff options
author | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2010-04-01 07:16:05 +0000 |
---|---|---|
committer | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2010-04-01 07:16:05 +0000 |
commit | c5b0c22b818f5a7a07da999c562abad9ed757715 (patch) | |
tree | 95a7f5cfd2cc925b9b7be617bc95c2a9005f3740 /test/regression | |
parent | 6f731da1e13d295104d624114ee26db46e50238f (diff) | |
download | compcert-c5b0c22b818f5a7a07da999c562abad9ed757715.tar.gz compcert-c5b0c22b818f5a7a07da999c562abad9ed757715.zip |
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
Diffstat (limited to 'test/regression')
-rw-r--r-- | test/regression/Makefile | 2 | ||||
-rw-r--r-- | test/regression/Results/funct3 | 2 | ||||
-rw-r--r-- | test/regression/funct3.c | 14 |
3 files changed, 17 insertions, 1 deletions
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 <stdio.h> + +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; +} |