[committed] Fix previously latent bug in reorg affecting cris port
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / simd-5.c
blob321837e64b2cf6c49228b08213c196229d326976
1 /* Test saving and restoring of SIMD registers. */
3 void abort (void);
5 typedef short Q __attribute__((vector_size(8)));
7 Q q1 = {1, 2}, q2 = {3, 4}, q3 = {5, 6}, q4 = {7, 8};
9 Q w1, w2, w3, w4;
10 Q z1, z2, z3, z4;
12 volatile int dummy;
14 void __attribute__((__noinline__))
15 func0 (void)
17 dummy = 1;
20 void __attribute__((__noinline__))
21 func1 (void)
23 Q a, b;
24 a = q1 * q2;
25 b = q3 * q4;
26 w1 = a;
27 w2 = b;
28 func0 ();
29 w3 = a;
30 w4 = b;
33 void __attribute__((__noinline__))
34 func2 (void)
36 Q a, b;
37 a = q1 + q2;
38 b = q3 - q4;
39 z1 = a;
40 z2 = b;
41 func1 ();
42 z3 = a;
43 z4 = b;
46 int
47 main (void)
49 func2 ();
51 if (__builtin_memcmp (&w1, &w3, sizeof (Q)) != 0)
52 abort ();
53 if (__builtin_memcmp (&w2, &w4, sizeof (Q)) != 0)
54 abort ();
55 if (__builtin_memcmp (&z1, &z3, sizeof (Q)) != 0)
56 abort ();
57 if (__builtin_memcmp (&z2, &z4, sizeof (Q)) != 0)
58 abort ();
60 return 0;