This commit was manufactured by cvs2svn to create branch
[official-gcc.git] / gcc / testsuite / gcc.dg / wtr-int-type-1.c
blobd44165d90b987ce36d189ae1bde00eda64297e3d
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 "-std=c99 -Wtraditional" } */
7 void
8 testfunc ()
10 long long i;
12 /* Octal and hex values shouldn't issue -Wtraditional warnings. */
13 i = 0x80000000;
14 i = 0xFFFFFFFF;
15 i = 037777777777;
17 i = 0x8000000000000000;
18 i = 0xFFFFFFFFFFFFFFFF;
19 i = 01777777777777777777777;
21 /* Nor should values outside the range of (32-bit) unsigned long but
22 inside the range of long long. [since -traditional has no long long,
23 we can pretend it worked the way it does in C99.] */
24 i = 9223372036854775807;
26 /* But this one should, since it doesn't fit in long (long), but
27 does fit in unsigned long (long). */
28 i = 18446744073709551615; /* { dg-warning "decimal constant|unsigned" "decimal constant" } */
30 # 29 "sys-header.h" 3
31 /* We are in system headers now, no -Wtraditional warnings should issue. */
33 i = 0x80000000;
34 i = 0xFFFFFFFF;
35 i = 037777777777;
37 i = 0x8000000000000000;
38 i = 0xFFFFFFFFFFFFFFFF;
39 i = 01777777777777777777777;
41 i = 9223372036854775807;
42 i = 18446744073709551615;