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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [fixed-point/] [int-warning.c] - Rev 689

Compare with Previous | Blame | View Log

/* { dg-do compile } */
/* { dg-options "-std=gnu99 -O2" } */
 
/* N1169 Conversion from fixed-point to integer.
   Test if GCC warns when overflow or underflow.  */
 
signed char sc;
unsigned char uc;
 
void test()
{
  sc = 500k; /* { dg-warning "overflow in implicit constant conversion" } */
  sc = -500k; /* { dg-warning "overflow in implicit constant conversion" } */
  sc = 500lk; /* { dg-warning "overflow in implicit constant conversion" } */
  sc = -500lk; /* { dg-warning "overflow in implicit constant conversion" } */
  sc = 500llk; /* { dg-warning "overflow in implicit constant conversion" } */
  sc = -500llk; /* { dg-warning "overflow in implicit constant conversion" } */
  uc = 500k; /* { dg-warning "overflow in implicit constant conversion" } */
  uc = -500k; /* { dg-warning "overflow in implicit constant conversion" } */
  uc = 500lk; /* { dg-warning "overflow in implicit constant conversion" } */
  uc = -500lk; /* { dg-warning "overflow in implicit constant conversion" } */
  uc = 500llk; /* { dg-warning "overflow in implicit constant conversion" } */
  uc = -500llk; /* { dg-warning "overflow in implicit constant conversion" } */
}
 

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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