OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [Wparentheses-10.c] - Blame information for rev 303

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* Test operation of -Wparentheses.  Warnings for assignments used as
2
   truth-values shouldn't apply other than for plain assignment.  */
3
/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
4
 
5
/* { dg-do compile } */
6
/* { dg-options "-Wparentheses -std=gnu99" } */
7
 
8
int foo (int);
9
 
10
int a, b, c;
11
_Bool d;
12
 
13
void
14
bar (void)
15
{
16
  if (a += b)
17
    foo (0);
18
  if (a -= a)
19
    foo (1);
20
  if (b *= c)
21
    foo (2);
22
  else
23
    foo (3);
24
  if (b /= b)
25
    foo (4);
26
  else
27
    foo (5);
28
  while (c %= b)
29
    foo (6);
30
  while (c <<= c)
31
    foo (7);
32
  do foo (8); while (a >>= b);
33
  do foo (9); while (a &= a);
34
  for (;c ^= b;)
35
    foo (10);
36
  for (;c |= c;)
37
    foo (11);
38
  d = a += b;
39
  foo (12);
40
  d = a -= a;
41
  foo (13);
42
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.