Mercurial > emacs
annotate test/cedet/tests/testsppreplaced.c @ 108252:623b349bb7c2
Merge from mainline.
author | Katsumi Yamaoka <yamaoka@jpl.org> |
---|---|
date | Thu, 06 May 2010 03:24:12 +0000 |
parents | 89eccb374dec |
children | 376148b31b5e |
rev | line source |
---|---|
107698
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
1 /* testsppreplaced.c --- unit test for CPP/SPP Replacement |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
2 Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc. |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
3 |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
4 Author: Eric M. Ludlam <eric@siege-engine.com> |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
5 |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
6 This file is part of GNU Emacs. |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
7 |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
8 GNU Emacs is free software: you can redistribute it and/or modify |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
9 it under the terms of the GNU General Public License as published by |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
10 the Free Software Foundation, either version 3 of the License, or |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
11 (at your option) any later version. |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
12 |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
13 GNU Emacs is distributed in the hope that it will be useful, |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
14 but WITHOUT ANY WARRANTY; without even the implied warranty of |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
16 GNU General Public License for more details. |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
17 |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
18 You should have received a copy of the GNU General Public License |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
19 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
20 */ |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
21 |
89eccb374dec
Update Semantic test copyrights, delete some test files (Bug#4656).
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
22 /* What the SPP replace file would looklike with MACROS replaced: */ |
104494 | 23 |
24 /* TEST: The EMU keyword doesn't screw up the function defn. */ | |
25 char parse_around_emu () | |
26 { | |
27 } | |
28 | |
29 /* TEST: A simple word can be replaced in a definition. */ | |
30 float returnanfloat() | |
31 { | |
32 } | |
33 | |
34 /* TEST: Punctuation an be replaced in a definition. */ | |
35 int foo::bar () | |
36 { | |
37 } | |
38 | |
39 /* TEST: Multiple lexical characters in a definition */ | |
40 int mysuper::baz () | |
41 { | |
42 } | |
43 | |
44 /* TEST: Macro replacement. */ | |
45 int increment (int in) { | |
46 return in+1; | |
47 } | |
48 | |
49 /* TEST: Macro replacement with complex args */ | |
50 int myFcn1 (); | |
51 | |
52 int myFcn2 (int a, int b); | |
53 int myFcn3 (int a, int b); | |
54 | |
55 /* TEST: Multiple args to a macro. */ | |
56 struct ma_struct { int moose; int penguin; int emu; }; | |
57 | |
58 /* TEST: Macro w/ args, but no body. */ | |
59 | |
60 /* TEST: Not a macro with args, but close. */ | |
61 int not_with_args_fcn (moose) | |
62 { | |
63 } | |
64 | |
65 /* TEST: macro w/ continuation. */ | |
66 int continuation_symbol () { }; | |
67 | |
68 /* TEST: macros in a macro - tail processing */ | |
69 | |
70 int tail (int q) {} | |
71 | |
72 /* TEST: macros used impropertly. */ | |
73 | |
74 int tail_fcn(int q); | |
75 | |
76 /* TEST: feature of CPP from LSD <lsdsgster@...> */ | |
77 | |
78 int __gthrw_foo (int arg1) { } | |
79 | |
80 /* TEST: macros using macros */ | |
81 int foo; | |
82 | |
83 /* TEST: macros with args using macros */ | |
84 int noodle(int noodle); | |
85 | |
86 /* TEST: Double macro using the argument stack. */ | |
87 int that_foo(int i); | |
88 int this_foo(int i); | |
89 | |
90 /* TEST: The G++ namespace macro hack. Not really part of SPP. */ | |
91 namespace baz { | |
92 | |
93 int bazfnc(int b) { } | |
94 | |
95 } | |
96 | |
97 namespace foo { namespace bar { | |
98 | |
99 int foo_bar_func(int a) { } | |
100 | |
101 } | |
102 } | |
103 | |
104 /* TEST: The VC++ macro hack. */ | |
105 namespace std { | |
106 | |
107 int inside_std_namespace(int a) { } | |
108 | |
109 } | |
110 | |
111 /* TEST: Recursion prevention. CPP doesn't allow even 1 level of recursion. */ | |
112 int MACROA () { | |
113 | |
114 } | |
115 | |
116 | |
117 /* End */ | |
105377 | 118 |
119 /* arch-tag: fbc5621d-769c-45d0-b924-6c56743189e5 | |
120 (do not change this comment) */ |