URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Go to most recent revision |
Details |
Compare with Previous |
View Log
Line No. |
Rev |
Author |
Line |
1 |
689 |
jeremybenn |
/* { dg-do compile } */
|
2 |
|
|
/* { dg-options "-std=gnu99 -O2" } */
|
3 |
|
|
|
4 |
|
|
/* N1169 Conversion from fixed-point to integer.
|
5 |
|
|
Test if GCC warns when overflow or underflow. */
|
6 |
|
|
|
7 |
|
|
signed char sc;
|
8 |
|
|
unsigned char uc;
|
9 |
|
|
|
10 |
|
|
void test()
|
11 |
|
|
{
|
12 |
|
|
sc = 500k; /* { dg-warning "overflow in implicit constant conversion" } */
|
13 |
|
|
sc = -500k; /* { dg-warning "overflow in implicit constant conversion" } */
|
14 |
|
|
sc = 500lk; /* { dg-warning "overflow in implicit constant conversion" } */
|
15 |
|
|
sc = -500lk; /* { dg-warning "overflow in implicit constant conversion" } */
|
16 |
|
|
sc = 500llk; /* { dg-warning "overflow in implicit constant conversion" } */
|
17 |
|
|
sc = -500llk; /* { dg-warning "overflow in implicit constant conversion" } */
|
18 |
|
|
uc = 500k; /* { dg-warning "overflow in implicit constant conversion" } */
|
19 |
|
|
uc = -500k; /* { dg-warning "overflow in implicit constant conversion" } */
|
20 |
|
|
uc = 500lk; /* { dg-warning "overflow in implicit constant conversion" } */
|
21 |
|
|
uc = -500lk; /* { dg-warning "overflow in implicit constant conversion" } */
|
22 |
|
|
uc = 500llk; /* { dg-warning "overflow in implicit constant conversion" } */
|
23 |
|
|
uc = -500llk; /* { dg-warning "overflow in implicit constant conversion" } */
|
24 |
|
|
}
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.