Changeset 8a919cf for tests/array.cfa


Ignore:
Timestamp:
May 25, 2023, 6:44:01 PM (12 months ago)
Author:
Michael Brooks <mlbrooks@…>
Branches:
ast-experimental, master
Children:
687b663, c26bea2a
Parents:
a5aa5bf
Message:

Address build error from commit a5aa5b.

To keep: Change all tabs to spaces in the test source, to make error-case output consistent across compilers.

To investigate further: Comment out test of "dependent parameter" syntax that uses star in prototype, which got an unexpected warning under gcc11.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/array.cfa

    ra5aa5bf r8a919cf  
    3737#endif
    3838
    39         int a1[0];
     39    int a1[0];
    4040E1( int a2[*];       )
    4141                                                        #ifndef __cforall
     
    4343                                                        #endif
    4444
    45         int m1[0][3];
    46 E1(     int m2[*][*];    )
    47         int m4[3][3];
     45    int m1[0][3];
     46E1( int m2[*][*];    )
     47    int m4[3][3];
    4848
    49         typedef int T;
     49    typedef int T;
    5050
    51         int fred(int n) {
    52 E1(             int a1[];    )
    53 E1(             int a2[*];   )
    54                 int a4[3];
    55                 int T[3];
    56                 int a5[n];
    57         }
     51    int fred(int n) {
     52E1(     int a1[];    )
     53E1(     int a2[*];   )
     54        int a4[3];
     55        int T[3];
     56        int a5[n];
     57    }
    5858
    59         int mary( int T[3],                                 // same as: int *T
    60                           int p1[const 3],                          // same as: int const *p1
    61                           int p2[static 3],                         // same as T, but length >=3 checked
    62                           int p3[static const 3]                    // both above: 3 is static, p3 is const
    63                 ) {
    64         }
     59    int mary( int T[3],                                 // same as: int *T
     60              int p1[const 3],                          // same as: int const *p1
     61              int p2[static 3],                         // same as T, but length >=3 checked
     62              int p3[static const 3]                    // both above: 3 is static, p3 is const
     63        ) {
     64    }
    6565
    66         // function taking (), returning pointer to array of ints
    67         int (*tom())[3] {
    68         }
     66    // function taking (), returning pointer to array of ints
     67    int (*tom())[3] {
     68    }
    6969
    70         // function taking (), returning pointer to function of same type as mary
    71         int (*(jane)())( int T[3],
    72                                         int p1[const 3],
    73                                         int p2[static 3],
    74                                         int p3[static const 3]
    75                 ) {
    76         }
     70    // function taking (), returning pointer to function of same type as mary
     71    int (*(jane)())( int T[3],
     72                     int p1[const 3],
     73                     int p2[static 3],
     74                     int p3[static const 3]
     75        ) {
     76    }
    7777
    78         // functions returning same exotic pointers, in CFA's non-onion syntax
    79         #ifdef __cforall
    80         [ * [3] int ] toms_twin(...) {
    81         }
    82         [ * [int]( [3] int T,
    83                         [const 3] int p1,
    84                         [static 3] int p2,
    85                         [static const 3] int p3
    86                         )
    87         ] janes_twin(...) {
    88         }
    89         #endif
     78    // functions returning same exotic pointers, in CFA's non-onion syntax
     79    #ifdef __cforall
     80    [ * [3] int ] toms_twin(...) {
     81    }
     82    [ * [int]( [3] int T,
     83            [const 3] int p1,
     84            [static 3] int p2,
     85            [static const 3] int p3
     86            )
     87    ] janes_twin(...) {
     88    }
     89    #endif
    9090
    9191
    92         int fm1( int, int, int[][*] );
    93         int fm1( int r, int c, int m[][c] ) {}
    94         int fm2( int r, int c, int (*m)[c] ) {}             // same as fm1
    95 E2(     int fm3( int r, int c, int m[][static c] ) {}  )    // that's not static
    96 E3(     int fm4( int r, int c, int m[][] );            )    // m's immediate element type is incomplete
    97         int fm5( int, int, int[*][*] );                     // same as fm1 decl
     92//  int fm1( int, int, int[][*] );                      // TODO: investigate gcc-11 warning
     93//  int fm1( int r, int c, int m[][c] ) {}
     94    int fm2( int r, int c, int (*m)[c] ) {}             // same as fm1
     95E2( int fm3( int r, int c, int m[][static c] ) {}  )    // that's not static
     96E3( int fm4( int r, int c, int m[][] );            )    // m's immediate element type is incomplete
     97    int fm5( int, int, int[*][*] );                     // same as fm1 decl
    9898                                                        #ifndef __cforall
    99         int fm5( int r, int c, int m[r][c] ) {}             // BUG 276: CFA chokes but should accept
    100                                                             // C: same as fm1 defn
     99    int fm5( int r, int c, int m[r][c] ) {}             // BUG 276: CFA chokes but should accept
     100                                                        // C: same as fm1 defn
    101101                                                        #endif
    102102
Note: See TracChangeset for help on using the changeset viewer.