* tree-ssa-loop-manip.c (split_loop_exit_edge): Return the new block.
[official-gcc.git] / gcc / testsuite / gcc.dg / Wparentheses-4.c
blobdfc9d1008efc3212f6da6343fa405430cb2cc194
1 /* Test operation of -Wparentheses. Precedence warnings. + or -
2 inside shift. */
3 /* Origin: Joseph Myers <jsm@polyomino.org.uk> */
5 /* { dg-do compile } */
6 /* { dg-options "-Wparentheses" } */
8 int foo (int);
10 int
11 bar (int a, int b, int c)
13 foo (a + b << c); /* { dg-warning "parentheses" "correct warning" } */
14 foo ((a + b) << c);
15 foo (a + (b << c));
16 foo (1 + 2 << c); /* { dg-warning "parentheses" "correct warning" } */
17 foo ((1 + 2) << c);
18 foo (1 + (2 << c));
19 foo (1 + 2 << 3); /* { dg-warning "parentheses" "correct warning" } */
20 foo ((1 + 2) << 3);
21 foo (1 + (2 << 3));
22 foo (a << b + c); /* { dg-warning "parentheses" "correct warning" } */
23 foo ((a << b) + c);
24 foo (a << (b + c));
25 foo (1 << 2 + c); /* { dg-warning "parentheses" "correct warning" } */
26 foo ((1 << 2) + c);
27 foo (1 << (2 + c));
28 foo (1 << 2 + 3); /* { dg-warning "parentheses" "correct warning" } */
29 foo ((1 << 2) + 3);
30 foo (1 << (2 + 3));
31 foo (a + b >> c); /* { dg-warning "parentheses" "correct warning" } */
32 foo ((a + b) >> c);
33 foo (a + (b >> c));
34 foo (1 + 2 >> c); /* { dg-warning "parentheses" "correct warning" } */
35 foo ((1 + 2) >> c);
36 foo (1 + (2 >> c));
37 foo (1 + 2 >> 3); /* { dg-warning "parentheses" "correct warning" } */
38 foo ((1 + 2) >> 3);
39 foo (1 + (2 >> 3));
40 foo (a >> b + c); /* { dg-warning "parentheses" "correct warning" } */
41 foo ((a >> b) + c);
42 foo (a >> (b + c));
43 foo (1 >> 2 + c); /* { dg-warning "parentheses" "correct warning" } */
44 foo ((1 >> 2) + c);
45 foo (1 >> (2 + c));
46 foo (1 >> 2 + 3); /* { dg-warning "parentheses" "correct warning" } */
47 foo ((1 >> 2) + 3);
48 foo (1 >> (2 + 3));
49 foo (a - b << c); /* { dg-warning "parentheses" "correct warning" } */
50 foo ((a - b) << c);
51 foo (a - (b << c));
52 foo (6 - 5 << c); /* { dg-warning "parentheses" "correct warning" } */
53 foo ((6 - 5) << c);
54 foo (6 - (5 << c));
55 foo (6 - 5 << 4); /* { dg-warning "parentheses" "correct warning" } */
56 foo ((6 - 5) << 4);
57 foo (6 - (5 << 4));
58 foo (a << b - c); /* { dg-warning "parentheses" "correct warning" } */
59 foo ((a << b) - c);
60 foo (a << (b - c));
61 foo (6 << 5 - c); /* { dg-warning "parentheses" "correct warning" } */
62 foo ((6 << 5) - c);
63 foo (6 << (5 - c));
64 foo (6 << 5 - 4); /* { dg-warning "parentheses" "correct warning" } */
65 foo ((6 << 5) - 4);
66 foo (6 << (5 - 4));
67 foo (a - b >> c); /* { dg-warning "parentheses" "correct warning" } */
68 foo ((a - b) >> c);
69 foo (a - (b >> c));
70 foo (6 - 5 >> c); /* { dg-warning "parentheses" "correct warning" } */
71 foo ((6 - 5) >> c);
72 foo (6 - (5 >> c));
73 foo (6 - 5 >> 4); /* { dg-warning "parentheses" "correct warning" } */
74 foo ((6 - 5) >> 4);
75 foo (6 - (5 >> 4));
76 foo (a >> b - c); /* { dg-warning "parentheses" "correct warning" } */
77 foo ((a >> b) - c);
78 foo (a >> (b - c));
79 foo (6 >> 5 - c); /* { dg-warning "parentheses" "correct warning" } */
80 foo ((6 >> 5) - c);
81 foo (6 >> (5 - c));
82 foo (6 >> 5 - 4); /* { dg-warning "parentheses" "correct warning" } */
83 foo ((6 >> 5) - 4);
84 foo (6 >> (5 - 4));