1 /* testsppreplaced.c --- unit test for CPP/SPP Replacement
2 Copyright (C) 2007-2011 Free Software Foundation, Inc.
4 Author: Eric M. Ludlam <eric@siege-engine.com>
6 This file is part of GNU Emacs.
8 GNU Emacs is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
13 GNU Emacs is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
22 /* What the SPP replace file would looklike with MACROS replaced: */
24 /* TEST: The EMU keyword doesn't screw up the function defn. */
25 char parse_around_emu ()
29 /* TEST: A simple word can be replaced in a definition. */
34 /* TEST: Punctuation an be replaced in a definition. */
39 /* TEST: Multiple lexical characters in a definition */
44 /* TEST: Macro replacement. */
45 int increment (int in
) {
49 /* TEST: Macro replacement with complex args */
52 int myFcn2 (int a
, int b
);
53 int myFcn3 (int a
, int b
);
55 /* TEST: Multiple args to a macro. */
56 struct ma_struct
{ int moose
; int penguin
; int emu
; };
58 /* TEST: Macro w/ args, but no body. */
60 /* TEST: Not a macro with args, but close. */
61 int not_with_args_fcn (moose
)
65 /* TEST: macro w/ continuation. */
66 int continuation_symbol () { };
68 /* TEST: macros in a macro - tail processing */
72 /* TEST: macros used impropertly. */
76 /* TEST: feature of CPP from LSD <lsdsgster@...> */
78 int __gthrw_foo (int arg1
) { }
80 /* TEST: macros using macros */
83 /* TEST: macros with args using macros */
84 int noodle(int noodle
);
86 /* TEST: Double macro using the argument stack. */
90 /* TEST: The G++ namespace macro hack. Not really part of SPP. */
97 namespace foo
{ namespace bar
{
99 int foo_bar_func(int a
) { }
104 /* TEST: The VC++ macro hack. */
107 int inside_std_namespace(int a
) { }
111 /* TEST: Recursion prevention. CPP doesn't allow even 1 level of recursion. */