Update copyright year to 2014 by running admin/update-copyright.
[emacs.git] / test / cedet / tests / testsppreplaced.c
blob706753e9ded1379e1e2c0897305d185c84be319d
1 /* testsppreplaced.c --- unit test for CPP/SPP Replacement
2 Copyright (C) 2007-2014 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. */
30 float returnanfloat()
34 /* TEST: Punctuation an be replaced in a definition. */
35 int foo::bar ()
39 /* TEST: Multiple lexical characters in a definition */
40 int mysuper::baz ()
44 /* TEST: Macro replacement. */
45 int increment (int in) {
46 return in+1;
49 /* TEST: Macro replacement with complex args */
50 int myFcn1 ();
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 */
70 int tail (int q) {}
72 /* TEST: macros used improperly */
74 int tail_fcn(int q);
76 /* TEST: feature of CPP from LSD <lsdsgster@...> */
78 int __gthrw_foo (int arg1) { }
80 /* TEST: macros using macros */
81 int foo;
83 /* TEST: macros with args using macros */
84 int noodle(int noodle);
86 /* TEST: Double macro using the argument stack. */
87 int that_foo(int i);
88 int this_foo(int i);
90 /* TEST: The G++ namespace macro hack. Not really part of SPP. */
91 namespace baz {
93 int bazfnc(int b) { }
97 namespace foo { namespace bar {
99 int foo_bar_func(int a) { }
104 /* TEST: The VC++ macro hack. */
105 namespace std {
107 int inside_std_namespace(int a) { }
111 /* TEST: Recursion prevention. CPP doesn't allow even 1 level of recursion. */
112 int MACROA () {
117 /* End */