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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [overflow-warn-6.c] - Blame information for rev 689

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
/* Test non-constant operands in overflowed expressions.  */
2
/* { dg-do compile } */
3
/* { dg-options "-std=c99 -Woverflow" } */
4
 
5
#include <limits.h>
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.