File: n_token.C

package info (click to toggle)
mcpp 2.7.1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 8,024 kB
  • ctags: 29,151
  • sloc: ansic: 35,191; sh: 9,231; makefile: 176; cpp: 84; exp: 18
file content (27 lines) | stat: -rw-r--r-- 876 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* n_token.C:   special pp-token in C++ */

#define str( a)     xstr( a)
#define xstr( a)    # a
#define paste( a, b)    a ## b

/* token.1: '::' is a token in C++, although illegal token sequence
    in C    */
    /* "::";    */
    str( paste( :, :));

/* token.2: 'and', 'or', 'not', etc. are tokens in C++, although in C
    these are macros defined by <iso646.h>  */
    /* "xor";   */
#if 1 and 2 or not 3
    str( xor);
#endif

/* { dg-do preprocess }
   { dg-options "-std=c++98" }
   { dg-final { if ![file exist n_token.i] { return }                   } }
   { dg-final { if \{ [grep n_token.i "\"::\""] != ""           \} \{   } }
   { dg-final { if \{ [grep n_token.i "\"xor\""] != ""          \} \{   } }
   { dg-final { return \} \}                                            } }
   { dg-final { fail "n_token.C: C++ tokens"                            } }
 */