Commit | Line | Data |
---|---|---|
a4100ebe CY |
1 | /* testvarnames.cpp |
2 | Test variable and function names, lists of variables on one line, etc. | |
3 | ||
ab422c4d | 4 | Copyright (C) 2008-2013 Free Software Foundation, Inc. |
a4100ebe CY |
5 | |
6 | Author: Eric M. Ludlam <eric@siege-engine.com> | |
7 | ||
8 | This file is part of GNU Emacs. | |
9 | ||
10 | GNU Emacs is free software: you can redistribute it and/or modify | |
11 | it under the terms of the GNU General Public License as published by | |
12 | the Free Software Foundation, either version 3 of the License, or | |
13 | (at your option) any later version. | |
14 | ||
15 | GNU Emacs is distributed in the hope that it will be useful, | |
16 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 | GNU General Public License for more details. | |
19 | ||
20 | You should have received a copy of the GNU General Public License | |
21 | along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. | |
22 | */ | |
74ea13c1 CY |
23 | |
24 | struct independent { | |
25 | int indep_1; | |
26 | int indep_2; | |
27 | }; | |
28 | ||
29 | struct independent var_indep_struct; | |
30 | ||
31 | struct { | |
32 | int unnamed_1; | |
33 | int unnamed_2; | |
22bcf204 | 34 | } var_unnamed_struct; |
74ea13c1 CY |
35 | |
36 | struct { | |
37 | int unnamed_3; | |
38 | int unnamed_4; | |
39 | } var_un_2, var_un_3; | |
40 | ||
41 | struct inlinestruct { | |
42 | int named_1; | |
43 | int named_2; | |
44 | } var_named_struct; | |
45 | ||
46 | struct inline2struct { | |
47 | int named_3; | |
48 | int named_4; | |
49 | } var_n_2, var_n_3; | |
50 | ||
51 | /* Structures with names that then declare variables | |
52 | * should also be completable. | |
53 | * | |
54 | * Getting this to work is the bugfix in semantic-c.el CVS v 1.122 | |
55 | */ | |
56 | struct inlinestruct in_var1; | |
57 | struct inline2struct in_var2; | |
58 | ||
59 | int test_1(int var_arg1) { | |
60 | ||
61 | var_// -1- | |
22bcf204 | 62 | ; // #1# ("var_arg1" "var_indep_struct" "var_n_2" "var_n_3" "var_named_struct" "var_un_2" "var_un_3" "var_unnamed_struct") |
74ea13c1 CY |
63 | |
64 | var_indep_struct.// -2- | |
65 | ; // #2# ( "indep_1" "indep_2" ) | |
66 | ||
22bcf204 | 67 | var_unnamed_struct.// -3- |
74ea13c1 CY |
68 | ; // #3# ( "unnamed_1" "unnamed_2" ) |
69 | ||
70 | var_named_struct.// -4- | |
71 | ; // #4# ( "named_1" "named_2" ) | |
72 | ||
73 | var_un_2.// -5- | |
74 | ; // #5# ( "unnamed_3" "unnamed_4" ) | |
75 | var_un_3.// -6- | |
76 | ; // #6# ( "unnamed_3" "unnamed_4" ) | |
77 | ||
78 | var_n_2.// -7- | |
79 | ; // #7# ( "named_3" "named_4" ) | |
80 | var_n_3.// -8- | |
81 | ; // #8# ( "named_3" "named_4" ) | |
82 | ||
83 | in_// -9- | |
84 | ; // #9# ( "in_var1" "in_var2" ) | |
85 | ||
86 | in_var1.// -10- | |
87 | ; // #10# ( "named_1" "named_2") | |
88 | in_var2.// -11- | |
89 | ; // #11# ( "named_3" "named_4") | |
90 | } |