OSDN Git Service

75b1035df4d61683ada389b49f91ae57d23030ea
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / vect / vect-11a.c
1 /* { dg-require-effective-target vect_int } */
2 /* { dg-require-effective-target vect_int_mult } */
3
4 #include <stdarg.h>
5 #include "tree-vect.h"
6
7 extern void abort (void);
8
9 __attribute__ ((noinline))
10 void u ()
11 {  
12   unsigned int A[8] = {0x08000000,0xffffffff,0xff0000ff,0xf0000001,
13                        0x08000000,0xffffffff,0xff0000ff,0xf0000001};
14   unsigned int B[8] = {0x08000000,0x08000001,0xff0000ff,0xf0000001,
15                        0x08000000,0x08000001,0xff0000ff,0xf0000001};
16   unsigned int Answer[8] = {0,0xf7ffffff,0x0200fe01,0xe0000001,
17                             0,0xf7ffffff,0x0200fe01,0xe0000001};
18   unsigned int C[8];
19   int i, j;
20   
21   for (i=0; i<8; i++)
22     C[i] = A[i] * B[i];
23   for (i=0; i<8; i++)
24     if (C[i] != Answer[i])
25       abort ();
26 }
27
28 __attribute__ ((noinline))
29 void s()
30 {
31   signed int A[8] = {0x08000000,0xffffffff,0xff0000ff,0xf0000001,
32                      0x08000000,0xffffffff,0xff0000ff,0xf0000001};
33   signed int B[8] = {0x08000000,0x08000001,0xff0000ff,0xf0000001,
34                      0x08000000,0x08000001,0xff0000ff,0xf0000001};
35   signed int Answer[8] = {0,0xf7ffffff,0x0200fe01, 0xe0000001,
36                           0,0xf7ffffff,0x0200fe01, 0xe0000001};
37   signed int C[8];
38   int i, j;
39   
40   for (i=0; i<8; i++)
41     C[i] = A[i] * B[i];
42   for (i=0; i<8; i++)
43     if (C[i] != Answer[i])
44       abort ();
45 }
46
47 __attribute__ ((noinline))
48 int main1 ()
49 {
50   u();
51   s();
52   return 0;
53 }
54
55 int main (void)
56
57   check_vect ();
58   
59   return main1 ();
60 }
61
62 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" } } */
63 /* { dg-final { cleanup-tree-dump "vect" } } */