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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [torture/] [pr30364-3.c] - Blame information for rev 774

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

Line No. Rev Author Line
1 689 jeremybenn
/* { dg-do run } */
2
/* { dg-options "-fwrapv" } */
3
 
4
#include <limits.h>
5
extern void abort (void);
6
 
7
int f(int a, int b)
8
{
9
  if (a > INT_MAX - 15) return 0;
10
  if (b > INT_MAX - 15) return 0;
11
 
12
  int c = (a - 20) + (b - 20);
13
  return c > INT_MAX - 15;
14
}
15
 
16
int main()
17
{
18
  if (f (INT_MAX - 15, 41) != 1)
19
    abort ();
20
  return 0;
21
}

powered by: WebSVN 2.1.0

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