summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/warn/skip-2.C
blob: 28f9049a9adc43ad472420c7793725dcc5f50879 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// { dg-do compile }
// { dg-options "-Wall" }

extern int f2(int);
extern void f3();
void
f1(int i)
{
  if (1 == 1 || f2(i >> -10))
    f3();
  if (1 == 1 || f2(i >> 128))
    f3();
  if (1 == 1 || f2(i << -10))
    f3();
  if (1 == 1 || f2(i << 128))
    f3();
  if (1 == 1 || i < 0xffffffff)
    f3();
  if (1 == 1 || i >= -0x80000000)
    f3();
  if (1 == 0 && f2(i >> -10))
    f3();
  if (1 == 0 && f2(i >> 128))
    f3();
  if (1 == 0 && f2(i << -10))
    f3();
  if (1 == 0 && f2(i << 128))
    f3();
  if (1 == 0 && i < 0xffffffff)
    f3();
  if (1 == 0 && i >= -0x80000000)
    f3();
  if (1 == 1 && f2(i >> -10))	/* { dg-warning "shift count is negative" } */
    f3();
  if (1 == 0 || f2(i << -10))	/* { dg-warning "shift count is negative" } */
    f3();
}