1 /* PR c/77490 */
2 /* { dg-do compile } */
3 /* { dg-options "-Wall -Wno-psabi" } */
4
5 #ifndef __cplusplus
6 # define bool _Bool
7 #endif
8
9 typedef volatile bool T;
10 typedef int __attribute__ ((vector_size (4 * sizeof (int)))) v4si;
11 extern bool foo (void);
12
13 int
fn(bool b,bool b2,T b3,int n,v4si v)14 fn (bool b, bool b2, T b3, int n, v4si v)
15 {
16 int r = 0;
17
18 r += ~b; /* { dg-warning "on an expression of type bool|on a boolean expression" } */
19 r += n + ~b; /* { dg-warning "on an expression of type bool|on a boolean expression" } */
20 r += ~(n == 1); /* { dg-warning "on an expression of type bool|on a boolean expression" } */
21 r += ~(n || 1); /* { dg-warning "on an expression of type bool|on a boolean expression" } */
22 r += ~b == 1; /* { dg-warning "on an expression of type bool|on a boolean expression" } */
23 r += ~(++n, n == 1); /* { dg-warning "on an expression of type bool|on a boolean expression" } */
24 r += ~(++n, n > 1); /* { dg-warning "on an expression of type bool|on a boolean expression" } */
25 r += ~(++n, n && 1); /* { dg-warning "on an expression of type bool|on a boolean expression" } */
26 r += (++n, ~b); /* { dg-warning "on an expression of type bool|on a boolean expression" } */
27 r += ~b3; /* { dg-warning "on an expression of type bool|on a boolean expression" } */
28 r += ~foo (); /* { dg-warning "on an expression of type bool|on a boolean expression" } */
29 r += ~(bool) !1; /* { dg-warning "on an expression of type bool|on a boolean expression" } */
30
31 v = ~v;
32 r += ~(int) b;
33 r += -b;
34
35 return r;
36 }
37
38 /* { dg-prune-output ".*GCC vector passed by reference.*" } */
39