summaryrefslogtreecommitdiff
path: root/test/regression
diff options
context:
space:
mode:
authorGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2011-03-09 09:43:17 +0000
committerGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2011-03-09 09:43:17 +0000
commit06c55ab8fa4c0bf59479faf03d30a51c780da36e (patch)
tree7d843aa10b43e96724d0717b1ab36fbef3e32ee6 /test/regression
parent4b23f9300df9e2f532745f2810aaa1e0d61f08d8 (diff)
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')
-rw-r--r--test/regression/Makefile4
-rw-r--r--test/regression/Results/char18
-rw-r--r--test/regression/char1.c16
-rw-r--r--test/regression/struct10.c5
4 files changed, 31 insertions, 2 deletions
diff --git a/test/regression/Makefile b/test/regression/Makefile
index a385cc4..eda31de 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 0000000..708031e
--- /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 0000000..9da4f52
--- /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;
+}
diff --git a/test/regression/struct10.c b/test/regression/struct10.c
new file mode 100644
index 0000000..7ae6bb0
--- /dev/null
+++ b/test/regression/struct10.c
@@ -0,0 +1,5 @@
+typedef struct xs X;
+
+struct xs {
+ X *x;
+} x0;