summaryrefslogtreecommitdiff
path: root/libs/wave/test/testwave/testfiles/t_1_027.cpp
blob: 39ccb3acc2b77e6853300225ccc68bc2dccbe0b7 (plain)
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
29
30
31
32
33
34
35
36
37
38
39
40
41
/*=============================================================================
    Boost.Wave: A Standard compliant C++ preprocessor library
    http://www.boost.org/

    Copyright (c) 2001-2012 Hartmut Kaiser. Distributed under the Boost
    Software License, Version 1.0. (See accompanying file
    LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/

// Tests delayed macro expansion (rescanning)

#define CONCAT_1(A, B) A ## B
#define CONCAT_2(A, B) CONCAT_1(A, B)

#define DELAY(NAME) NAME

#define A1 a
#define B1 b

#define A2() a
#define B2() b

#define LHS (
#define RHS )

//R #line 27 "t_1_027.cpp"
DELAY(CONCAT_1)( a, b ) ();             //R ab (); 
DELAY(CONCAT_1)(A1, B1)();              //R A1B1(); 
DELAY(CONCAT_1) LHS A1, B1 RHS ();      //R CONCAT_1 ( a, b )(); 
CONCAT_1 ( a, b ) ();                   //R ab (); 
CONCAT_1 ( A1, B1 ) ();                 //R A1B1 (); 
CONCAT_1 LHS a, b RHS ();               //R CONCAT_1 ( a, b )(); 
//R
DELAY(CONCAT_2)( a, b ) ();             //R ab (); 
DELAY(CONCAT_2)(A1, B1)();              //R ab(); 
DELAY(CONCAT_2) LHS A1, B1 RHS ();      //R CONCAT_2 ( a, b )(); 
DELAY(CONCAT_2)(A2(), B2())();          //R ab(); 
CONCAT_2 ( a, b ) ();                   //R ab (); 
CONCAT_2 ( A1, B1 ) ();                 //R ab (); 
CONCAT_2 LHS a, b RHS ();               //R CONCAT_2 ( a, b )(); 
CONCAT_2(A2(), B2())();                 //R ab();