- Timestamp:
- May 26, 2023, 11:55:33 AM (2 years ago)
- Branches:
- ast-experimental, master
- Children:
- 6c121eed
- Parents:
- b09ca2b (diff), 53f6a11 (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. - Location:
- tests
- Files:
-
- 8 added
- 2 deleted
- 4 edited
- 198 moved
Legend:
- Unmodified
- Added
- Removed
-
tests/.expect/array.txt
rb09ca2b ra01faa98 1 array.cfa: 52:25: warning: Compiled1 array.cfa:105:25: warning: Preprocessor started -
tests/Makefile.am
rb09ca2b ra01faa98 11 11 ## Created On : Sun May 31 09:08:15 2015 12 12 ## Last Modified By : Peter A. Buhr 13 ## Last Modified On : Tue May 16 09:27:48202314 ## Update Count : 17 813 ## Last Modified On : Fri May 26 08:23:09 2023 14 ## Update Count : 179 15 15 ############################################################################### 16 16 … … 79 79 avltree/avl-private.h \ 80 80 avltree/avl.h \ 81 concurrent/clib_tls.c \82 concurrent/clib.c \83 81 configs/.in/parseconfig-all.txt \ 84 82 configs/.in/parseconfig-errors.txt \ … … 89 87 io/.in/many_read.data \ 90 88 meta/fork+exec.hfa \ 91 concurrent/unified_locking/mutex_test.hfa \ 92 concurrent/channels/parallel_harness.hfa 89 concurrency/clib_tls.c \ 90 concurrency/clib.c \ 91 concurrency/unified_locking/mutex_test.hfa \ 92 concurrentcy/channels/parallel_harness.hfa 93 93 94 94 dist-hook: … … 204 204 205 205 SYNTAX_ONLY_CODE = expression typedefRedef variableDeclarator switch numericConstants identFuncDeclarator \ 206 init1 limits nested-types cast labelledExit array quasiKeyword include/stdincludes include/includes builtins/sync warnings/self-assignment concurren t/waitfor/parse206 init1 limits nested-types cast labelledExit array quasiKeyword include/stdincludes include/includes builtins/sync warnings/self-assignment concurrency/waitfor/parse 207 207 ${SYNTAX_ONLY_CODE} : % : %.cfa ${CFACCBIN} 208 208 ${CFACOMPILE_SYNTAX} … … 211 211 # expected failures 212 212 # use custom target since they require a custom define *and* have a name that doesn't match the file 213 214 array-ERR1 : array.cfa ${CFACCBIN} 215 ${CFACOMPILE_SYNTAX} -DERR1 216 -cp ${test} ${abspath ${@}} 217 218 array-ERR2 : array.cfa ${CFACCBIN} 219 ${CFACOMPILE_SYNTAX} -DERR2 220 -cp ${test} ${abspath ${@}} 221 222 array-ERR3 : array.cfa ${CFACCBIN} 223 ${CFACOMPILE_SYNTAX} -DERR3 224 -cp ${test} ${abspath ${@}} 225 213 226 alloc-ERROR : alloc.cfa ${CFACCBIN} 214 227 ${CFACOMPILE_SYNTAX} -DERR1 -
tests/PRNG.cfa
rb09ca2b ra01faa98 1 // -*- Mode: C -*- 2 // 1 // 3 2 // Cforall Version 1.0.0 Copyright (C) 2021 University of Waterloo 4 // 5 // PRNG.c -- 6 // 3 // 4 // PRNG.c -- high-perforamnce pseudo-random numbers 5 // 6 // The contents of this file are covered under the licence agreement in the 7 // file "LICENCE" distributed with Cforall. 8 // 7 9 // Author : Peter A. Buhr 8 10 // Created On : Wed Dec 29 09:38:12 2021 9 11 // Last Modified By : Peter A. Buhr 10 // Last Modified On : Sun Apr 23 22:02:09202311 // Update Count : 42 012 // Last Modified On : Thu May 25 15:39:52 2023 13 // Update Count : 422 12 14 // 13 15 -
tests/array.cfa
rb09ca2b ra01faa98 15 15 // 16 16 17 int a1[0]; 18 // int a2[*];19 // double a4[3.0];17 // Tests syntax. Comments explain semantics. Test does not show semantics. 18 // Mostly illustrates facts about C (with which CFA is being tested to agree). 19 // Is a test oracle under `gcc -x c`. 20 20 21 int m1[0][3]; 22 //int m2[*][*]; 23 int m4[3][3]; 21 #ifdef ERR1 22 #define E1(...) __VA_ARGS__ 23 #else 24 #define E1(...) 25 #endif 24 26 25 typedef int T; 27 #ifdef ERR2 28 #define E2(...) __VA_ARGS__ 29 #else 30 #define E2(...) 31 #endif 26 32 27 int fred() { 28 // int a1[]; 29 // int a2[*]; 30 int a4[3]; 31 int T[3]; 32 } 33 #ifdef ERR3 34 #define E3(...) __VA_ARGS__ 35 #else 36 #define E3(...) 37 #endif 33 38 34 int mary( int T[3], 35 int p1[const 3], 36 int p2[static 3], 37 int p3[static const 3] 38 ) { 39 } 39 int a1[0]; 40 E1( int a2[*]; ) 41 #ifndef __cforall 42 E1( double a4[3.0]; ) // BUG 275: CFA accepts but should reject 43 #endif 40 44 41 int (*tom())[3] { 42 } 45 int m1[0][3]; 46 E1( int m2[*][*]; ) 47 int m4[3][3]; 43 48 44 int (*(jane)())( int T[3], 45 int p1[const 3], 46 int p2[static 3], 47 int p3[static const 3] 48 ) { 49 } 49 typedef int T; 50 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 } 58 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 } 65 66 // function taking (), returning pointer to array of ints 67 int (*tom())[3] { 68 } 69 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 } 77 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 90 91 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 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 98 #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 101 #endif 102 50 103 51 104 int main() { 52 #pragma GCC warning " Compiled"// force non-empty .expect file, NO TABS!!!105 #pragma GCC warning "Preprocessor started" // force non-empty .expect file, NO TABS!!! 53 106 } 54 107 -
tests/concurrency/.expect/ctor-check.txt
rb09ca2b ra01faa98 1 concurren t/ctor-check.cfa:11:1 error: constructors cannot have mutex parameters1 concurrency/ctor-check.cfa:11:1 error: constructors cannot have mutex parameters 2 2 ?{}: function 3 3 ... with parameters
Note:
See TracChangeset
for help on using the changeset viewer.