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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [warn/] [overflow-warn-6.C] - Blame information for rev 774

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

Line No. Rev Author Line
1 693 jeremybenn
/* Test non-constant operands in overflowed expressions.  */
2
/* { dg-do compile } */
3
/* { dg-options "-Woverflow" } */
4
 
5
#include 
6
 
7
int
8
h1 (int x)
9
{
10
  return x * (0 * (INT_MAX + 1)); /* { dg-warning "integer overflow in expression" } */
11
}
12
 
13
int
14
h2 (int x)
15
{
16
  return ((INT_MAX + 1) * 0) * x; /* { dg-warning "integer overflow in expression" } */
17
}
18
 

powered by: WebSVN 2.1.0

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