2014-07-29 Ed Smith-Rowland <3dw4rd@verizon.net>
[official-gcc.git] / gcc / testsuite / gcc.dg / wtr-suffix-1.c
blobed0b40ecf301dd83bac522d2213ee0cc33b10c21
1 /* Test for -Wtraditional warnings on integer constant suffixes.
2 Note, gcc should omit these warnings in system header files.
3 Origin: Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 8/24/2000. */
4 /* { dg-do compile } */
5 /* { dg-options "-Wtraditional" } */
7 void
8 testfunc ()
10 int i;
11 double f;
13 i = 1L;
14 i = 1l;
15 i = 1U; /* { dg-warning "traditional C rejects" "numeric constant suffix" } */
16 i = 1u; /* { dg-warning "traditional C rejects" "numeric constant suffix" } */
17 f = 1.0;
18 f = 1.0F; /* { dg-warning "traditional C rejects" "numeric constant suffix" } */
19 f = 1.0f; /* { dg-warning "traditional C rejects" "numeric constant suffix" } */
20 f = 1.0L; /* { dg-warning "traditional C rejects" "numeric constant suffix" } */
21 f = 1.0l; /* { dg-warning "traditional C rejects" "numeric constant suffix" } */
23 # 24 "sys-header.h" 3
24 /* We are in system headers now, no -Wtraditional warnings should issue. */
26 i = 1L;
27 i = 1l;
28 i = 1U;
29 i = 1u;
30 f = 1.0;
31 f = 1.0F;
32 f = 1.0f;
33 f = 1.0L;
34 f = 1.0l;