summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/graphite/pr42211.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/graphite/pr42211.c')
-rw-r--r--gcc/testsuite/gcc.dg/graphite/pr42211.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/graphite/pr42211.c b/gcc/testsuite/gcc.dg/graphite/pr42211.c
new file mode 100644
index 000000000..d8fb915f3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/graphite/pr42211.c
@@ -0,0 +1,22 @@
+/* { dg-options "-O3 -floop-interchange" } */
+
+typedef unsigned char uint8_t;
+
+void border_mirror(uint8_t *outer_img, int w, int h, int rb, int border)
+{
+ uint8_t *img = outer_img + border * rb + border;
+ int x, y;
+
+ for (y = -border; y < 0; y++) {
+ for (x = -border; x < 0; x++)
+ img[y*rb + x] = img[(-y)*rb + (-x)];
+
+ for (x = 0; x < w; x++)
+ img[y*rb + x] = img[(-y)*rb + x];
+ }
+}
+
+void border_mirror_480(uint8_t *outer_img)
+{
+ border_mirror(outer_img, 640, 480, 640 + 16*2, 16);
+}