- Timestamp:
- Sep 21, 2022, 11:02:15 AM (3 years ago)
- Branches:
- ADT, ast-experimental, master, pthread-emulation
- Children:
- 95dab9e
- Parents:
- 428adbc (diff), 0bd46fd (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:
-
- 9 added
- 46 deleted
- 23 edited
- 36 moved
Legend:
- Unmodified
- Added
- Removed
-
tests/.expect/declarationSpecifier.arm64.txt
r428adbc r7f6a7c9 735 735 } 736 736 static volatile const struct __anonymous15 _X3x36KVS13__anonymous15_1; 737 _Thread_local signed int _X3x37i_1; 738 __thread signed int _X3x38i_1; 737 739 static inline volatile const signed int _X3f11Fi___1(); 738 740 static inline volatile const signed int _X3f12Fi___1(); -
tests/.expect/declarationSpecifier.x64.txt
r428adbc r7f6a7c9 735 735 } 736 736 static volatile const struct __anonymous15 _X3x36KVS13__anonymous15_1; 737 _Thread_local signed int _X3x37i_1; 738 __thread signed int _X3x38i_1; 737 739 static inline volatile const signed int _X3f11Fi___1(); 738 740 static inline volatile const signed int _X3f12Fi___1(); -
tests/.expect/declarationSpecifier.x86.txt
r428adbc r7f6a7c9 735 735 } 736 736 static volatile const struct __anonymous15 _X3x36KVS13__anonymous15_1; 737 _Thread_local signed int _X3x37i_1; 738 __thread signed int _X3x38i_1; 737 739 static inline volatile const signed int _X3f11Fi___1(); 738 740 static inline volatile const signed int _X3f12Fi___1(); -
tests/.expect/loop_else.txt
r428adbc r7f6a7c9 33 33 0 1 2 3 4 5 6 7 8 9 else 34 34 0 1 2 3 4 5 6 7 8 9 10 else 35 10 9 8 7 6 5 4 3 2 1 else35 10 9 8 7 6 5 4 3 2 1 0 else 36 36 37 37 3 6 9 else 38 39 (0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9)else40 (0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9)else41 42 (0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9)else43 (0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9)else44 (0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9)(10 10)else45 (0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9)(10 10)else46 47 (10 10)(9 9)(8 8)(7 7)(6 6)(5 5)(4 4)(3 3)(2 2)(1 1)else48 (10 10)(9 9)(8 8)(7 7)(6 6)(5 5)(4 4)(3 3)(2 2)(1 1)else49 (10 10)(9 9)(8 8)(7 7)(6 6)(5 5)(4 4)(3 3)(2 2)(1 1)(0 0)else50 (10 10)(9 9)(8 8)(7 7)(6 6)(5 5)(4 4)(3 3)(2 2)(1 1)(0 0)else51 38 52 39 0 -5 1 -4 2 -3 3 -2 4 -1 5 0 6 1 7 2 8 3 9 4 else … … 63 50 0 -5 1.5 1 -7 2.5 2 -9 3.5 3 -11 4.5 4 -13 5.5 5 -15 6.5 6 -17 7.5 7 -19 8.5 8 -21 9.5 9 -23 10.5 else 64 51 0 -5 1.5 1 -7 2.5 2 -9 3.5 3 -11 4.5 4 -13 5.5 5 -15 6.5 6 -17 7.5 7 -19 8.5 8 -21 9.5 9 -23 10.5 else 52 (0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9)else 53 (0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9)else 54 55 (0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9)else 56 (0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9)else 57 (0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9)(10 10)else 58 (0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9)(10 10)else 59 60 (10 10)(9 9)(8 8)(7 7)(6 6)(5 5)(4 4)(3 3)(2 2)(1 1)else 61 (10 10)(9 9)(8 8)(7 7)(6 6)(5 5)(4 4)(3 3)(2 2)(1 1)else 62 (10 10)(9 9)(8 8)(7 7)(6 6)(5 5)(4 4)(3 3)(2 2)(1 1)(0 0)else 63 (10 10)(9 9)(8 8)(7 7)(6 6)(5 5)(4 4)(3 3)(2 2)(1 1)(0 0)else 64 -
tests/.expect/loopctrl.txt
r428adbc r7f6a7c9 31 31 0 1 2 3 4 5 6 7 8 9 32 32 0 1 2 3 4 5 6 7 8 9 10 33 10 9 8 7 6 5 4 3 2 1 33 10 9 8 7 6 5 4 3 2 1 0 34 34 35 35 3 6 9 36 37 (0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9)38 (0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9)39 40 (0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9)41 (0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9)42 (0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9)(10 10)43 (0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9)(10 10)44 45 (10 10)(9 9)(8 8)(7 7)(6 6)(5 5)(4 4)(3 3)(2 2)(1 1)46 (10 10)(9 9)(8 8)(7 7)(6 6)(5 5)(4 4)(3 3)(2 2)(1 1)47 (10 10)(9 9)(8 8)(7 7)(6 6)(5 5)(4 4)(3 3)(2 2)(1 1)(0 0)48 (10 10)(9 9)(8 8)(7 7)(6 6)(5 5)(4 4)(3 3)(2 2)(1 1)(0 0)49 36 50 37 0 -5 1 -4 2 -3 3 -2 4 -1 5 0 6 1 7 2 8 3 9 4 … … 61 48 0 -5 1.5 1 -7 2.5 2 -9 3.5 3 -11 4.5 4 -13 5.5 5 -15 6.5 6 -17 7.5 7 -19 8.5 8 -21 9.5 9 -23 10.5 62 49 0 -5 1.5 1 -7 2.5 2 -9 3.5 3 -11 4.5 4 -13 5.5 5 -15 6.5 6 -17 7.5 7 -19 8.5 8 -21 9.5 9 -23 10.5 50 (0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9) 51 (0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9) 52 53 (0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9) 54 (0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9) 55 (0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9)(10 10) 56 (0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9)(10 10) 57 58 (10 10)(9 9)(8 8)(7 7)(6 6)(5 5)(4 4)(3 3)(2 2)(1 1) 59 (10 10)(9 9)(8 8)(7 7)(6 6)(5 5)(4 4)(3 3)(2 2)(1 1) 60 (10 10)(9 9)(8 8)(7 7)(6 6)(5 5)(4 4)(3 3)(2 2)(1 1)(0 0) 61 (10 10)(9 9)(8 8)(7 7)(6 6)(5 5)(4 4)(3 3)(2 2)(1 1)(0 0) 62 63 A A A A A A A A A A 64 B B B B B B B B B B B 65 C C C C C C C C C C 66 D D D D D D D D D D D 67 A A A A A A A A A A 68 B B B B B B B B B B B 69 C C C C C C C C C C 70 D D D D D D D D D D D 71 A A A A A 72 B B B B B B 73 C C C C C 74 D D D D D D 75 0 1 2 3 4 5 6 7 8 9 76 0 1 2 3 4 5 6 7 8 9 10 77 10 9 8 7 6 5 4 3 2 1 78 10 9 8 7 6 5 4 3 2 1 0 79 0 1 2 3 4 5 6 7 8 9 80 0 1 2 3 4 5 6 7 8 9 10 81 10 9 8 7 6 5 4 3 2 1 82 10 9 8 7 6 5 4 3 2 1 0 83 0 2 4 6 8 84 0 2 4 6 8 10 85 10 8 6 4 2 86 10 8 6 4 2 0 87 0 1 2 3 4 5 6 7 8 9 88 0 1 2 3 4 5 6 7 8 9 89 0 1 2 3 4 5 6 7 8 9 10 90 10 9 8 7 6 5 4 3 2 1 91 10 9 8 7 6 5 4 3 2 1 0 92 0 1 2 3 4 5 6 7 8 9 93 0 1 2 3 4 5 6 7 8 9 10 94 10 9 8 7 6 5 4 3 2 1 95 10 9 8 7 6 5 4 3 2 1 0 96 0 2 4 6 8 97 0 2 4 6 8 10 98 10 8 6 4 2 99 10 8 6 4 2 0 100 0 1 2 3 4 5 6 7 8 9 101 0 -1 -2 -3 -4 -5 -6 -7 -8 -9 102 0 2 4 6 8 103 0 -2 -4 -6 -8 104 0 1 2 3 4 5 6 7 8 9 105 0 2 4 6 8 106 0 -2 -4 -6 -8 107 0 2 4 6 8 108 0 -2 -4 -6 -8 109 0 1 2 3 4 5 6 7 8 9 -
tests/Makefile.am
r428adbc r7f6a7c9 54 54 55 55 # adjust CC to current flags 56 CC = LC_ALL=C $(if $(DISTCC_CFA_PATH),distcc $(DISTCC_CFA_PATH) ${ARCH_FLAGS} ${AST_FLAGS},$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS} ${AST_FLAGS})56 CC = LC_ALL=C $(if $(DISTCC_CFA_PATH),distcc $(DISTCC_CFA_PATH) ${ARCH_FLAGS} ,$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS}) 57 57 CFACC = $(CC) 58 58 … … 61 61 62 62 # adjusted CC but without the actual distcc call 63 CFACCLOCAL = $(if $(DISTCC_CFA_PATH),$(DISTCC_CFA_PATH) ${ARCH_FLAGS} ${AST_FLAGS},$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS} ${AST_FLAGS})63 CFACCLOCAL = $(if $(DISTCC_CFA_PATH),$(DISTCC_CFA_PATH) ${ARCH_FLAGS} ,$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS}) 64 64 CFACCLINK = $(CFACCLOCAL) -quiet $(if $(test), 2> $(test), ) $($(shell echo "${@}_FLAGSLD" | sed 's/-\|\//_/g')) 65 65 -
tests/concurrent/.expect/ctor-check.txt
r428adbc r7f6a7c9 2 2 ?{}: function 3 3 ... with parameters 4 this: lvaluereference to instance of struct Empty with body4 this: mutex reference to instance of struct Empty with body 5 5 ... returning nothing 6 6 with body -
tests/concurrent/clib.c
r428adbc r7f6a7c9 8 8 } 9 9 10 thread_local struct drand48_data buffer = { 0 };10 _Thread_local struct drand48_data buffer = { 0 }; 11 11 int myrand() { 12 12 long int result; -
tests/concurrent/clib_tls.c
r428adbc r7f6a7c9 14 14 15 15 16 thread_localint checkval = 0xBAADF00D;16 __thread int checkval = 0xBAADF00D; 17 17 18 18 void init(void * ) { -
tests/concurrent/park/contention.cfa
r428adbc r7f6a7c9 2 2 #include <thread.hfa> 3 3 4 thread_localdrand48_data buffer = { 0 };4 __thread drand48_data buffer = { 0 }; 5 5 int myrand() { 6 6 long int result; -
tests/config.py.in
r428adbc r7f6a7c9 9 9 HOSTARCH = "@host_cpu@" 10 10 DISTRIBUTE = @HAS_DISTCC@ 11 NEWAST = @DEFAULT_NEW_AST@ -
tests/declarationSpecifier.cfa
r428adbc r7f6a7c9 1 // 1 // 2 2 // Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo 3 3 // 4 4 // The contents of this file are covered under the licence agreement in the 5 5 // file "LICENCE" distributed with Cforall. 6 // 7 // declarationSpecifier.cfa -- 8 // 6 // 7 // declarationSpecifier.cfa -- 8 // 9 9 // Author : Peter A. Buhr 10 10 // Created On : Wed Aug 17 08:21:04 2016 … … 12 12 // Last Modified On : Tue Apr 30 18:20:36 2019 13 13 // Update Count : 4 14 // 14 // 15 15 16 16 typedef short int Int; … … 51 51 struct { Int i; } const static volatile x35; 52 52 struct { Int i; } const volatile static x36; 53 54 _Thread_local int x37; 55 __thread int x38; 53 56 54 57 static inline const volatile int f11(); -
tests/enum_tests/structEnum.cfa
r428adbc r7f6a7c9 2 2 3 3 struct Point { 4 int x;5 char y;4 int x; 5 char y; 6 6 }; 7 7 8 8 enum(Point) PointEnum { 9 first={10 100,11 'c'12 },13 second={14 200,15 'a'16 }9 first={ 10 100, 11 'c' 12 }, 13 second={ 14 200, 15 'a' 16 } 17 17 }; 18 19 PointEnum foo(PointEnum in) { 20 return in; 21 } 18 22 19 23 // The only valid usage 20 24 struct Point apple = first; 21 25 // Failed due to Qualified name is currently unimplemented. 22 // struct Point banana = PointEnum.first;23 26 24 27 int main() { 25 printf("%d %c\n", apple.x, apple.y); 26 // Failed; enumInstType is now not a real type and not instantiated. 27 // Not sure if we want that 28 // printf("%d %c\n", second.x, second.y); 29 return 0; 28 PointEnum vals = second; 29 PointEnum val2; 30 // The failing line: assignment 31 // val2 = vals; 32 33 printf("%d %c\n", apple.x, apple.y); 34 // Failed; enumInstType is now not a real type and not instantiated. 35 // Not sure if we want that 36 // printf("%d %c\n", second.x, second.y); 37 return 0; 30 38 } -
tests/heap.cfa
r428adbc r7f6a7c9 10 10 // Created On : Tue Nov 6 17:54:56 2018 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Dec 15 12:11:51 202013 // Update Count : 7912 // Last Modified On : Wed Aug 10 09:57:01 2022 13 // Update Count : 86 14 14 // 15 15 … … 26 26 // return __CFA_DEFAULT_PREEMPTION__; 27 27 // } 28 29 size_t default_heap_expansion() {30 return 10 * 1024 * 1024;31 } // default_heap_expansion32 33 size_t default_mmap_start() {34 return 512 * 1024 + 1;35 } // default_mmap_start36 28 37 29 thread Worker { … … 66 58 for ( k; i ) locns[i][k] = '\345'; 67 59 } // for 68 for ( i; NoOfAllocs - 1 -~= 0) {60 for ( i; -~= NoOfAllocs - 1 ) { 69 61 //sout | (void *)locns[i]; 70 62 for ( k; i ) if ( locns[i][k] != '\345' ) abort( "new/delete corrupt storage2" ); … … 99 91 100 92 for ( i; NoOfMmaps ) { 101 size_t s = i + default_mmap_start(); // cross over point93 size_t s = i + malloc_mmap_start(); // cross over point 102 94 char * area = (char *)malloc( s ); 103 95 area[0] = '\345'; area[s - 1] = '\345'; // fill first/last … … 107 99 108 100 for ( i; NoOfMmaps ) { 109 size_t s = i + default_mmap_start(); // cross over point101 size_t s = i + malloc_mmap_start(); // cross over point 110 102 locns[i] = (char *)malloc( s ); 111 103 locns[i][0] = '\345'; locns[i][s - 1] = '\345'; // fill first/last … … 113 105 } // for 114 106 for ( i; NoOfMmaps ) { 115 size_t s = i + default_mmap_start(); // cross over point107 size_t s = i + malloc_mmap_start(); // cross over point 116 108 if ( locns[i][0] != '\345' || locns[i][s - 1] != '\345' || 117 109 locns[i][malloc_usable_size( locns[i] ) - 1] != '\345' ) abort( "malloc/free corrupt storage" ); … … 151 143 152 144 for ( i; NoOfMmaps ) { 153 size_t s = i + default_mmap_start(); // cross over point145 size_t s = i + malloc_mmap_start(); // cross over point 154 146 char * area = (char *)calloc( 1, s ); 155 147 if ( area[0] != '\0' || area[s - 1] != '\0' ) abort( "calloc/free corrupt storage4.1" ); … … 162 154 163 155 for ( i; NoOfMmaps ) { 164 size_t s = i + default_mmap_start(); // cross over point156 size_t s = i + malloc_mmap_start(); // cross over point 165 157 locns[i] = (char *)calloc( 1, s ); 166 158 if ( locns[i][0] != '\0' || locns[i][s - 1] != '\0' || … … 171 163 } // for 172 164 for ( i; NoOfMmaps ) { 173 size_t s = i + default_mmap_start(); // cross over point165 size_t s = i + malloc_mmap_start(); // cross over point 174 166 if ( locns[i][0] != '\345' || locns[i][s - 1] != '\345' || 175 167 locns[i][malloc_usable_size( locns[i] ) - 1] != '\345' ) abort( "calloc/free corrupt storage6" ); … … 198 190 //sout | alignments[a]; 199 191 for ( i; 1 ~ NoOfMmaps ) { 200 size_t s = i + default_mmap_start(); // cross over point192 size_t s = i + malloc_mmap_start(); // cross over point 201 193 char * area = (char *)memalign( a, s ); 202 194 //sout | i | area; … … 232 224 for ( i; 2 ~ NoOfAllocs ~ 12 ) { 233 225 // initial N byte allocation 234 size_t s = i + default_mmap_start(); // cross over point226 size_t s = i + malloc_mmap_start(); // cross over point 235 227 char * area = (char *)malloc( s ); 236 228 area[0] = '\345'; area[s - 1] = '\345'; // fill first/penultimate byte … … 269 261 for ( i; 2 ~ NoOfAllocs ~ 12 ) { 270 262 // initial N byte allocation 271 size_t s = i + default_mmap_start(); // cross over point263 size_t s = i + malloc_mmap_start(); // cross over point 272 264 char * area = (char *)malloc( s ); 273 265 area[0] = '\345'; area[s - 1] = '\345'; // fill first/penultimate byte … … 307 299 for ( i; 1 ~ 10_000 ~ 12 ) { 308 300 // initial N byte allocation 309 size_t s = i + default_mmap_start(); // cross over point301 size_t s = i + malloc_mmap_start(); // cross over point 310 302 char * area = (char *)calloc( 1, s ); 311 303 if ( area[0] != '\0' || area[s - 1] != '\0' || … … 481 473 482 474 int main() { 483 const unsigned int NoOfWorkers = 4;475 enum { NoOfWorkers = 4 }; 484 476 { 485 477 processor processors[NoOfWorkers - 1] __attribute__(( unused )); // more than one processor -
tests/io/away_fair.cfa
r428adbc r7f6a7c9 60 60 struct io_uring_sqe * sqe; 61 61 __u32 idx; 62 struct $io_context* ctx = cfa_io_allocate(&sqe, &idx, 1);62 struct io_context$ * ctx = cfa_io_allocate(&sqe, &idx, 1); 63 63 64 64 zero_sqe(sqe); -
tests/io/comp_fair.cfa
r428adbc r7f6a7c9 27 27 28 28 struct { 29 30 29 barrier & bar; 30 int pipe[2]; 31 31 32 32 } globals; … … 65 65 thread Reader {}; 66 66 void main(Reader & this) { 67 bool do_read = has_user_level_blocking( (fptr_t)async_read ); 67 char thrash[1]; 68 bool do_read = has_user_level_blocking( (fptr_t)async_read ); 68 69 69 for(TIMES) { 70 io_future_t f; 71 if ( do_read ) { 72 char thrash[1]; 73 async_read(f, globals.pipe[0], thrash, 1, 0); 74 } else { 75 fulfil(f, 0); // If we don't have user-level blocking just play along 76 } 70 for(TIMES) { 71 io_future_t f; 72 if ( do_read ) { 73 async_read(f, globals.pipe[0], thrash, 1, 0); 74 } else { 75 fulfil(f, 0); // If we don't have user-level blocking just play along 76 } 77 77 78 78 block( globals.bar ); 79 79 80 80 yield( prng( this, 15 ) ); 81 81 82 82 unsigned i = __atomic_add_fetch( &counter, 1, __ATOMIC_SEQ_CST ); 83 83 if(0 == (i % 100)) sout | i; 84 84 85 85 wait( f ); 86 86 87 88 87 if(f.result < 0) 88 abort | "Read error" | -f.result | ":" | strerror(-f.result); 89 89 90 91 90 block( globals.bar ); 91 } 92 92 } 93 93 … … 97 97 thread Writer {}; 98 98 void main(Writer & this) { 99 100 99 for(TIMES) { 100 block( globals.bar ); 101 101 102 102 sleep( 1`us ); 103 103 104 105 106 107 104 char buf[1] = { '+' }; 105 int ret = write( globals.pipe[1], buf, 1 ); 106 if(ret < 0) 107 abort | "Write error" | errno | ":" | strerror(errno); 108 108 109 110 109 block( globals.bar ); 110 } 111 111 } 112 112 … … 122 122 123 123 int main() { 124 125 126 127 128 124 barrier bar = { 2 }; 125 &globals.bar = &bar; 126 int ret = pipe(globals.pipe); 127 if(ret != 0) 128 abort | "Pipe error" | errno | ":" | strerror(errno); 129 129 130 130 processor p; … … 134 134 Spinner s; 135 135 Reader ior; 136 136 Writer iow; 137 137 } 138 138 sout | "done"; -
tests/loop_else.cfa
r428adbc r7f6a7c9 20 20 21 21 int main() { 22 sout | nlOff; // turn off auto newline 23 while () { sout | "empty"; break; } else { sout | "else"; } sout | nl; 24 do { sout | "empty"; break; } while () else { sout | "else"; } sout | nl; 25 for () { sout | "empty"; break; } else { sout | "else"; } sout | nl | nl; 22 // Test some loop options. 26 23 27 do { sout | "false"; } while (false) else { sout | "else"; } sout | nl | nl; 24 sout | nlOff; // turn off auto newline 25 while () { sout | "empty"; break; } else { sout | "else"; } sout | nl; 26 do { sout | "empty"; break; } while () else { sout | "else"; } sout | nl; 27 for () { sout | "empty"; break; } else { sout | "else"; } sout | nl | nl; 28 28 29 for ( 0 ) { sout | "A"; } else { sout | "else"; } sout | "zero" | nl; 29 do { sout | "false"; } while (false) else { sout | "else"; } sout | nl | nl; 30 31 for ( 0 ) { sout | "A"; } else { sout | "else"; } sout | "zero" | nl; 30 32 for ( 1 ) { sout | "A"; } else { sout | "else"; } sout | nl; 31 for ( 10 ) { sout | "A"; } else { sout | "else"; } 32 for ( = 10 ) { sout | "A"; } else { sout | "else"; } sout | nl;33 for ( 10 ) { sout | "A"; } else { sout | "else"; } sout | nl; 34 for ( ~= 10 ) { sout | "A"; } else { sout | "else"; } sout | nl; 33 35 for ( 1 ~= 10 ~ 2 ) { sout | "B"; } else { sout | "else"; } sout | nl; 34 for ( 1 0 -~= 1~ 2 ) { sout | "C"; } else { sout | "else"; } sout | nl;36 for ( 1 -~= 10 ~ 2 ) { sout | "C"; } else { sout | "else"; } sout | nl; 35 37 for ( 0.5 ~ 5.5 ) { sout | "D"; } else { sout | "else"; } sout | nl; 36 for ( 5.5 -~ 0.5 ) { sout | "E"; } else { sout | "else"; } sout | nl | nl;38 for ( 0.5 -~ 5.5 ) { sout | "E"; } else { sout | "else"; } sout | nl | nl; 37 39 38 40 for ( i; 10 ) { sout | i; } else { sout | "else"; } sout | nl; 39 for ( i; = 10 ) { sout | i; } else { sout | "else"; } sout | nl;41 for ( i; ~= 10 ) { sout | i; } else { sout | "else"; } sout | nl; 40 42 for ( i; 1 ~= 10 ~ 2 ) { sout | i; } else { sout | "else"; } sout | nl; 41 for ( i; 1 0 -~= 1~ 2 ) { sout | i; } else { sout | "else"; } sout | nl;43 for ( i; 1 -~= 10 ~ 2 ) { sout | i; } else { sout | "else"; } sout | nl; 42 44 for ( i; 0.5 ~ 5.5 ) { sout | i; } else { sout | "else"; } sout | nl; 43 for ( i; 5.5 -~ 0.5 ) { sout | i; } else { sout | "else"; } sout | nl;45 for ( i; 0.5 -~ 5.5 ) { sout | i; } else { sout | "else"; } sout | nl; 44 46 for ( ui; 2u ~= 10u ~ 2u ) { sout | ui; } else { sout | "else"; } sout | nl; 45 for ( ui; 10u -~= 2u ~ 2u ) { sout | ui; } else { sout | "else"; } sout | nl | nl;47 for ( ui; 2u -~= 10u ~ 2u ) { sout | ui; } else { sout | "else"; } sout | nl | nl; 46 48 47 49 // @ means do nothing … … 50 52 sout | i; 51 53 } else { sout | "else"; } sout | nl; 52 for ( i; 10 -~ @) {54 for ( i; @ -~ 10 ) { 53 55 if ( i < 0 ) break; 54 56 sout | i; … … 63 65 i += 1.7; 64 66 } else { sout | "else"; } sout | nl; 65 for ( i; 10 -~ @~ 2 ) {67 for ( i; @ -~ 10 ~ 2 ) { 66 68 if ( i < 0 ) break; 67 69 sout | i; … … 76 78 for ( N ) { sout | "N"; } else { sout | "else"; } sout | nl; 77 79 for ( i; N ) { sout | i; } else { sout | "else"; } sout | nl; 78 for ( i; = N ) { sout | i; } else { sout | "else"; } sout | nl;79 for ( i; N -~ 0) { sout | i; } else { sout | "else"; } sout | nl | nl;80 for ( i; ~= N ) { sout | i; } else { sout | "else"; } sout | nl; 81 for ( i; -~= N ) { sout | i; } else { sout | "else"; } sout | nl | nl; 80 82 81 83 const int start = 3, comp = 10, inc = 2; 82 84 for ( i; start ~ comp ~ inc + 1 ) { sout | i; } else { sout | "else"; } sout | nl | nl; 85 86 for ( i; 10 : j; -5 ~ @ ) { sout | i | j; } else { sout | "else"; } sout | nl; 87 for ( i; 10 : j; @ -~ -5 ) { sout | i | j; } else { sout | "else"; } sout | nl; 88 for ( i; 10 : j; -5 ~ @ ~ 2 ) { sout | i | j; } else { sout | "else"; } sout | nl; 89 for ( i; 10 : j; @ -~ -5 ~ 2 ) { sout | i | j; } else { sout | "else"; } sout | nl | nl; 90 91 for ( j; -5 ~ @ : i; 10 ) { sout | i | j; } else { sout | "else"; } sout | nl; 92 for ( j; @ -~ -5 : i; 10 ) { sout | i | j; } else { sout | "else"; } sout | nl; 93 for ( j; -5 ~ @ ~ 2 : i; 10 ) { sout | i | j; } else { sout | "else"; } sout | nl; 94 for ( j; @ -~ -5 ~ 2 : i; 10 ) { sout | i | j; } else { sout | "else"; } sout | nl | nl; 95 96 for ( j; @ -~ -5 ~ 2 : i; 10 : k; 1.5 ~ @ ) { sout | i | j | k; } else { sout | "else"; } sout | nl; 97 for ( j; @ -~ -5 ~ 2 : k; 1.5 ~ @ : i; 10 ) { sout | i | j | k; } else { sout | "else"; } sout | nl; 98 for ( k; 1.5 ~ @ : j; @ -~ -5 ~ 2 : i; 10 ) { sout | i | j | k; } else { sout | "else"; } sout | nl; 83 99 84 100 for ( S s = (S){0}; s < (S){10,10}; s += (S){1} ) { sout | s; } else { sout | "else"; } sout | nl; … … 90 106 for ( s; (S){0} ~= (S){10,10} ~ (S){1} ) { sout | s; } else { sout | "else"; } sout | nl; 91 107 sout | nl; 92 for ( s; (S){10,10} -~ (S){0} ) { sout | s; } else { sout | "else"; } sout | nl; 93 for ( s; (S){10,10} -~ (S){0} ~ (S){1} ) { sout | s; } else { sout | "else"; } sout | nl; 94 for ( s; (S){10,10} -~= (S){0} ) { sout | s; } else { sout | "else"; } sout | nl; 95 for ( s; (S){10,10} -~= (S){0} ~ (S){1} ) { sout | s; } else { sout | "else"; } sout | nl | nl; 96 97 for ( i; 10 : j; -5 ~ @ ) { sout | i | j; } else { sout | "else"; } sout | nl; 98 for ( i; 10 : j; -5 -~ @ ) { sout | i | j; } else { sout | "else"; } sout | nl; 99 for ( i; 10 : j; -5 ~ @ ~ 2 ) { sout | i | j; } else { sout | "else"; } sout | nl; 100 for ( i; 10 : j; -5 -~ @ ~ 2 ) { sout | i | j; } else { sout | "else"; } sout | nl | nl; 101 102 for ( j; -5 ~ @ : i; 10 ) { sout | i | j; } else { sout | "else"; } sout | nl; 103 for ( j; -5 -~ @ : i; 10 ) { sout | i | j; } else { sout | "else"; } sout | nl; 104 for ( j; -5 ~ @ ~ 2 : i; 10 ) { sout | i | j; } else { sout | "else"; } sout | nl; 105 for ( j; -5 -~ @ ~ 2 : i; 10 ) { sout | i | j; } else { sout | "else"; } sout | nl | nl; 106 107 for ( j; -5 -~ @ ~ 2 : i; 10 : k; 1.5 ~ @ ) { sout | i | j | k; } else { sout | "else"; } sout | nl; 108 for ( j; -5 -~ @ ~ 2 : k; 1.5 ~ @ : i; 10 ) { sout | i | j | k; } else { sout | "else"; } sout | nl; 109 for ( k; 1.5 ~ @ : j; -5 -~ @ ~ 2 : i; 10 ) { sout | i | j | k; } else { sout | "else"; } sout | nl; 108 for ( s; (S){0} -~ (S){10,10} ) { sout | s; } else { sout | "else"; } sout | nl; 109 for ( s; (S){0} -~ (S){10,10} ~ (S){1} ) { sout | s; } else { sout | "else"; } sout | nl; 110 for ( s; (S){0} -~= (S){10,10} ) { sout | s; } else { sout | "else"; } sout | nl; 111 for ( s; (S){0} -~= (S){10,10} ~ (S){1} ) { sout | s; } else { sout | "else"; } sout | nl | nl; 110 112 } -
tests/loopctrl.cfa
r428adbc r7f6a7c9 10 10 // Created On : Wed Aug 8 18:32:59 2018 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Dec 12 17:55:26 201913 // Update Count : 1 0812 // Last Modified On : Thu Aug 11 23:04:35 2022 13 // Update Count : 160 14 14 // 15 15 16 16 #include <fstream.hfa> 17 18 void fred() { 19 // Test all possible loop syntax. 20 21 int s = 0, c = 10, i = 2; 22 23 for ( c ) { sout | "A"; } sout | nl; 24 for ( ~= c ) { sout | "B"; } sout | nl; 25 for ( -~ c ) { sout | "C"; } sout | nl; 26 for ( -~= c ) { sout | "D"; } sout | nl; 27 28 for ( s ~ c ) { sout | "A"; } sout | nl; 29 for ( s ~= c ) { sout | "B"; } sout | nl; 30 for ( s -~ c ) { sout | "C"; } sout | nl; 31 for ( s -~= c ) { sout | "D"; } sout | nl; 32 33 for ( s ~ c ~ i ) { sout | "A"; } sout | nl; 34 for ( s ~= c ~ i ) { sout | "B"; } sout | nl; 35 for ( s -~ c ~ i ) { sout | "C"; } sout | nl; 36 for ( s -~= c ~ i ) { sout | "D"; } sout | nl; 37 38 for ( j; c ) { sout | j; } sout | nl; 39 for ( j; ~= c ) { sout | j; } sout | nl; 40 for ( j; -~ c ) { sout | j; } sout | nl; 41 for ( j; -~= c ) { sout | j; } sout | nl; 42 43 for ( j; s ~ c ) { sout | j; } sout | nl; 44 for ( j; s ~= c ) { sout | j; } sout | nl; 45 for ( j; s -~ c ) { sout | j; } sout | nl; 46 for ( j; s -~= c ) { sout | j; } sout | nl; 47 48 for ( j; s ~ c ~ i ) { sout | j; } sout | nl; 49 for ( j; s ~= c ~ i ) { sout | j; } sout | nl; 50 for ( j; s -~ c ~ i ) { sout | j; } sout | nl; 51 for ( j; s -~= c ~ i ) { sout | j; } sout | nl; 52 53 // CANNOT DIRECTLY INITIALIZE INDEX VARIABLE, ONLY SINGLE LOOP INDEX VARIABLE IN DECLARATION 54 55 for ( j; c ) { sout | j; } sout | nl; 56 for ( int j; c ) { sout | j; } sout | nl; 57 for ( int j; ~= c ) { sout | j; } sout | nl; 58 for ( int j; -~ c ) { sout | j; } sout | nl; 59 for ( int j; -~= c ) { sout | j; } sout | nl; 60 61 for ( int j; s ~ c ) { sout | j; } sout | nl; 62 for ( int j; s ~= c ) { sout | j; } sout | nl; 63 for ( int j; s -~ c ) { sout | j; } sout | nl; 64 for ( int j; s -~= c ) { sout | j; } sout | nl; 65 66 for ( int j; s ~ c ~ i ) { sout | j; } sout | nl; 67 for ( int j; s ~= c ~ i ) { sout | j; } sout | nl; 68 for ( int j; s -~ c ~ i ) { sout | j; } sout | nl; 69 for ( int j; s -~= c ~ i ) { sout | j; } sout | nl; 70 71 for ( j; s ~ @ ) { if ( j == 10 ) break; sout | j; } sout | nl; 72 for ( j; @ -~ s ) { if ( j == -10 ) break; sout | j; } sout | nl; 73 for ( j; s ~ @ ~ i ) { if ( j == 10 ) break; sout | j; } sout | nl; 74 for ( j; @ -~ s ~ i ) { if ( j == -10 ) break; sout | j; } sout | nl; 75 for ( j; s ~ @ ~ @ ) { if ( j == 10 ) break; sout | j; j += 1; } sout | nl; 76 77 for ( int j; s ~ @ ) { if ( j == 10 ) break; sout | j; j += 1; } sout | nl; 78 for ( int j; @ -~ s ) { if ( j == -10 ) break; sout | j; j -= 1; } sout | nl; 79 for ( int j; s ~ @ ~ i ) { if ( j == 10 ) break; sout | j; } sout | nl; 80 for ( int j; @ -~ s ~ i ) { if ( j == -10 ) break; sout | j; } sout | nl; 81 for ( int j; s ~ @ ~ @ ) { if ( j == 10 ) break; sout | j; j += 1; } sout | nl; 82 83 // enum E { A, B, C, D }; 84 // for ( e; A ~= C ) { sout | j; } 85 // for ( e; A ~= D ) { sout | j; } 86 // for ( e; A -~= D ~ 2 ) { sout | j; } 87 // for ( e; E ) { sout | j; } 88 // for ( e; -~ E ) { sout | j; } 89 } 17 90 18 91 struct S { int i, j; }; … … 35 108 36 109 int main() { 110 // Test some loop options. 111 37 112 sout | nlOff; // turn off auto newline 38 113 while () { sout | "empty"; break; } sout | nl; … … 43 118 for ( 1 ) { sout | "A"; } sout | nl; 44 119 for ( 10 ) { sout | "A"; } sout | nl; 45 for ( = 10 ) { sout | "A"; } sout | nl;120 for ( ~= 10 ) { sout | "A"; } sout | nl; 46 121 for ( 1 ~= 10 ~ 2 ) { sout | "B"; } sout | nl; 47 for ( 1 0 -~= 1~ 2 ) { sout | "C"; } sout | nl;122 for ( 1 -~= 10 ~ 2 ) { sout | "C"; } sout | nl; 48 123 for ( 0.5 ~ 5.5 ) { sout | "D"; } sout | nl; 49 for ( 5.5 -~ 0.5 ) { sout | "E"; } sout | nl | nl;124 for ( 0.5 -~ 5.5 ) { sout | "E"; } sout | nl | nl; 50 125 51 126 for ( i; 10 ) { sout | i; } sout | nl; 52 for ( i; = 10 ) { sout | i; } sout | nl;127 for ( i; ~= 10 ) { sout | i; } sout | nl; 53 128 for ( i; 1 ~= 10 ~ 2 ) { sout | i; } sout | nl; 54 for ( i; 1 0 -~= 1~ 2 ) { sout | i; } sout | nl;129 for ( i; 1 -~= 10 ~ 2 ) { sout | i; } sout | nl; 55 130 for ( i; 0.5 ~ 5.5 ) { sout | i; } sout | nl; 56 for ( i; 5.5 -~ 0.5 ) { sout | i; } sout | nl;131 for ( i; 0.5 -~ 5.5 ) { sout | i; } sout | nl; 57 132 for ( ui; 2u ~= 10u ~ 2u ) { sout | ui; } sout | nl; 58 for ( ui; 10u -~= 2u ~ 2u ) { sout | ui; } sout | nl | nl;133 for ( ui; 2u -~= 10u ~ 2u ) { sout | ui; } sout | nl | nl; 59 134 60 135 // @ means do nothing … … 63 138 sout | i; 64 139 } sout | nl; 65 for ( i; 10 -~ @) {140 for ( i; @ -~ 10 ) { 66 141 if ( i < 0 ) break; 67 142 sout | i; … … 76 151 i += 1.7; 77 152 } sout | nl; 78 for ( i; 10 -~ @~ 2 ) {153 for ( i; @ -~ 10 ~ 2 ) { 79 154 if ( i < 0 ) break; 80 155 sout | i; … … 89 164 for ( N ) { sout | "N"; } sout | nl; 90 165 for ( i; N ) { sout | i; } sout | nl; 91 for ( i; = N ) { sout | i; } sout | nl;92 for ( i; N -~ 0) { sout | i; } sout | nl | nl;166 for ( i; ~= N ) { sout | i; } sout | nl; 167 for ( i; -~= N ) { sout | i; } sout | nl | nl; 93 168 94 169 const int start = 3, comp = 10, inc = 2; 95 170 for ( i; start ~ comp ~ inc + 1 ) { sout | i; } sout | nl | nl; 171 172 for ( i; 10 : j; -5 ~ @ ) { sout | i | j; } sout | nl; 173 for ( i; 10 : j; @ -~ -5 ) { sout | i | j; } sout | nl; 174 for ( i; 10 : j; -5 ~ @ ~ 2 ) { sout | i | j; } sout | nl; 175 for ( i; 10 : j; @ -~ -5 ~ 2 ) { sout | i | j; } sout | nl | nl; 176 177 for ( j; -5 ~ @ : i; 10 ) { sout | i | j; } sout | nl; 178 for ( j; @ -~ -5 : i; 10 ) { sout | i | j; } sout | nl; 179 for ( j; -5 ~ @ ~ 2 : i; 10 ) { sout | i | j; } sout | nl; 180 for ( j; @ -~ -5 ~ 2 : i; 10 ) { sout | i | j; } sout | nl | nl; 181 182 for ( j; @ -~ -5 ~ 2 : i; 10 : k; 1.5 ~ @ ) { sout | i | j | k; } sout | nl; 183 for ( j; @ -~ -5 ~ 2 : k; 1.5 ~ @ : i; 10 ) { sout | i | j | k; } sout | nl; 184 for ( k; 1.5 ~ @ : j; @ -~ -5 ~ 2 : i; 10 ) { sout | i | j | k; } sout | nl; 96 185 97 186 for ( S s = (S){0}; s < (S){10,10}; s += (S){1} ) { sout | s; } sout | nl; … … 103 192 for ( s; (S){0} ~= (S){10,10} ~ (S){1} ) { sout | s; } sout | nl; 104 193 sout | nl; 105 for ( s; (S){10,10} -~ (S){0} ) { sout | s; } sout | nl; 106 for ( s; (S){10,10} -~ (S){0} ~ (S){1} ) { sout | s; } sout | nl; 107 for ( s; (S){10,10} -~= (S){0} ) { sout | s; } sout | nl; 108 for ( s; (S){10,10} -~= (S){0} ~ (S){1} ) { sout | s; } sout | nl | nl; 109 110 for ( i; 10 : j; -5 ~ @ ) { sout | i | j; } sout | nl; 111 for ( i; 10 : j; -5 -~ @ ) { sout | i | j; } sout | nl; 112 for ( i; 10 : j; -5 ~ @ ~ 2 ) { sout | i | j; } sout | nl; 113 for ( i; 10 : j; -5 -~ @ ~ 2 ) { sout | i | j; } sout | nl | nl; 114 115 for ( j; -5 ~ @ : i; 10 ) { sout | i | j; } sout | nl; 116 for ( j; -5 -~ @ : i; 10 ) { sout | i | j; } sout | nl; 117 for ( j; -5 ~ @ ~ 2 : i; 10 ) { sout | i | j; } sout | nl; 118 for ( j; -5 -~ @ ~ 2 : i; 10 ) { sout | i | j; } sout | nl | nl; 119 120 for ( j; -5 -~ @ ~ 2 : i; 10 : k; 1.5 ~ @ ) { sout | i | j | k; } sout | nl; 121 for ( j; -5 -~ @ ~ 2 : k; 1.5 ~ @ : i; 10 ) { sout | i | j | k; } sout | nl; 122 for ( k; 1.5 ~ @ : j; -5 -~ @ ~ 2 : i; 10 ) { sout | i | j | k; } sout | nl; 194 for ( s; (S){0} -~ (S){10,10} ) { sout | s; } sout | nl; 195 for ( s; (S){0} -~ (S){10,10} ~ (S){1} ) { sout | s; } sout | nl; 196 for ( s; (S){0} -~= (S){10,10} ) { sout | s; } sout | nl; 197 for ( s; (S){0} -~= (S){10,10} ~ (S){1} ) { sout | s; } sout | nl | nl; 198 199 fred(); 123 200 } 124 201 -
tests/meta/.expect/arch.arm64.txt
r428adbc r7f6a7c9 1 meta/arch Vast.cfa:28:1 error: Cannot choose between 3 alternatives for expression1 meta/arch.cfa:28:1 error: Cannot choose between 3 alternatives for expression 2 2 Explicit Cast of: 3 3 Name: FA64 -
tests/meta/.expect/arch.x64.txt
r428adbc r7f6a7c9 1 meta/arch Vast.cfa:28:1 error: Cannot choose between 3 alternatives for expression1 meta/arch.cfa:28:1 error: Cannot choose between 3 alternatives for expression 2 2 Explicit Cast of: 3 3 Name: FX64 -
tests/meta/.expect/arch.x86.txt
r428adbc r7f6a7c9 1 meta/arch Vast.cfa:28:1 error: Cannot choose between 3 alternatives for expression1 meta/arch.cfa:28:1 error: Cannot choose between 3 alternatives for expression 2 2 Explicit Cast of: 3 3 Name: FX86 -
tests/meta/arch.cfa
r428adbc r7f6a7c9 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // arch Vast.cfa -- Check if all combinations are of ast/arch are properly distinguished7 // arch.cfa -- Check if all architectures are properly distinguished by the test suite 8 8 // 9 9 // Author : Thierry Delisle -
tests/pybin/settings.py
r428adbc r7f6a7c9 97 97 self.path = "debug" if value else "nodebug" 98 98 99 class AST:100 def __init__(self, ast):101 if ast == "new":102 self.target = ast103 self.string = "New AST"104 self.flags = """AST_FLAGS=-XCFA,--new-ast"""105 elif ast == "old":106 self.target = ast107 self.string = "Old AST"108 self.flags = """AST_FLAGS=-XCFA,--old-ast"""109 elif ast == None:110 self.target = "new" if config.NEWAST else "old"111 self.string = "Default AST (%s)" % self.target112 self.flags = """AST_FLAGS="""113 else:114 print("""ERROR: Invalid ast configuration, must be "old", "new" or left unspecified, was %s""" % (value), file=sys.stderr)115 sys.exit(1)116 117 def filter(self, tests):118 119 return [test for test in tests if not test.astv or self.target == test.astv]120 121 99 class Install: 122 100 def __init__(self, value): … … 141 119 142 120 def init( options ): 143 global all_ast144 121 global all_arch 145 122 global all_debug 146 123 global all_install 147 global ast148 124 global arch 149 125 global debug … … 160 136 global timeout2gdb 161 137 162 all_ast = [AST(o) for o in list(dict.fromkeys(options.ast ))] if options.ast else [AST(None)]163 138 all_arch = [Architecture(o) for o in list(dict.fromkeys(options.arch ))] if options.arch else [Architecture(None)] 164 139 all_debug = [Debug(o) for o in list(dict.fromkeys(options.debug ))] -
tests/pybin/test_run.py
r428adbc r7f6a7c9 11 11 self.path = '' 12 12 self.arch = '' 13 self.astv = ''14 13 15 14 def toString(self): 16 return "{:25s} ({:5s} arch , {:s} ast: {:s})".format( self.name, self.arch if self.arch else "Any", self.astv if self.astvelse "Any", self.target() )15 return "{:25s} ({:5s} arch: {:s})".format( self.name, self.arch if self.arch else "Any", self.target() ) 17 16 18 17 def prepare(self): … … 22 21 def expect(self): 23 22 arch = '' if not self.arch else ".%s" % self.arch 24 astv = '' if not self.astv else ".nast" if self.astv == "new" else ".oast" 25 return os.path.normpath( os.path.join(settings.SRCDIR , self.path, ".expect", "%s%s%s.txt" % (self.name,astv,arch)) ) 23 return os.path.normpath( os.path.join(settings.SRCDIR , self.path, ".expect", "%s%s.txt" % (self.name,arch)) ) 26 24 27 25 def error_log(self): … … 58 56 59 57 @staticmethod 60 def new_target(target, arch , astv):58 def new_target(target, arch): 61 59 test = Test() 62 60 test.name = os.path.basename(target) 63 61 test.path = os.path.relpath (os.path.dirname(target), settings.SRCDIR) 64 62 test.arch = arch.target if arch else '' 65 test.astv = astv.target if astv else ''66 63 return test 67 64 -
tests/pybin/tools.py
r428adbc r7f6a7c9 182 182 '-s' if silent else None, 183 183 test_param, 184 settings.ast.flags,185 184 settings.arch.flags, 186 185 settings.debug.flags, -
tests/quotedKeyword.cfa
r428adbc r7f6a7c9 31 31 ``__int128, ``__label__, ``long, ``lvalue, ``_Noreturn, ``__builtin_offsetof, ``otype, ``register, ``restrict, 32 32 ``__restrict, ``__restrict__, ``return, ``short, ``signed, ``__signed, ``__signed__, ``sizeof, ``static, 33 ``_Static_assert, ``struct, ``switch, ``_ Thread_local, ``throw, ``throwResume, ``trait, ``try, ``typedef,33 ``_Static_assert, ``struct, ``switch, ``_thread, ``_Thread_local, ``throw, ``throwResume, ``trait, ``try, ``typedef, 34 34 ``typeof, ``__typeof, ``__typeof__, ``union, ``unsigned, ``__builtin_va_list, ``void, ``volatile, ``__volatile, 35 35 ``__volatile__, ``while; -
tests/test.py
r428adbc r7f6a7c9 23 23 24 24 def match_test(path): 25 match = re.search("^%s\/([\w\/\-_]*).expect\/([\w\-_]+)(\. nast|\.oast)?(\.[\w\-_]+)?\.txt$" % settings.SRCDIR, path)25 match = re.search("^%s\/([\w\/\-_]*).expect\/([\w\-_]+)(\.[\w\-_]+)?\.txt$" % settings.SRCDIR, path) 26 26 if match : 27 27 test = Test() 28 28 test.name = match.group(2) 29 29 test.path = match.group(1) 30 test.arch = match.group(4)[1:] if match.group(4) else None 31 32 astv = match.group(3)[1:] if match.group(3) else None 33 if astv == 'oast': 34 test.astv = 'old' 35 elif astv == 'nast': 36 test.astv = 'new' 37 elif astv: 38 print('ERROR: "%s", expect file has astv but it is not "nast" or "oast"' % testname, file=sys.stderr) 39 sys.exit(1) 30 test.arch = match.group(3)[1:] if match.group(3) else None 40 31 41 32 expected.append(test) … … 81 72 # this is a valid name, let's check if it already exists 82 73 found = [test for test in all_tests if canonical_path( test.target() ) == testname] 83 setup = itertools.product(settings.all_arch if options.arch else [None] , settings.all_ast if options.ast else [None])74 setup = itertools.product(settings.all_arch if options.arch else [None]) 84 75 if not found: 85 # it's a new name, create it according to the name and specified architecture /ast version86 tests.extend( [Test.new_target(testname, arch , ast) for arch, astin setup] )76 # it's a new name, create it according to the name and specified architecture 77 tests.extend( [Test.new_target(testname, arch) for arch in setup] ) 87 78 elif len(found) == 1 and not found[0].arch: 88 79 # we found a single test, the user better be wanting to create a cross platform test 89 80 if options.arch: 90 81 print('ERROR: "%s", test has no specified architecture but --arch was specified, ignoring it' % testname, file=sys.stderr) 91 elif options.ast:92 print('ERROR: "%s", test has no specified ast version but --ast was specified, ignoring it' % testname, file=sys.stderr)93 82 else: 94 83 tests.append( found[0] ) 95 84 else: 96 85 # this test is already cross platform, just add a test for each platform the user asked 97 tests.extend( [Test.new_target(testname, arch , ast) for arch, astin setup] )86 tests.extend( [Test.new_target(testname, arch) for arch in setup] ) 98 87 99 88 # print a warning if it users didn't ask for a specific architecture … … 102 91 print('WARNING: "%s", test has architecture specific expected files but --arch was not specified, regenerating only for current host' % testname, file=sys.stderr) 103 92 104 105 # print a warning if it users didn't ask for a specific ast version106 found_astv = [f.astv for f in found if f.astv]107 if found_astv and not options.ast:108 print('WARNING: "%s", test has ast version specific expected files but --ast was not specified, regenerating only for current ast' % testname, file=sys.stderr)109 110 93 else : 111 94 print('ERROR: "%s", tests are not allowed to end with a C/C++/CFA extension, ignoring it' % testname, file=sys.stderr) … … 127 110 # create a parser with the arguments for the tests script 128 111 parser = argparse.ArgumentParser(description='Script which runs cforall tests') 129 parser.add_argument('--ast', help='Test for specific ast', type=comma_separated(str), default=None)130 112 parser.add_argument('--arch', help='Test for specific architecture', type=comma_separated(str), default=None) 131 113 parser.add_argument('--debug', help='Run all tests in debug or release', type=comma_separated(yes_no), default='yes') … … 351 333 352 334 # print the possible options 353 print("-h --help --debug --dry-run --list --a st=new --ast=old --arch --all --regenerate-expected --archive-errors --install --timeout --global-timeout --timeout-with-gdb -j --jobs -I --include -E --exclude --continue ", end='')335 print("-h --help --debug --dry-run --list --arch --all --regenerate-expected --archive-errors --install --timeout --global-timeout --timeout-with-gdb -j --jobs -I --include -E --exclude --continue ", end='') 354 336 print(" ".join(map(lambda t: "%s" % (t.target()), tests))) 355 337 … … 422 404 # for each build configurations, run the test 423 405 with Timed() as total_dur: 424 for ast, arch, debug, install in itertools.product(settings.all_ast, settings.all_arch, settings.all_debug, settings.all_install): 425 settings.ast = ast 406 for arch, debug, install in itertools.product(settings.all_arch, settings.all_debug, settings.all_install): 426 407 settings.arch = arch 427 408 settings.debug = debug … … 430 411 # filter out the tests for a different architecture 431 412 # tests are the same across debug/install 432 local_tests = settings.ast.filter( tests ) 433 local_tests = settings.arch.filter( local_tests ) 413 local_tests = settings.arch.filter( tests ) 434 414 435 415 # check the build configuration works … … 438 418 439 419 # print configuration 440 print('%s %i tests on %i cores (%s :%s- %s)' % (420 print('%s %i tests on %i cores (%s - %s)' % ( 441 421 'Regenerating' if settings.generating else 'Running', 442 422 len(local_tests), 443 423 jobs, 444 settings.ast.string,445 424 settings.arch.string, 446 425 settings.debug.string
Note:
See TracChangeset
for help on using the changeset viewer.