1 /* PR c/68062 */
2 /* { dg-do compile } */
3 /* { dg-options "-Wsign-compare -Wno-psabi" } */
4 /* Ignore warning on some powerpc configurations. */
5 /* { dg-prune-output "non-standard ABI extension" } */
6 
7 typedef signed char __attribute__ ((vector_size (4))) v4qi;
8 typedef unsigned char __attribute__ ((vector_size (4))) uv4qi;
9 typedef signed int __attribute__ ((vector_size (4 * __SIZEOF_INT__))) v4si;
10 typedef unsigned int __attribute__ ((vector_size (4 * __SIZEOF_INT__))) uv4si;
11 
12 v4qi
fn1(void)13 fn1 (void)
14 {
15   v4qi a = { 1, 2, 3, 4 };
16   uv4qi b = { 4, 3, 2, 1 };
17   v4qi v = { 0, 0, 0, 0 };
18 
19   v += (a == b); /* { dg-warning "comparison between types" } */
20   v += (a != b); /* { dg-warning "comparison between types" } */
21   v += (a >= b); /* { dg-warning "comparison between types" } */
22   v += (a <= b); /* { dg-warning "comparison between types" } */
23   v += (a > b); /* { dg-warning "comparison between types" } */
24   v += (a < b); /* { dg-warning "comparison between types" } */
25 
26   return v;
27 }
28 
29 v4si
fn2(void)30 fn2 (void)
31 {
32   v4si a = { 1, 2, 3, 4 };
33   uv4si b = { 4, 3, 2, 1 };
34   v4si v = { 0, 0, 0, 0 };
35 
36   v += (a == b); /* { dg-warning "comparison between types" } */
37   v += (a != b); /* { dg-warning "comparison between types" } */
38   v += (a >= b); /* { dg-warning "comparison between types" } */
39   v += (a <= b); /* { dg-warning "comparison between types" } */
40   v += (a > b); /* { dg-warning "comparison between types" } */
41   v += (a < b); /* { dg-warning "comparison between types" } */
42 
43   return v;
44 }
45