Changeset 7ae39f0
- Timestamp:
- May 26, 2023, 5:08:03 PM (18 months ago)
- Branches:
- ast-experimental, master
- Children:
- 124400b
- Parents:
- b2fa3c2
- Location:
- tests
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/.expect/array-ERR1.txt
rb2fa3c2 r7ae39f0 1 array.cfa:1 05:25: warning: Preprocessor started1 array.cfa:119:25: warning: Preprocessor started 2 2 array.cfa:40:22: error: '[*]' not allowed in other than function prototype scope 3 3 array.cfa:46:24: error: '[*]' not allowed in other than function prototype scope -
tests/.expect/array-ERR2.txt
rb2fa3c2 r7ae39f0 1 array.cfa:1 05:25: warning: Preprocessor started2 array.cfa: 95:32: error: syntax error, unexpected STATIC before token "static"1 array.cfa:119:25: warning: Preprocessor started 2 array.cfa:109:32: error: syntax error, unexpected STATIC before token "static" -
tests/.expect/array-ERR3.txt
rb2fa3c2 r7ae39f0 1 array.cfa:1 05:25: warning: Preprocessor started2 array.cfa: 96:32: error: syntax error, unexpected ']' before token "]"1 array.cfa:119:25: warning: Preprocessor started 2 array.cfa:110:32: error: syntax error, unexpected ']' before token "]" -
tests/.expect/array.txt
rb2fa3c2 r7ae39f0 1 array.cfa:1 05:25: warning: Preprocessor started1 array.cfa:119:25: warning: Preprocessor started -
tests/array.cfa
rb2fa3c2 r7ae39f0 81 81 } 82 82 [ * [int]( [3] int T, 83 [const 3] int p1,84 [static 3] int p2,85 [static const 3] int p386 )83 [const 3] int p1, 84 [static 3] int p2, 85 [static const 3] int p3 86 ) 87 87 ] janes_twin(...) { 88 88 } 89 89 #endif 90 90 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. 91 100 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] ) {} 94 108 int fm2( int r, int c, int (*m)[c] ) {} // same as fm1 95 109 E2( int fm3( int r, int c, int m[][static c] ) {} ) // that's not static 96 110 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 decl111 int fm5x( int, int, int[*][*] ); // same as fm1 decl 98 112 #ifndef __cforall 99 int fm5 ( int r, int c, int m[r][c] ) {}// BUG 276: CFA chokes but should accept113 int fm5y( int r, int c, int m[r][c] ) {} // BUG 276: CFA chokes but should accept 100 114 // C: same as fm1 defn 101 115 #endif
Note: See TracChangeset
for help on using the changeset viewer.