Fix warning with -Wsign-compare -Wsystem-headers
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / fold-vec-logical-ors-char.c
blob7406039d0549ab6f96027fc72a019685ffff45bb
1 /* Verify that overloaded built-ins for vec_or, vec_xor, vec_nor
2 * with char inputs produce the right results. */
4 /* { dg-do compile } */
5 /* { dg-require-effective-target powerpc_vsx_ok } */
6 /* { dg-options "-mvsx -O1" } */
8 #include <altivec.h>
10 vector signed char
11 test1_or (vector bool char x, vector signed char y)
13 vector signed char *foo;
14 *foo += vec_or (x, y);
15 return *foo;
18 vector signed char
19 test1_xor (vector bool char x, vector signed char y)
21 vector signed char *foo;
22 *foo += vec_xor (x, y);
23 return *foo;
26 vector signed char
27 test2_or (vector signed char x, vector bool char y)
29 vector signed char *foo;
30 *foo += vec_or (x, y);
31 return *foo;
34 vector signed char
35 test2_xor (vector signed char x, vector bool char y)
37 vector signed char *foo;
38 *foo += vec_xor (x, y);
39 return *foo;
42 vector signed char
43 test3_or (vector signed char x, vector signed char y)
45 vector signed char *foo;
46 *foo += vec_or (x, y);
47 return *foo;
50 vector signed char
51 test3_xor (vector signed char x, vector signed char y)
53 vector signed char *foo;
54 *foo += vec_xor (x, y);
55 return *foo;
58 vector signed char
59 test3_nor (vector signed char x, vector signed char y)
61 vector signed char *foo;
62 *foo += vec_nor (x, y);
63 return *foo;
67 vector unsigned char
68 test4_or (vector bool char x, vector unsigned char y)
70 vector unsigned char *foo;
71 *foo += vec_or (x, y);
72 return *foo;
75 vector unsigned char
76 test4_xor (vector bool char x, vector unsigned char y)
78 vector unsigned char *foo;
79 *foo += vec_xor (x, y);
80 return *foo;
83 vector unsigned char
84 test5_or (vector unsigned char x, vector bool char y)
86 vector unsigned char *foo;
87 *foo += vec_or (x, y);
88 return *foo;
91 vector unsigned char
92 test5_xor (vector unsigned char x, vector bool char y)
94 vector unsigned char *foo;
95 *foo += vec_xor (x, y);
96 return *foo;
99 vector unsigned char
100 test6_or (vector unsigned char x, vector unsigned char y)
102 vector unsigned char *foo;
103 *foo += vec_or (x, y);
104 return *foo;
107 vector unsigned char
108 test6_xor (vector unsigned char x, vector unsigned char y)
110 vector unsigned char *foo;
111 *foo += vec_xor (x, y);
112 return *foo;
115 vector unsigned char
116 test6_nor (vector unsigned char x, vector unsigned char y)
118 vector unsigned char *foo;
119 *foo += vec_nor (x, y);
120 return *foo;
123 /* { dg-final { scan-assembler-times {\mxxlor\M} 6 } } */
124 /* { dg-final { scan-assembler-times {\mxxlxor\M} 6 } } */
125 /* { dg-final { scan-assembler-times {\mxxlnor\M} 2 } } */