2009-07-17 Richard Guenther <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / vect-11a.c
blob2da903b1bc498f353d5d5cb4e6d53bb7cb299793
1 /* { dg-require-effective-target vect_int } */
2 /* { dg-require-effective-target vect_int_mult } */
4 #include <stdarg.h>
5 #include "tree-vect.h"
7 extern void abort (void);
9 unsigned int A[8] = {0x08000000,0xffffffff,0xff0000ff,0xf0000001,
10 0x08000000,0xffffffff,0xff0000ff,0xf0000001};
11 unsigned int B[8] = {0x08000000,0x08000001,0xff0000ff,0xf0000001,
12 0x08000000,0x08000001,0xff0000ff,0xf0000001};
13 unsigned int Answer[8] = {0,0xf7ffffff,0x0200fe01,0xe0000001,
14 0,0xf7ffffff,0x0200fe01,0xe0000001};
15 unsigned int C[8];
17 __attribute__ ((noinline))
18 void u ()
20 int i, j;
22 for (i=0; i<8; i++)
23 C[i] = A[i] * B[i];
24 for (i=0; i<8; i++)
25 if (C[i] != Answer[i])
26 abort ();
29 signed int D[8] = {0x08000000,0xffffffff,0xff0000ff,0xf0000001,
30 0x08000000,0xffffffff,0xff0000ff,0xf0000001};
31 signed int E[8] = {0x08000000,0x08000001,0xff0000ff,0xf0000001,
32 0x08000000,0x08000001,0xff0000ff,0xf0000001};
33 signed int Dnswer[8] = {0,0xf7ffffff,0x0200fe01, 0xe0000001,
34 0,0xf7ffffff,0x0200fe01, 0xe0000001};
35 signed int F[8];
37 __attribute__ ((noinline))
38 void s()
40 int i, j;
42 for (i=0; i<8; i++)
43 F[i] = D[i] * E[i];
44 for (i=0; i<8; i++)
45 if (F[i] != Dnswer[i])
46 abort ();
49 __attribute__ ((noinline))
50 int main1 ()
52 u();
53 s();
54 return 0;
57 int main (void)
59 check_vect ();
61 return main1 ();
64 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" } } */
65 /* { dg-final { cleanup-tree-dump "vect" } } */