This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[tree-ssa] [PATCH]: Add some PRE regression tests


This patch adds two regression tests for recent PRE bugs that are now fixed.

This is the first time i've added regression tests, so i'd appreciate it if one of you could look these over.

Basically, if PRE is broken again, these tests will fail to compile due to an abort or another error message (IE there is no need to execute them).

Also, do i need a changelog entry for new tests (what changelog do they go in?)

Index: testsuite/gcc.dg/tree-ssa/20031125-1.c
===================================================================
RCS file: testsuite/gcc.dg/tree-ssa/20031125-1.c
diff -N testsuite/gcc.dg/tree-ssa/20031125-1.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ testsuite/gcc.dg/tree-ssa/20031125-1.c 25 Nov 2003 17:58:33 -0000
@@ -0,0 +1,30 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+short *_offsetTable;
+void proc4WithoutFDFE(char *dst, const char *src, int next_offs, int bw,
+ int bh, int pitch)
+{
+ do {
+ int i = bw;
+ int code = *src++;
+ int x, l;
+ int length = *src++ + 1;
+
+ for (l = 0; l < length; l++) {
+ int x;
+
+ for (x = 0; x < 4; x++) ;
+ if (i == 0)
+ dst += pitch * 3;
+ }
+ char *dst2 = dst + _offsetTable[code] + next_offs;
+
+ for (x = 0; x < 4; x++) {
+ int j = 0;
+ (dst + pitch * x)[j] = (dst2 + pitch * x)[j];
+ }
+ dst += pitch * 3;
+ } while (--bh);
+}
+
+
Index: testsuite/gcc.dg/tree-ssa/20031125-2.c
===================================================================
RCS file: testsuite/gcc.dg/tree-ssa/20031125-2.c
diff -N testsuite/gcc.dg/tree-ssa/20031125-2.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ testsuite/gcc.dg/tree-ssa/20031125-2.c 25 Nov 2003 17:58:33 -0000
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+struct BlobSpan {
+ int right;
+};
+void render_blob_line(struct BlobSpan blobdata) {
+ int buf[4 * 8];
+ int *data = buf;
+ int i, n = 0;
+ if (blobdata.right)
+ n++;
+ if (n)
+ for (; i < 2 * n;)
+ data[i] = 0;
+ n *= 2;
+ for (; n;) ;
+}



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]