aboutsummaryrefslogtreecommitdiffstats
path: root/test/regression/char1.c
diff options
context:
space:
mode:
authorxleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2011-03-09 09:43:17 +0000
committerxleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2011-03-09 09:43:17 +0000
commit06c55ab8fa4c0bf59479faf03d30a51c780da36e (patch)
tree7d843aa10b43e96724d0717b1ab36fbef3e32ee6 /test/regression/char1.c
parent4b23f9300df9e2f532745f2810aaa1e0d61f08d8 (diff)
downloadcompcert-kvx-06c55ab8fa4c0bf59479faf03d30a51c780da36e.tar.gz
compcert-kvx-06c55ab8fa4c0bf59479faf03d30a51c780da36e.zip
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
Diffstat (limited to 'test/regression/char1.c')
-rw-r--r--test/regression/char1.c16
1 files changed, 16 insertions, 0 deletions
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 <stdio.h>
+#include <limits.h>
+
+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;
+}