File: n_1.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 (28 lines) | stat: -rw-r--r-- 741 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
28
/* n_1.c:   Conversion of trigraph sequences.   */

#include    "defs.h"

char    quasi_trigraph[] = { '?', '?', ' ', '?', '?', '?', ' ', '?', '?', '%',
            ' ', '?', '?', '^', ' ', '?', '#', '\0' };

main( void)
{
    int     ab = 1, cd = 2;

    fputs( "started\n", stderr);

/* 1.1: The following 9 sequences are valid trigraph sequences. */
    assert( strcmp( "??( ??) ??/??/ ??' ??< ??> ??! ??- ??="
            ,"[ ] \\ ^ { } | ~ #") == 0);

/* 1.2: In directive line.  */
??= define  OR( a, b)   a ??! b
    assert( OR( ab, cd) == 3);

/* 1.3: Any sequence other than above 9 is not a trigraph sequence. */
    assert( strcmp( "?? ??? ??% ??^ ???=", quasi_trigraph) == 0);

    fputs( "success\n", stderr);
    return  0;
}