1 /* Test for -Wtraditional warnings on integer constant types.
2 Note, gcc should omit these warnings in system header files.
3 By Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 8/22/2000. */
4 /* { dg-do compile } */
5 /* { dg-options "-Wtraditional" } */
12 /* Octal and hex values shouldn't issue -Wtraditional warnings. */
17 i = 0x8000000000000000;
18 i = 0xFFFFFFFFFFFFFFFF;
19 i = 01777777777777777777777;
21 /* We expect to get either a "width of integer constant changes with
22 -traditional" warning or an "integer constant is unsigned in ISO
23 C, signed with -traditional" warning depending on whether we are
24 testing on a 32 or 64 bit platform. Either warning means the
25 test passes and both matched by checking for "integer constant". */
26 i = 18446744073709551615; /* { dg-warning "integer constant" "integer constant" } */
28 #line 29 "sys-header.h" 3
29 /* We are in system headers now, no -Wtraditional warnings should issue. */
35 i = 0x8000000000000000;
36 i = 0xFFFFFFFFFFFFFFFF;
37 i = 01777777777777777777777;
39 i = 9223372036854775807;
40 i = 18446744073709551615;
43 /* Ignore "decimal constant is so large that it is unsigned" warnings. */
44 /* { dg-warning "decimal constant" "decimal constant" { target *-*-* } 26 } */
45 /* { dg-warning "decimal constant" "decimal constant" { target *-*-* } 40 } */