OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc3/] [gcc/] [testsuite/] [g++.dg/] [warn/] [Wparentheses-8.C] - Blame information for rev 516

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 301 jeremybenn
// { dg-do compile }
2
// { dg-options "-Wparentheses" }
3
 
4
// C++ version of gcc.dg/Wparentheses-5.c
5
 
6
int foo (int);
7
 
8
int
9
bar (int a, int b, int c)
10
{
11
  foo (a && b || c); // { dg-warning "parentheses" "correct warning" }
12
  foo ((a && b) || c);
13
  foo (a && (b || c));
14
  foo (1 && 2 || c); // { dg-warning "parentheses" "correct warning" }
15
  foo ((1 && 2) || c);
16
  foo (1 && (2 || c));
17
  foo (1 && 2 || 3); // { dg-warning "parentheses" "correct warning" }
18
  foo ((1 && 2) || 3);
19
  foo (1 && (2 || 3));
20
  foo (a || b && c); // { dg-warning "parentheses" "correct warning" }
21
  foo ((a || b) && c);
22
  foo (a || (b && c));
23
  foo (1 || 2 && c); // { dg-warning "parentheses" "correct warning" }
24
  foo ((1 || 2) && c);
25
  foo (1 || (2 && c));
26
  foo (1 || 2 && 3); // { dg-warning "parentheses" "correct warning" }
27
  foo ((1 || 2) && 3);
28
  foo (1 || (2 && 3));
29
}

powered by: WebSVN 2.1.0

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