PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / ssad-run.c
blobf15f85f5753769a492cc066ac1ff8a82f39fcc30
1 extern void abort ();
2 extern int abs (int __x) __attribute__ ((__nothrow__, __leaf__)) __attribute__ ((__const__));
4 static int
5 foo (signed char *w, int i, signed char *x, int j)
7 int tot = 0;
8 for (int a = 0; a < 16; a++)
10 for (int b = 0; b < 16; b++)
11 tot += abs (w[b] - x[b]);
12 w += i;
13 x += j;
15 return tot;
18 void
19 bar (signed char *w, signed char *x, int i, int *result)
21 *result = foo (w, 16, x, i);
24 int
25 main (void)
27 signed char m[256];
28 signed char n[256];
29 int sum, i;
31 for (i = 0; i < 256; ++i)
32 if (i % 2 == 0)
34 m[i] = (i % 8) * 2 + 1;
35 n[i] = -(i % 8);
37 else
39 m[i] = -((i % 8) * 2 + 2);
40 n[i] = -((i % 8) >> 1);
43 bar (m, n, 16, &sum);
45 if (sum != 2368)
46 abort ();
48 return 0;