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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [Wparentheses-5.c] - Blame information for rev 690

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

Line No. Rev Author Line
1 689 jeremybenn
/* Test operation of -Wparentheses.  Precedence warnings.  && inside
2
   ||.  */
3
/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
4
 
5
/* { dg-do compile } */
6
/* { dg-options "-Wparentheses" } */
7
 
8
int foo (int);
9
 
10
int
11
bar (int a, int b, int c)
12
{
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
}

powered by: WebSVN 2.1.0

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