Changeset 56b47b9 for tests


Ignore:
Timestamp:
Mar 6, 2024, 11:15:34 AM (9 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
1df26c3
Parents:
7e13b11
Message:

add updated function-declaration test

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/functions.cfa

    r7e13b11 r56b47b9  
    1010// Created On       : Wed Aug 17 08:39:58 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Nov  6 17:54:09 2018
    13 // Update Count     : 13
     12// Last Modified On : Tue Mar  5 11:02:25 2024
     13// Update Count     : 34
    1414//
    1515
    1616// ANSI function definitions
    1717
    18 void h(void) {}
     18void h( void ) {}
    1919
    2020int f (
    21         int (void),
    22         int (int),
    23         int ((void)),
    24         int ((int)),
    25         void g(void)
    26         ) {
    27         (* g)();
     21        int ( void ),
     22        int ( int ),
     23        int (( void )),
     24        int (( int )),
     25        void g( void )
     26) {
     27        (*g)();
    2828        g();
    2929        g = h;
     
    3232int f1() {}
    3333int (f2()) {}
    34 int (* f3())() {}
     34int (*f3())() {}
    3535int * ((f4())) {}
    36 int ((* f5()))() {}
     36int ((*f5()))() {}
    3737int * f6() {}
    38 int * (f7)() {}
     38int * ( f7)() {}
    3939int ** f8() {}
    40 int * const * (f9)() {}
     40int * const * ( f9)() {}
    4141int (* f10())[] {}
    4242int (* f11())[][3] {}
     
    6666// Cforall extensions
    6767
    68 // [] f( );
    69 [int] f( );
    70 // [] f(int);
    71 [int] f(int);
    72 // [] f( ) {}
    73 [int] f( ) {}
    74 // [] f(int) {}
    75 [int] f(int) {}
    76 
    77 [int x] f( );
    78 // [] f(int x);
    79 //[int x] f(int x);
    80 //[int x] f( ) {}
    81 // [] f(int x) {}
    82 //[int x] f(int x) {}
    83 
    84 [int, int x] f( );
    85 // [] f(int, int x);
    86 [int, int x] f(int, int x);
    87 [int, int x] f( ) {}
    88 // [] f(int, int x) {}
    89 [int, int x] f(int, int x) {}
    90 
    91 [int, int x, int] f( );
    92 // [] f(int, int x, int);
    93 [int, int x, int] f(int, int x, int);
    94 [int, int x, int] f( ) {}
    95 // [] f(int, int x, int) {}
    96 [int, int x, int] f(int, int x, int) {}
    97 
    98 [int, int x, * int y] f( );
    99 // [] f(int, int x, * int y);
    100 [int, int x, * int y] f(int, int x, * int y);
    101 [int, int x, * int y] f( ) {}
    102 // [] f(int, int x, * int y) {}
    103 [int, int x, * int y] f(int, int x, * int y) {}
     68[] f();
     69[void] f();
     70[int] f();
     71[] f( int );
     72[void] f( int );
     73[int] f( int );
     74[] f() {}
     75[void] fv() {}
     76[int] f() {}
     77[] f( int ) {}
     78[void] fv( int ) {}
     79[int] f( int ) {}
     80
     81[int x] f();
     82[] f( int x );
     83[void] fv( int x );
     84//[int x] f( int x );
     85//[int x] f() {}
     86[] f2( int x ) {}
     87[void] fv1( int x ) {}
     88//[int x] f( int x ) {}
     89
     90[int, int x] f();
     91[] f( int, int x );
     92[void] fv( int, int x );
     93[int, int x] f( int, int x );
     94[int, int x] f() {}
     95[] f( int, int x ) {}
     96[void] fv( int, int x ) {}
     97[int, int x] f( int, int x ) {}
     98
     99[int, int x, int] f();
     100[] f( int, int x, int );
     101[void] fv( int, int x, int );
     102[int, int x, int] f( int, int x, int );
     103[int, int x, int] f() {}
     104[] f( int, int x, int ) {}
     105[void] fv( int, int x, int ) {}
     106[int, int x, int] f( int, int x, int ) {}
     107
     108[int, int x, * int y] f();
     109[] f( int, int x, * int y );
     110[void] fv( int, int x, * int y );
     111[int, int x, * int y] f( int, int x, * int y );
     112[int, int x, * int y] f() {}
     113[] f( int, int x, * int y ) {}
     114[void] fv( int, int x, * int y ) {}
     115[int, int x, * int y] f( int, int x, * int y ) {}
    104116
    105117// function prototypes
     
    116128        int ( int, int p ),
    117129        [int](int)
    118         ) {
    119         int (* (* pc)[][10])[][3];
     130) {
     131        int (* (* pc )[][10])[][3];
    120132        * [][10] * [][3] int p;
    121         * [] * [int](int) p;
     133        * [] * [int]( int ) p;
    122134}
    123135
     
    149161        int * const * const ([]),
    150162        int * const * const ([10])
    151         );
     163);
    152164
    153165int f(
     
    170182        int * const * const ([]),
    171183        int * const * const ([10])
    172         ) {
    173 }
     184) {}
    174185
    175186typedef int T;
    176187
    177 int f( T (* f), T t ) {
    178         T (T);
     188int f( T ( *f ), T t ) {
     189        T ( T );
    179190}
    180191
Note: See TracChangeset for help on using the changeset viewer.