root/test/lisp/cedet/semantic-utest-ia-resources/testsppcomplete.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. main
  2. function_with_macro_name
  3. use_macro

     1 /* testesppcomplete.cpp --- semantic-ia-utest completion engine unit tests
     2 
     3    Copyright (C) 2008-2023 Free Software Foundation, Inc.
     4 
     5    Author: Eric M. Ludlam <zappo@gnu.org>
     6 
     7    This file is part of GNU Emacs.
     8 
     9    GNU Emacs is free software: you can redistribute it and/or modify
    10    it under the terms of the GNU General Public License as published by
    11    the Free Software Foundation, either version 3 of the License, or
    12    (at your option) any later version.
    13 
    14    GNU Emacs is distributed in the hope that it will be useful,
    15    but WITHOUT ANY WARRANTY; without even the implied warranty of
    16    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    17    GNU General Public License for more details.
    18 
    19    You should have received a copy of the GNU General Public License
    20    along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.
    21 */
    22 
    23 /* Example provided by Hannes Janetzek */
    24 
    25 struct Test { int test; };
    26 
    27 #define BLA(_type) \
    28   _type *bla = (_type*) malloc(sizeof(_type));
    29 
    30 #define BLUB(_type)                             \
    31   (_type*)malloc(sizeof(_type));
    32 
    33 #define FOO(_type)                              \
    34   _type *foo = BLUB(_type);
    35 
    36 #define BAR(_type)                              \
    37   _type *bar = (*_type)BLUB(_type);
    38 
    39 int main(int argc, char *argv[]) {
    40   BLA(Test);
    41   bla->// -1-
    42     ; // #1# ( "test" )
    43 
    44   FOO(Test);
    45   foo->// -2-
    46     ; // #2# ( "test" )
    47 
    48   BAR(Test);
    49   bar->// -3-
    50     ; // #3# ( "test" )
    51 }
    52 
    53 /* Test symref and macros together. */
    54 
    55 // This function exists only so we can have a comment in a tag with this name.
    56 void function_with_macro_name ()
    57 // %1% ( ( "testsppcomplete.c" ) ( "function_with_macro_name" "function_with_macro_name" "use_macro") )
    58 // Note: fwmn is in twice, once for function, and once for the constant macro below.
    59 {
    60 }
    61 
    62 #define function_with_macro_name 1
    63 
    64 int use_macro () {
    65   int a = function_with_macro_name;
    66 }

/* [<][>][^][v][top][bottom][index][help] */