~ubuntu-branches/ubuntu/edgy/mcpp/edgy

« back to all changes in this revision

Viewing changes to test-c/n_30.c

  • Committer: Bazaar Package Importer
  • Author(s): NIIBE Yutaka
  • Date: 2004-10-23 23:18:57 UTC
  • Revision ID: james.westby@ubuntu.com-20041023231857-93z8ff2dgp7m7dpy
Tags: upstream-2.4.1
ImportĀ upstreamĀ versionĀ 2.4.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* n_30.c:  Macro calls.    */
 
2
/*  Note:   Comma separate the arguments of function-like macro call,
 
3
        but comma between matching inner parenthesis doesn't.  This feature
 
4
        is tested on so many places in this suite especially on *.c samples
 
5
        which use assert() macro, that no separete item to test this feature
 
6
        is provided.    */
 
7
 
 
8
#include    "defs.h"
 
9
 
 
10
#define FUNC( a, b, c)      a + b + c
 
11
 
 
12
main( void)
 
13
{
 
14
    int     a = 1, b = 2, c = 3;
 
15
 
 
16
    fputs( "started\n", stderr);
 
17
 
 
18
/* 30.1:    A macro call crossing lines.    */
 
19
    assert
 
20
    (
 
21
        FUNC
 
22
        (
 
23
            a,
 
24
            b,
 
25
            c
 
26
        )
 
27
        == 6
 
28
    );
 
29
 
 
30
    fputs( "success\n", stderr);
 
31
    return  0;
 
32
}
 
33