1139823Simp/* { dg-do compile } */ 21541Srgrimes/* { dg-options "-std=gnu99 -O2" } */ 31541Srgrimes 41541Srgrimes/* N1169 Conversion from fixed-point to integer. 51541Srgrimes Test if GCC warns when overflow or underflow. */ 61541Srgrimes 71541Srgrimessigned char sc; 81541Srgrimesunsigned char uc; 91541Srgrimes 101541Srgrimesvoid test() 111541Srgrimes{ 121541Srgrimes sc = 500k; /* { dg-warning "overflow in implicit constant conversion" } */ 131541Srgrimes sc = -500k; /* { dg-warning "overflow in implicit constant conversion" } */ 141541Srgrimes sc = 500lk; /* { dg-warning "overflow in implicit constant conversion" } */ 151541Srgrimes sc = -500lk; /* { dg-warning "overflow in implicit constant conversion" } */ 161541Srgrimes sc = 500llk; /* { dg-warning "overflow in implicit constant conversion" } */ 171541Srgrimes sc = -500llk; /* { dg-warning "overflow in implicit constant conversion" } */ 181541Srgrimes uc = 500k; /* { dg-warning "overflow in implicit constant conversion" } */ 191541Srgrimes uc = -500k; /* { dg-warning "overflow in implicit constant conversion" } */ 201541Srgrimes uc = 500lk; /* { dg-warning "overflow in implicit constant conversion" } */ 211541Srgrimes uc = -500lk; /* { dg-warning "overflow in implicit constant conversion" } */ 221541Srgrimes uc = 500llk; /* { dg-warning "overflow in implicit constant conversion" } */ 231541Srgrimes uc = -500llk; /* { dg-warning "overflow in implicit constant conversion" } */ 241541Srgrimes} 251541Srgrimes