Fix warning with -Wsign-compare -Wsystem-headers
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / fold-vec-logical-other-char.c
blob7fe3e0b8e0e955b3beac5ccabf9a78194bf374ec
1 /* Verify that overloaded built-ins for vec_orc and vec_nand with char
2 * inputs produce the right results. These intrinsics (vec_orc,
3 * vec_nand) were added as part of ISA 2.07 (P8). */
5 /* { dg-do compile } */
6 /* { dg-require-effective-target powerpc_p8vector_ok } */
7 /* { dg-options "-mpower8-vector -O1" } */
9 #include <altivec.h>
11 vector signed char
12 test1_orc (vector bool char x, vector signed char y)
14 vector signed char *foo;
15 *foo += vec_orc (x, y);
16 return *foo;
19 vector signed char
20 test1_nand (vector bool char x, vector signed char y)
22 vector signed char *foo;
23 *foo += vec_nand (x, y);
24 return *foo;
27 vector signed char
28 test2_orc (vector signed char x, vector bool char y)
30 vector signed char *foo;
31 *foo += vec_orc (x, y);
32 return *foo;
35 vector signed char
36 test2_nand (vector signed char x, vector bool char y)
38 vector signed char *foo;
39 *foo += vec_nand (x, y);
40 return *foo;
43 vector signed char
44 test3_orc (vector signed char x, vector signed char y)
46 vector signed char *foo;
47 *foo += vec_orc (x, y);
48 return *foo;
51 vector signed char
52 test3_nand (vector signed char x, vector signed char y)
54 vector signed char *foo;
55 *foo += vec_nand (x, y);
56 return *foo;
59 vector unsigned char
60 test4_orc (vector bool char x, vector unsigned char y)
62 vector unsigned char *foo;
63 *foo += vec_orc (x, y);
64 return *foo;
67 vector unsigned char
68 test4_nand (vector bool char x, vector unsigned char y)
70 vector unsigned char *foo;
71 *foo += vec_nand (x, y);
72 return *foo;
75 vector unsigned char
76 test5_orc (vector unsigned char x, vector bool char y)
78 vector unsigned char *foo;
79 *foo += vec_orc (x, y);
80 return *foo;
83 vector unsigned char
84 test5_nand (vector unsigned char x, vector bool char y)
86 vector unsigned char *foo;
87 *foo += vec_nand (x, y);
88 return *foo;
91 vector unsigned char
92 test6_orc (vector unsigned char x, vector unsigned char y)
94 vector unsigned char *foo;
95 *foo += vec_orc (x, y);
96 return *foo;
99 vector unsigned char
100 test6_nand (vector unsigned char x, vector unsigned char y)
102 vector unsigned char *foo;
103 *foo += vec_nand (x, y);
104 return *foo;
107 /* { dg-final { scan-assembler-times {\mxxlnand\M} 6 } } */
108 /* { dg-final { scan-assembler-times {\mxxlorc\M} 6 } } */