Document gcov-io (PR gcov-profile/84735).
[official-gcc.git] / gcc / testsuite / gcc.dg / cpp / lexnum.c
blob3d7a9a8ddf8787d3233ebe8de657dfb460936597
1 /* Copyright (C) 2000 Free Software Foundation, Inc. */
3 /* { dg-do run } */
4 /* { dg-options "-trigraphs" } */
6 /* Test lexing of numbers. */
8 #if DEBUG
9 extern int puts (const char *);
10 #else
11 #define puts(X)
12 #endif
13 extern void abort (void);
14 #define err(str) do { puts(str); abort(); } while (0)
16 /* Escaped newlines. */
17 #define foo 12\
20 4??/
23 #if foo != 12345
24 #error foo
25 #endif
27 int main (int argc, char *argv[])
29 double a = 5.;
30 double x = .5;
32 /* Decimal points, including initially and immediately before and
33 after an escaped newline. */
34 if (a != 5)
35 err ("a");
36 if (x != .\
38 err ("x != .5");
39 x = 25\
42 if (x != 25.6)
43 err ("x != 25.6");
45 /* Test exponentials and their signs. A buggy lexer is more likely
46 to fail the compile, but never mind. */
47 if (250 != 25e+1 || 250 != 25e1 || 250 != 2500e-1)
48 err ("exponentials");
50 /* Todo: p exponentials, and how to test preprocessing number
51 tokenisation? */
53 return 0;