===================================================================
@@ -0,0 +1,73 @@
+/* { dg-do run } */
+/* { dg-require-effective-target arm_thumb2_ok } */
+/* { dg-options "-O2 -fmodulo-sched -fdump-rtl-sms -fno-auto-inc-dec" } */
+
+extern void abort (void);
+
+int filter1[8][4] = {
+ {
+ 23170, -23170, -23170, 23170,},
+ {
+ 22005, -26319, -16846, 29621,},
+ {
+ 22005, -26319, -16846, 29621,},
+ {
+ 5, -26319, -16846, 29621,},
+ {
+ 55, -26319, -16846, 29621,},
+ {
+ 77, -26319, -16846, 29621,},
+ {
+ 22005, -26319, -16846, 29621,},
+ {
+ 22005, -26319, -16846, 29621,},
+
+};
+
+
+int out[32] = {
+ 22, -22, -22, 22, 21, -25, -16, 28, 21, -25, -16, 28, 0, -25, -16, 28, 0,
+ -25, -16, 28, 0, -25, -16, 28, 21, -25, -16, 28, 21, -25, -16, 28
+};
+
+__attribute__ ((noinline))
+static void
+foo (int *arr, int *accums)
+{
+ typedef int NN[8][4];
+ static NN *filter;
+ int i;
+ filter = &filter1;
+
+ int *filterp;
+ int *arrp;
+ arrp = arr;
+ filterp = (int *) ((*filter)[0]);
+ i = 32;
+
+ while (i--)
+ {
+ *accums++ = (arrp[0] * filterp[0] + arrp[8] * filterp[0]) / 32768;
+ filterp += 1;
+ }
+}
+
+int
+main ()
+{
+ int inarr[32];
+ int accums[32];
+ int i;
+ for (i = 0; i < 32; i++)
+ inarr[i] = i << 2;
+ foo (inarr, accums);
+ for (i = 0; i < 32; i++)
+ if (out[i] != accums[i])
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-rtl-dump-times "SMS succeeded" 1 "sms" } } */
+/* { dg-final { cleanup-rtl-dump "sms" } } */
+
+
===================================================================
@@ -0,0 +1,35 @@
+/* { dg-do run } */
+/* { dg-require-effective-target arm_thumb1_ok } */
+/* { dg-options "-O2 -fmodulo-sched -fdump-rtl-sms -fno-auto-inc-dec -fmodulo-sched-allow-regmoves -gtoggle" } */
+
+extern void abort (void);
+
+unsigned char filter1[8] = { 2, 3, 1, 2, 3, 2, 2, 1 };
+
+
+void
+foo (int val, unsigned int size, unsigned char *dest)
+{
+ while (size != 0)
+ {
+ *dest++ = val & 0xff;
+ --size;
+ }
+}
+
+
+int
+main ()
+{
+ int i;
+ foo (50, 4, filter1);
+ for (i = 0; i < 4; i++)
+ if (filter1[i] != 50)
+ abort ();
+ return 0;
+}
+
+/* { dg-final { scan-rtl-dump-times "OK" 1 "sms" } } */
+/* { dg-final { cleanup-rtl-dump "sms" } } */
+
+