Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / gcc.c-torture / execute / 20050316-1.c
blob2a1c6254dfaf38b2bcdeefd23ecb9fe1ab8db175
1 /* PR rtl-optimization/16104 */
3 extern void abort (void);
5 typedef int V2SI __attribute__ ((vector_size (8)));
6 typedef unsigned int V2USI __attribute__ ((vector_size (8)));
7 typedef short V2HI __attribute__ ((vector_size (4)));
8 typedef unsigned int V2UHI __attribute__ ((vector_size (4)));
10 int
11 test1 (void)
13 return (long long) (V2SI) 0LL;
16 int
17 test2 (V2SI x)
19 return (long long) x;
22 V2SI
23 test3 (void)
25 return (V2SI) (long long) (int) (V2HI) 0;
28 V2SI
29 test4 (V2HI x)
31 return (V2SI) (long long) (int) x;
34 V2SI
35 test5 (V2USI x)
37 return (V2SI) x;
40 int
41 main (void)
43 if (sizeof (short) != 2 || sizeof (int) != 4 || sizeof (long long) != 8)
44 return 0;
46 if (test1 () != 0)
47 abort ();
49 V2SI x = { 2, 2 };
50 if (test2 (x) != 2)
51 abort ();
53 union { V2SI x; int y[2]; V2USI z; long long l; } u;
54 u.x = test3 ();
55 if (u.y[0] != 0 || u.y[1] != 0)
56 abort ();
58 V2HI y = { 4, 4 };
59 union { V2SI x; long long y; } v;
60 v.x = test4 (y);
61 if (v.y != 0x40004)
62 abort ();
64 V2USI z = { 6, 6 };
65 u.x = test5 (z);
66 if (u.y[0] != 6 || u.y[1] != 6)
67 abort ();
68 return 0;