Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / gcc.c-torture / execute / simd-5.c
blobf0584328716b7ad794a978a543a73ab555705347
1 /* Test saving and restoring of SIMD registers. */
3 typedef short Q __attribute__((vector_size(8)));
5 Q q1 = {1, 2}, q2 = {3, 4}, q3 = {5, 6}, q4 = {7, 8};
7 Q w1, w2, w3, w4;
8 Q z1, z2, z3, z4;
10 volatile int dummy;
12 void __attribute__((__noinline__))
13 func0 (void)
15 dummy = 1;
18 void __attribute__((__noinline__))
19 func1 (void)
21 Q a, b;
22 a = q1 * q2;
23 b = q3 * q4;
24 w1 = a;
25 w2 = b;
26 func0 ();
27 w3 = a;
28 w4 = b;
31 void __attribute__((__noinline__))
32 func2 (void)
34 Q a, b;
35 a = q1 + q2;
36 b = q3 - q4;
37 z1 = a;
38 z2 = b;
39 func1 ();
40 z3 = a;
41 z4 = b;
44 int
45 main (void)
47 func2 ();
49 if (memcmp (&w1, &w3, sizeof (Q)) != 0)
50 abort ();
51 if (memcmp (&w2, &w4, sizeof (Q)) != 0)
52 abort ();
53 if (memcmp (&z1, &z3, sizeof (Q)) != 0)
54 abort ();
55 if (memcmp (&z2, &z4, sizeof (Q)) != 0)
56 abort ();
58 return 0;