testvarnames.c 2.2 KB

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