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

« back to all changes in this revision

Viewing changes to test-c/n_23.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_23.c:  ## operator in macro definition.    */
 
2
 
 
3
#include    "defs.h"
 
4
 
 
5
#define glue( a, b)     a ## b
 
6
#define xglue( a, b)    glue( a, b)
 
7
#define MACRO_0     0
 
8
#define MACRO_1     1
 
9
 
 
10
main( void)
 
11
{
 
12
    int     xy = 1;
 
13
 
 
14
    fputs( "started\n", stderr);
 
15
 
 
16
/* 23.1:    */
 
17
    assert( glue( x, y) == 1);
 
18
 
 
19
/* 23.2:    Generate a preprocessing number.    */
 
20
#define EXP     2
 
21
    assert( xglue( .12e+, EXP) == 12.0);
 
22
 
 
23
    fputs( "success\n", stderr);
 
24
    return  0;
 
25
}
 
26