2 /* { dg-do compile } */
3 /* { dg-options "-Wsequence-point" } */
11 b
= (a
+= 5) > a
; /* { dg-warning "undefined" "sequence point warning" } */
12 b
= (a
+= 5) + a
== 10; /* { dg-warning "undefined" "sequence point warning" } */
13 b
= (a
-= 5) > a
; /* { dg-warning "undefined" "sequence point warning" } */
14 b
= (a
-= 5) + a
== 10; /* { dg-warning "undefined" "sequence point warning" } */
15 b
= a
-- > a
; /* { dg-warning "undefined" "sequence point warning" } */
16 b
= a
-- + a
== 10; /* { dg-warning "undefined" "sequence point warning" } */
17 b
= ++a
> a
; /* { dg-warning "undefined" "sequence point warning" } */
18 b
= ++a
+ a
== 10; /* { dg-warning "undefined" "sequence point warning" } */
20 if ((a
+= 5) > a
) return -1; /* { dg-warning "undefined" "sequence point warning" } */
21 if ((a
+= 5) + a
== 10) return -1; /* { dg-warning "undefined" "sequence point warning" } */
22 if ((a
-= 5) > a
) return -1; /* { dg-warning "undefined" "sequence point warning" } */
23 if ((a
-= 5) + a
== 10) return -1; /* { dg-warning "undefined" "sequence point warning" } */
24 if (a
-- > a
) return -1; /* { dg-warning "undefined" "sequence point warning" } */
25 if (a
-- + a
== 10) return -1; /* { dg-warning "undefined" "sequence point warning" } */
26 if (++a
> a
) return -1; /* { dg-warning "undefined" "sequence point warning" } */
27 if (++a
+ a
== 10) return -1; /* { dg-warning "undefined" "sequence point warning" } */
28 do {} while ((a
+= 5) > a
); /* { dg-warning "undefined" "sequence point warning" } */
29 while ((a
+= 5) > a
); /* { dg-warning "undefined" "sequence point warning" } */
30 for ((a
+= 5) > a
;;); /* { dg-warning "undefined" "sequence point warning" } */
31 for (b
= (a
+= 5) > a
;;); /* { dg-warning "undefined" "sequence point warning" } */
32 for (; (a
+= 5) > a
;); /* { dg-warning "undefined" "sequence point warning" } */
33 for (;; b
= (a
+= 5) > a
); /* { dg-warning "undefined" "sequence point warning" } */
34 for (;; a
++ + a
++); /* { dg-warning "undefined" "sequence point warning" } */
35 if (a
) a
++ - a
--; /* { dg-warning "undefined" "sequence point warning" } */
36 ((a
+=5) > a
) ? a
: b
; /* { dg-warning "undefined" "sequence point warning" } */
37 return (a
++ - a
--); /* { dg-warning "undefined" "sequence point warning" } */
42 int a
= i
++ - i
++; /* { dg-warning "undefined" "sequence point warning" } */
47 switch (i
++ + i
++) /* { dg-warning "undefined" "sequence point warning" } */
50 i
++ - i
++; /* { dg-warning "undefined" "sequence point warning" } */