File: n_11.t

package info (click to toggle)
mcpp 2.7.2-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 8,152 kB
  • ctags: 29,136
  • sloc: ansic: 35,238; sh: 9,241; makefile: 176; cpp: 84; exp: 18
file content (28 lines) | stat: -rw-r--r-- 563 bytes parent folder | download | duplicates (7)
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
28
/* n_11.t:  Operator "defined" in #if or #elif directive.   */

#define MACRO_abc   abc
#define MACRO_0     0
#define ZERO_TOKEN

/* 11.1:    */
/*  abc;    */
/*  abc;    */
#if     defined a
    a;
#else
    MACRO_abc;
#endif
#if     defined (MACRO_abc)
    MACRO_abc;
#else
    0;
#endif

/* 11.2:    "defined" is an unary operator whose result is 1 or 0.  */
#if     defined MACRO_0 * 3 != 3
    Bad handling of "defined" operator.
#endif
#if     (!defined ZERO_TOKEN != 0) || (-defined ZERO_TOKEN != -1)
    Bad grouping of "defined", !, - operator.
#endif