Changeset 124400b for tests


Ignore:
Timestamp:
May 27, 2023, 6:44:54 PM (11 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ast-experimental, master
Children:
5007618
Parents:
bdbf536 (diff), 7ae39f0 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

Location:
tests
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • tests/.expect/array-ERR1.txt

    rbdbf536 r124400b  
    1 array.cfa:105:25: warning: Preprocessor started
     1array.cfa:119:25: warning: Preprocessor started
    22array.cfa:40:22: error: '[*]' not allowed in other than function prototype scope
    33array.cfa:46:24: error: '[*]' not allowed in other than function prototype scope
  • tests/.expect/array-ERR2.txt

    rbdbf536 r124400b  
    1 array.cfa:105:25: warning: Preprocessor started
    2 array.cfa:95:32: error: syntax error, unexpected STATIC before token "static"
     1array.cfa:119:25: warning: Preprocessor started
     2array.cfa:109:32: error: syntax error, unexpected STATIC before token "static"
  • tests/.expect/array-ERR3.txt

    rbdbf536 r124400b  
    1 array.cfa:105:25: warning: Preprocessor started
    2 array.cfa:96:32: error: syntax error, unexpected ']' before token "]"
     1array.cfa:119:25: warning: Preprocessor started
     2array.cfa:110:32: error: syntax error, unexpected ']' before token "]"
  • tests/.expect/array.txt

    rbdbf536 r124400b  
    1 array.cfa:105:25: warning: Preprocessor started
     1array.cfa:119:25: warning: Preprocessor started
  • tests/array.cfa

    rbdbf536 r124400b  
    8181    }
    8282    [ * [int]( [3] int T,
    83             [const 3] int p1,
    84             [static 3] int p2,
    85             [static const 3] int p3
    86             )
     83               [const 3] int p1,
     84               [static 3] int p2,
     85               [static const 3] int p3
     86             )
    8787    ] janes_twin(...) {
    8888    }
    8989    #endif
    9090
     91    // GCC 11+ gives a false warning (-Wvla-parameter) on the valid (C11 ARM p134-135) combination:
     92    // declare with type int[*], define with type int[n].
     93    // https://gcc.gnu.org/bugzilla//show_bug.cgi?id=100420 suggests the internal representation of
     94    // of a[*] is the same as a[0].
     95    // https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wno-vla-parameter explains
     96    // the purpose of -Wvla-parameter is to report conflicts between int[] and int[n], which would
     97    // understandably also include those between int[42] and int[n].
     98    // https://stackoverflow.com/questions/17371645/why-use-an-asterisk-instead-of-an-integer-for-a-vla-array-parameter-of-a-f
     99    // explains the declare-*, define-n pattern.
    91100
    92 //  int fm1( int, int, int[][*] );                      // TODO: investigate gcc-11 warning
    93 //  int fm1( int r, int c, int m[][c] ) {}
     101    // To work around the false warning, and keep to this test's purpose of exercising CFA's
     102    // handling of exotic C array syntax, what would ideally be demonstrated as a declaration of
     103    // fm1, followed by its definition, is instead split into fm1x and fm1y.  And similarly for
     104    // fm5.
     105
     106    int fm1x( int, int, int[][*] );
     107    int fm1y( int r, int c, int m[][c] ) {}
    94108    int fm2( int r, int c, int (*m)[c] ) {}             // same as fm1
    95109E2( int fm3( int r, int c, int m[][static c] ) {}  )    // that's not static
    96110E3( 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
     111    int fm5x( int, int, int[*][*] );                    // same as fm1 decl
    98112                                                        #ifndef __cforall
    99     int fm5( int r, int c, int m[r][c] ) {}             // BUG 276: CFA chokes but should accept
     113    int fm5y( int r, int c, int m[r][c] ) {}            // BUG 276: CFA chokes but should accept
    100114                                                        // C: same as fm1 defn
    101115                                                        #endif
Note: See TracChangeset for help on using the changeset viewer.