From 06c55ab8fa4c0bf59479faf03d30a51c780da36e Mon Sep 17 00:00:00 2001 From: xleroy Date: Wed, 9 Mar 2011 09:43:17 +0000 Subject: Treat "char" as unsigned OR signed depending on the configuration. Fixed infinite expansion of some recursive struct type where recursion goes through a typeded. git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1596 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e --- test/regression/Makefile | 4 ++-- test/regression/Results/char1 | 8 ++++++++ test/regression/char1.c | 16 ++++++++++++++++ test/regression/struct10.c | 5 +++++ 4 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 test/regression/Results/char1 create mode 100644 test/regression/char1.c create mode 100644 test/regression/struct10.c (limited to 'test') diff --git a/test/regression/Makefile b/test/regression/Makefile index a385cc48..eda31dee 100644 --- a/test/regression/Makefile +++ b/test/regression/Makefile @@ -11,12 +11,12 @@ LIBS=$(LIBMATH) TESTS=bitfields1 bitfields2 bitfields3 bitfields4 \ bitfields5 bitfields6 bitfields7 \ expr1 initializers volatile2 \ - funct3 expr5 struct7 struct8 casts1 casts2 + funct3 expr5 struct7 struct8 casts1 casts2 char1 # Other tests: should compile to .s without errors (but expect warnings) EXTRAS=annot1 commaprec expr2 expr3 expr4 extern1 funct2 funptr1 init1 \ init2 init3 init4 pragmas ptrs1 ptrs2 sizeof1 struct1 struct2 struct3 \ - struct4 struct5 struct6 struct9 types1 volatile1 + struct4 struct5 struct6 struct9 struct10 types1 volatile1 # Test known to fail FAILURES=funct1 varargs1 diff --git a/test/regression/Results/char1 b/test/regression/Results/char1 new file mode 100644 index 00000000..708031ef --- /dev/null +++ b/test/regression/Results/char1 @@ -0,0 +1,8 @@ +1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 diff --git a/test/regression/char1.c b/test/regression/char1.c new file mode 100644 index 00000000..9da4f52e --- /dev/null +++ b/test/regression/char1.c @@ -0,0 +1,16 @@ +#include +#include + +int foo (char x) { + char y = x; + return ++x > y; +} + +int main (void) { + int i; + for (i=CHAR_MIN; i<=CHAR_MAX; i++) { + printf ("%d ", foo(i)); + if ((i&31)==31) printf ("\n"); + } + return 0; +} diff --git a/test/regression/struct10.c b/test/regression/struct10.c new file mode 100644 index 00000000..7ae6bb0d --- /dev/null +++ b/test/regression/struct10.c @@ -0,0 +1,5 @@ +typedef struct xs X; + +struct xs { + X *x; +} x0; -- cgit