Changeset 1fcc2f3
- Timestamp:
- Nov 7, 2019, 2:49:24 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- f2d1335
- Parents:
- 396b830 (diff), d056d0d (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. - Files:
-
- 10 added
- 1 deleted
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
Jenkins/FullBuild
r396b830 r1fcc2f3 17 17 18 18 parallel ( 19 clang_x86: { trigger_build( 'gcc-8', 'x86' ) }, 20 gcc_5_x86: { trigger_build( 'gcc-7', 'x86' ) }, 21 gcc_6_x86: { trigger_build( 'gcc-6', 'x86' ) }, 22 gcc_6_x64: { trigger_build( 'gcc-9', 'x64' ) }, 23 gcc_6_x64: { trigger_build( 'gcc-8', 'x64' ) }, 24 gcc_6_x64: { trigger_build( 'gcc-7', 'x64' ) }, 19 25 gcc_6_x64: { trigger_build( 'gcc-6', 'x64' ) }, 20 gcc_6_x86: { trigger_build( 'gcc-6', 'x86' ) },21 26 gcc_5_x64: { trigger_build( 'gcc-5', 'x64' ) }, 22 gcc_5_x86: { trigger_build( 'gcc-5', 'x86' ) },23 27 clang_x64: { trigger_build( 'clang', 'x64' ) }, 24 clang_x86: { trigger_build( 'clang', 'x86' ) },25 28 ) 26 29 } -
Jenkinsfile_disabled
r396b830 r1fcc2f3 224 224 //Routine responsible of sending the email notification once the build is completed 225 225 //=========================================================================================================== 226 @NonCPS 227 def SplitLines(String text) { 228 def list = [] 229 230 text.eachLine { 231 list += it 232 } 233 234 return list 235 } 236 226 237 def GitLogMessage() { 227 238 if (!Settings || !Settings.GitOldRef || !Settings.GitNewRef) return "\nERROR retrieveing git information!\n" 228 239 229 sh "${SrcDir}/tools/PrettyGitLogs.sh ${SrcDir} ${BuildDir} ${Settings.GitOldRef} ${Settings.GitNewRef}" 230 231 def gitUpdate = readFile("${BuildDir}/GIT_UPDATE") 232 def gitLog = readFile("${BuildDir}/GIT_LOG") 233 def gitDiff = readFile("${BuildDir}/GIT_DIFF") 240 def oldRef = Settings.GitOldRef 241 def newRef = Settings.GitNewRef 242 243 def revText = sh(returnStdout: true, script: "git rev-list ${oldRef}..${newRef}").trim() 244 def revList = SplitLines( revText ) 245 246 def gitUpdate = "" 247 revList.each { rev -> 248 def type = sh(returnStdout: true, script: "git cat-file -t ${rev}").trim() 249 gitUpdate = gitUpdate + " via ${rev} (${type})" 250 } 251 252 def rev = oldRef 253 def type = sh(returnStdout: true, script: "git cat-file -t ${rev}").trim() 254 gitUpdate = gitUpdate + " from ${rev} (${type})" 255 256 def gitLog = sh(returnStdout: true, script: "git rev-list --format=short ${oldRef}...${newRef}").trim() 257 258 def gitDiff = sh(returnStdout: true, script: "git diff --stat --color ${newRef} ${oldRef}").trim() 259 gitDiff = gitDiff.replace('[32m', '<span style="color: #00AA00;">') 260 gitDiff = gitDiff.replace('[31m', '<span style="color: #AA0000;">') 261 gitDiff = gitDiff.replace('[m', '</span>') 234 262 235 263 return """ … … 330 358 BuildSettings(java.util.Collections$UnmodifiableMap param, String branch) { 331 359 switch( param.Compiler ) { 360 case 'gcc-9': 361 this.Compiler = new CC_Desc('gcc-9', 'g++-9', 'gcc-9') 362 break 363 case 'gcc-8': 364 this.Compiler = new CC_Desc('gcc-8', 'g++-8', 'gcc-8') 365 break 366 case 'gcc-7': 367 this.Compiler = new CC_Desc('gcc-7', 'g++-7', 'gcc-7') 368 break 332 369 case 'gcc-6': 333 370 this.Compiler = new CC_Desc('gcc-6', 'g++-6', 'gcc-6') … … 340 377 break 341 378 case 'clang': 342 this.Compiler = new CC_Desc('clang', 'clang++ ', 'gcc-6')379 this.Compiler = new CC_Desc('clang', 'clang++-6.0', 'gcc-6') 343 380 break 344 381 default : … … 402 439 description: 'Which compiler to use', \ 403 440 name: 'Compiler', \ 404 choices: 'gcc- 6\ngcc-5\ngcc-4.9\nclang', \405 defaultValue: 'gcc- 6', \441 choices: 'gcc-9\ngcc-8\ngcc-7\ngcc-6\ngcc-5\ngcc-4.9\nclang', \ 442 defaultValue: 'gcc-8', \ 406 443 ], \ 407 444 [$class: 'ChoiceParameterDefinition', \ -
automake/missing
-
Property
mode
changed from
120000
to100644
r396b830 r1fcc2f3 1 /usr/share/automake-1.15/missing 1 #! /bin/sh 2 # Tdelisle : having the Makefiles.in automatically regenerated causes problems 3 # when using multiple versions of automake, even if only on end user machines 4 # therefore I am disabling that feature by commenting this script 5 exit 0 -
Property
mode
changed from
-
doc/papers/concurrency/Paper.tex
r396b830 r1fcc2f3 253 253 \lstMakeShortInline@% 254 254 255 \newcommand{\commenttd}[1]{{\color{red}{Thierry : #1}}} 256 255 257 \let\OLDthebibliography\thebibliography 256 258 \renewcommand\thebibliography[1]{ … … 970 972 % } 971 973 % int main() { 972 % 974 % 973 975 % for ( int i = 0; i < 10; i += 1 ) { 974 976 % printf( "%d\n", fib() ); … … 1707 1709 if ( random() % 3 ) transfer( b1, b2, 7 ); 1708 1710 } 1709 } 1711 } 1710 1712 int main() { 1711 1713 `Person p1 = { b1, b2 }, p2 = { b2, b1 };` … … 1737 1739 if ( random() % 3 ) transfer( b1, b2, 7 ); 1738 1740 } 1739 } 1741 } 1740 1742 int main() { 1741 1743 `thread p1(person, ref(b1), ref(b2)), p2(person, ref(b2), ref(b1));` … … 1915 1917 % forall( otype T ) { // distribute forall 1916 1918 % monitor Buffer { 1917 % 1919 % 1918 1920 % int front, back, count; 1919 1921 % T elements[10]; … … 1927 1929 % if ( count == 10 ) `waitfor( remove, buffer )`; 1928 1930 % // insert elem into buffer 1929 % 1931 % 1930 1932 % } 1931 1933 % T remove( Buffer(T) & mutex buffer ) with(buffer) { 1932 1934 % if ( count == 0 ) `waitfor( insert, buffer )`; 1933 1935 % // remove elem from buffer 1934 % 1936 % 1935 1937 % return elem; 1936 1938 % } … … 2540 2542 % \section{Parallelism} 2541 2543 % \label{s:Parallelism} 2542 % 2544 % 2543 2545 % Historically, computer performance was about processor speeds. 2544 2546 % However, with heat dissipation being a direct consequence of speed increase, parallelism is the new source for increased performance~\cite{Sutter05, Sutter05b}. … … 2547 2549 % However, kernel threads are better as an implementation tool because of complexity and higher cost. 2548 2550 % Therefore, different abstractions are often layered onto kernel threads to simplify them, \eg pthreads. 2549 % 2550 % 2551 % 2552 % 2551 2553 % \subsection{User Threads} 2552 % 2554 % 2553 2555 % A direct improvement on kernel threads is user threads, \eg Erlang~\cite{Erlang} and \uC~\cite{uC++book}. 2554 2556 % This approach provides an interface that matches the language paradigms, gives more control over concurrency by the language runtime, and an abstract (and portable) interface to the underlying kernel threads across operating systems. … … 2556 2558 % Like kernel threads, user threads support preemption, which maximizes nondeterminism, but increases the potential for concurrency errors: race, livelock, starvation, and deadlock. 2557 2559 % \CFA adopts user-threads to provide more flexibility and a low-cost mechanism to build any other concurrency approach, \eg thread pools and actors~\cite{Actors}. 2558 % 2560 % 2559 2561 % A variant of user thread is \newterm{fibres}, which removes preemption, \eg Go~\cite{Go} @goroutine@s. 2560 2562 % Like functional programming, which removes mutation and its associated problems, removing preemption from concurrency reduces nondeterminism, making race and deadlock errors more difficult to generate. -
driver/cc1.cc
r396b830 r1fcc2f3 10 10 // Created On : Fri Aug 26 14:23:51 2005 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Sep 9 17:50:53 201913 // Update Count : 38 412 // Last Modified On : Sun Oct 20 08:14:33 2019 13 // Update Count : 385 14 14 // 15 15 … … 503 503 execvp( args[0], (char * const *)args ); // should not return 504 504 perror( "CC1 Translator error: stage 2 cc1, execvp" ); 505 cerr << " invoked " << cargs[0] << endl;505 cerr << " invoked " << args[0] << endl; 506 506 exit( EXIT_FAILURE ); // tell gcc not to go any further 507 507 } // if -
libcfa/automake/missing
-
Property
mode
changed from
120000
to100644
r396b830 r1fcc2f3 1 /usr/share/automake-1.15/missing 1 #! /bin/sh 2 # Tdelisle : having the Makefiles.in automatically regenerated causes problems 3 # when using multiple versions of automake, even if only on end user machines 4 # therefore I am disabling that feature by commenting this script 5 exit 0 -
Property
mode
changed from
-
libcfa/src/concurrency/kernel_private.hfa
r396b830 r1fcc2f3 34 34 static inline void WakeThread( thread_desc * thrd ) { 35 35 if( !thrd ) return; 36 37 verify(thrd->state == Inactive); 36 38 37 39 disable_interrupts(); -
libcfa/src/heap.cfa
r396b830 r1fcc2f3 10 10 // Created On : Tue Dec 19 21:58:35 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Jul 24 13:12:45201913 // Update Count : 55 012 // Last Modified On : Fri Oct 18 07:42:09 2019 13 // Update Count : 556 14 14 // 15 15 … … 541 541 // along with the block and is a multiple of the alignment size. 542 542 543 if ( unlikely( size > ~0ul - sizeof(HeapManager.Storage) ) ) return 0; 543 544 size_t tsize = size + sizeof(HeapManager.Storage); 544 545 if ( likely( tsize < mmapStart ) ) { // small size => sbrk … … 592 593 block->header.kind.real.home = freeElem; // pointer back to free list of apropriate size 593 594 } else { // large size => mmap 595 if ( unlikely( size > ~0ul - pageSize ) ) return 0; 594 596 tsize = libCeiling( tsize, pageSize ); // must be multiple of page size 595 597 #ifdef __STATISTICS__ … … 888 890 } // realloc 889 891 890 891 892 // The obsolete function memalign() allocates size bytes and returns a pointer to the allocated memory. The memory 892 893 // address will be a multiple of alignment, which must be a power of two. … … 992 993 size_t malloc_alignment( void * addr ) { 993 994 if ( unlikely( addr == 0 ) ) return libAlign(); // minimum alignment 994 HeapManager.Storage.Header * header = (HeapManager.Storage.Header *)( (char *)addr - sizeof(HeapManager.Storage));995 HeapManager.Storage.Header * header = headerAddr( addr ); 995 996 if ( (header->kind.fake.alignment & 1) == 1 ) { // fake header ? 996 997 return header->kind.fake.alignment & -2; // remove flag from value … … 1004 1005 bool malloc_zero_fill( void * addr ) { 1005 1006 if ( unlikely( addr == 0 ) ) return false; // null allocation is not zero fill 1006 1007 HeapManager.Storage.Header * header = (HeapManager.Storage.Header *)( (char *)addr - sizeof(HeapManager.Storage) ); 1007 HeapManager.Storage.Header * header = headerAddr( addr ); 1008 1008 if ( (header->kind.fake.alignment & 1) == 1 ) { // fake header ? 1009 1009 header = (HeapManager.Storage.Header *)((char *)header - header->kind.fake.offset); -
libcfa/src/stdlib.cfa
r396b830 r1fcc2f3 10 10 // Created On : Thu Jan 28 17:10:29 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Jun 24 17:34:44201913 // Update Count : 4 6212 // Last Modified On : Tue Oct 22 08:57:52 2019 13 // Update Count : 478 14 14 // 15 15 … … 21 21 #include <string.h> // memcpy, memset 22 22 #include <malloc.h> // malloc_usable_size 23 #include <math.h> // fabsf, fabs, fabsl23 //#include <math.h> // fabsf, fabs, fabsl 24 24 #include <complex.h> // _Complex_I 25 25 #include <assert.h> … … 27 27 //--------------------------------------- 28 28 29 // resize, non-array types 30 forall( dtype T | sized(T) ) T * alloc( T ptr[], size_t dim, char fill ) { 31 size_t olen = malloc_usable_size( ptr ); // current allocation 32 char * nptr = (void *)realloc( (void *)ptr, dim * (size_t)sizeof(T) ); // C realloc 33 size_t nlen = malloc_usable_size( nptr ); // new allocation 34 if ( nlen > olen ) { // larger ? 35 memset( nptr + olen, (int)fill, nlen - olen ); // initialize added storage 36 } // 37 return (T *)nptr; 38 } // alloc 29 forall( dtype T | sized(T) ) { 30 T * alloc_set( T ptr[], size_t dim, char fill ) { // realloc array with fill 31 size_t olen = malloc_usable_size( ptr ); // current allocation 32 char * nptr = (char *)realloc( (void *)ptr, dim * sizeof(T) ); // C realloc 33 size_t nlen = malloc_usable_size( nptr ); // new allocation 34 if ( nlen > olen ) { // larger ? 35 memset( nptr + olen, (int)fill, nlen - olen ); // initialize added storage 36 } // if 37 return (T *)nptr; 38 } // alloc_set 39 40 T * alloc_align( T ptr[], size_t align ) { // aligned realloc array 41 char * nptr; 42 size_t alignment = malloc_alignment( ptr ); 43 if ( align != alignment && (uintptr_t)ptr % align != 0 ) { 44 size_t olen = malloc_usable_size( ptr ); // current allocation 45 nptr = (char *)memalign( align, olen ); 46 size_t nlen = malloc_usable_size( nptr ); // new allocation 47 size_t lnth = olen < nlen ? olen : nlen; // min 48 memcpy( nptr, ptr, lnth ); // initialize storage 49 free( ptr ); 50 } else { 51 nptr = (char *)ptr; 52 } // if 53 return (T *)nptr; 54 } // alloc_align 55 56 T * alloc_align( T ptr[], size_t align, size_t dim ) { // aligned realloc array 57 char * nptr; 58 size_t alignment = malloc_alignment( ptr ); 59 if ( align != alignment ) { 60 size_t olen = malloc_usable_size( ptr ); // current allocation 61 nptr = (char *)memalign( align, dim * sizeof(T) ); 62 size_t nlen = malloc_usable_size( nptr ); // new allocation 63 size_t lnth = olen < nlen ? olen : nlen; // min 64 memcpy( nptr, ptr, lnth ); // initialize storage 65 free( ptr ); 66 } else { 67 nptr = (char *)realloc( (void *)ptr, dim * sizeof(T) ); // C realloc 68 } // if 69 return (T *)nptr; 70 } // alloc_align 71 72 T * alloc_align_set( T ptr[], size_t align, char fill ) { // aligned realloc with fill 73 size_t olen = malloc_usable_size( ptr ); // current allocation 74 char * nptr = alloc_align( ptr, align ); 75 size_t nlen = malloc_usable_size( nptr ); // new allocation 76 if ( nlen > olen ) { // larger ? 77 memset( nptr + olen, (int)fill, nlen - olen ); // initialize added storage 78 } // if 79 return (T *)nptr; 80 } // alloc_align_set 81 } // distribution 39 82 40 83 // allocation/deallocation and constructor/destructor, non-array types 41 84 forall( dtype T | sized(T), ttype Params | { void ?{}( T &, Params ); } ) 42 85 T * new( Params p ) { 43 return &(*malloc()){ p }; 86 return &(*malloc()){ p }; // run constructor 44 87 } // new 45 88 … … 47 90 void delete( T * ptr ) { 48 91 if ( ptr ) { // ignore null 49 ^(*ptr){}; 92 ^(*ptr){}; // run destructor 50 93 free( ptr ); 51 94 } // if … … 55 98 void delete( T * ptr, Params rest ) { 56 99 if ( ptr ) { // ignore null 57 ^(*ptr){}; 100 ^(*ptr){}; // run destructor 58 101 free( ptr ); 59 102 } // if -
libcfa/src/stdlib.hfa
r396b830 r1fcc2f3 10 10 // Created On : Thu Jan 28 17:12:35 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Jul 23 14:14:59201913 // Update Count : 3 7312 // Last Modified On : Sun Oct 20 22:57:33 2019 13 // Update Count : 390 14 14 // 15 15 … … 25 25 void * memset( void * dest, int fill, size_t size ); // string.h 26 26 void * memcpy( void * dest, const void * src, size_t size ); // string.h 27 void * cmemalign( size_t alignment, size_t noOfElems, size_t elemSize ); // CFA 27 void * cmemalign( size_t alignment, size_t noOfElems, size_t elemSize ); // CFA heap 28 28 } // extern "C" 29 29 … … 52 52 T * realloc( T * ptr, size_t size ) { 53 53 if ( unlikely( ptr == 0 ) ) return malloc(); 54 return (T *)(void *)realloc( (void *)ptr, size ); 54 return (T *)(void *)realloc( (void *)ptr, size ); // C realloc 55 55 } // realloc 56 56 57 57 T * memalign( size_t align ) { 58 return (T *)memalign( align, sizeof(T) ); 58 return (T *)memalign( align, sizeof(T) ); // C memalign 59 59 } // memalign 60 60 61 61 T * aligned_alloc( size_t align ) { 62 return (T *)aligned_alloc( align, sizeof(T) ); 62 return (T *)aligned_alloc( align, sizeof(T) ); // C aligned_alloc 63 63 } // aligned_alloc 64 64 … … 67 67 } // posix_memalign 68 68 69 70 69 // Cforall dynamic allocation 71 70 … … 74 73 } // alloc 75 74 76 T * alloc( char fill ) {77 T * ptr;78 if ( _Alignof(T) <= libAlign() ) ptr = (T *)(void *)malloc( (size_t)sizeof(T) ); // C malloc79 else ptr = (T *)memalign( _Alignof(T), sizeof(T) );80 return (T *)memset( ptr, (int)fill, sizeof(T) ); // initialize with fill value81 } // alloc82 83 75 T * alloc( size_t dim ) { 84 if ( _Alignof(T) <= libAlign() ) return (T *)(void *)malloc( dim * (size_t)sizeof(T) ); // C malloc76 if ( _Alignof(T) <= libAlign() ) return (T *)(void *)malloc( dim * (size_t)sizeof(T) ); 85 77 else return (T *)memalign( _Alignof(T), dim * sizeof(T) ); 86 78 } // alloc 87 79 88 T * alloc( size_t dim, char fill ) { 80 T * alloc( T ptr[], size_t dim ) { // realloc 81 return realloc( ptr, dim * sizeof(T) ); 82 } // alloc 83 84 T * alloc_set( char fill ) { 85 return (T *)memset( (T *)alloc(), (int)fill, sizeof(T) ); // initialize with fill value 86 } // alloc 87 88 T * alloc_set( T fill ) { 89 return (T *)memcpy( (T *)alloc(), &fill, sizeof(T) ); // initialize with fill value 90 } // alloc 91 92 T * alloc_set( size_t dim, char fill ) { 89 93 return (T *)memset( (T *)alloc( dim ), (int)fill, dim * sizeof(T) ); // initialize with fill value 90 94 } // alloc 91 95 92 T * alloc( T ptr[], size_t dim ) { 93 return realloc( ptr, dim * sizeof(T) ); 94 } // alloc 95 } // distribution 96 97 98 static inline forall( dtype T | sized(T) ) { 99 T * align_alloc( size_t align ) { 96 T * alloc_set( size_t dim, T fill ) { 97 T * r = (T *)alloc( dim ); 98 for ( i; dim ) { memcpy( &r[i], &fill, sizeof(T) ); } // initialize with fill value 99 return r; 100 } // alloc 101 102 T * alloc_set( size_t dim, const T fill[] ) { 103 return (T *)memcpy( (T *)alloc( dim ), fill, dim * sizeof(T) ); // initialize with fill value 104 } // alloc 105 } // distribution 106 107 forall( dtype T | sized(T) ) { 108 T * alloc_set( T ptr[], size_t dim, char fill ); // realloc array with fill 109 } // distribution 110 111 static inline forall( dtype T | sized(T) ) { 112 T * alloc_align( size_t align ) { 100 113 return (T *)memalign( align, sizeof(T) ); 101 } // align_alloc 102 103 T * align_alloc( size_t align, char fill ) { 104 T * ptr = (T *)memalign( align, sizeof(T) ); 105 return (T *)memset( ptr, (int)fill, sizeof(T) ); 106 } // align_alloc 107 108 T * align_alloc( size_t align, size_t dim ) { 114 } // alloc_align 115 116 T * alloc_align( size_t align, size_t dim ) { 109 117 return (T *)memalign( align, dim * sizeof(T) ); 110 } // align_alloc 111 112 T * align_alloc( size_t align, size_t dim, char fill ) { 113 if ( fill == '\0' ) { 114 return (T *)cmemalign( align, dim, sizeof(T) ); 115 } else { 116 return (T *)memset( (T *)memalign( align, dim * sizeof(T) ), (int)fill, dim * sizeof(T) ); 117 } // if 118 } // align_alloc 119 } // distribution 120 121 forall( dtype T | sized(T) ) T * alloc( T ptr[], size_t dim, char fill ); 122 118 } // alloc_align 119 120 T * alloc_align_set( size_t align, char fill ) { 121 return (T *)memset( (T *)alloc_align( align ), (int)fill, sizeof(T) ); // initialize with fill value 122 } // alloc_align 123 124 T * alloc_align_set( size_t align, T fill ) { 125 return (T *)memcpy( (T *)alloc_align( align ), &fill, sizeof(T) ); // initialize with fill value 126 } // alloc_align 127 128 T * alloc_align_set( size_t align, size_t dim, char fill ) { 129 return (T *)memset( (T *)alloc_align( align, dim ), (int)fill, dim * sizeof(T) ); // initialize with fill value 130 } // alloc_align 131 132 T * alloc_align_set( size_t align, size_t dim, T fill ) { 133 T * r = (T *)alloc_align( align, dim ); 134 for ( i; dim ) { memcpy( &r[i], &fill, sizeof(T) ); } // initialize with fill value 135 return r; 136 } // alloc_align 137 138 T * alloc_align_set( size_t align, size_t dim, const T fill[] ) { 139 return (T *)memcpy( (T *)alloc_align( align, dim ), fill, dim * sizeof(T) ); 140 } // alloc_align 141 } // distribution 142 143 forall( dtype T | sized(T) ) { 144 T * alloc_align( T ptr[], size_t align ); // realign 145 T * alloc_align( T ptr[], size_t align, size_t dim ); // aligned realloc array 146 T * alloc_align_set( T ptr[], size_t align, size_t dim, char fill ); // aligned realloc array with fill 147 } // distribution 123 148 124 149 static inline forall( dtype T | sized(T) ) { 125 150 // data, non-array types 126 127 151 T * memset( T * dest, char fill ) { 128 152 return (T *)memset( dest, fill, sizeof(T) ); … … 136 160 static inline forall( dtype T | sized(T) ) { 137 161 // data, array types 138 139 162 T * amemset( T dest[], char fill, size_t dim ) { 140 163 return (T *)(void *)memset( dest, fill, dim * sizeof(T) ); // C memset -
longrun_tests/Makefile.am
r396b830 r1fcc2f3 42 42 -I$(abs_top_srcdir)/tests \ 43 43 -I$(srcdir) \ 44 -DTEST_$(shell cat .type | tr a-z A-Z) \44 -DTEST_$(shell cat .type | tr a-z A-Z) 45 45 46 46 TESTS = block coroutine create disjoint enter enter3 processor stack wait yield -
longrun_tests/Makefile.in
r396b830 r1fcc2f3 526 526 -I$(abs_top_srcdir)/tests \ 527 527 -I$(srcdir) \ 528 -DTEST_$(shell cat .type | tr a-z A-Z) \ 529 -in-tree 528 -DTEST_$(shell cat .type | tr a-z A-Z) 530 529 531 530 TESTS = block coroutine create disjoint enter enter3 processor stack wait yield -
src/CodeGen/CodeGenerator.cc
r396b830 r1fcc2f3 9 9 // Author : Richard C. Bilson 10 10 // Created On : Mon May 18 07:44:20 2015 11 // Last Modified By : Andrew Beach12 // Last Modified On : Thr May 2 10:47:00201913 // Update Count : 49711 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Oct 19 19:30:38 2019 13 // Update Count : 506 14 14 // 15 15 #include "CodeGenerator.h" … … 198 198 // deleted decls should never be used, so don't print them 199 199 if ( objectDecl->isDeleted && options.genC ) return; 200 if (objectDecl->get_name().empty() && options.genC ) { 200 201 // gcc allows an empty declarator (no name) for bit-fields and C states: 6.7.2.1 Structure and union specifiers, 202 // point 4, page 113: If the (bit field) value is zero, the declaration shall have no declarator. For anything 203 // else, the anonymous name refers to the anonymous object for plan9 inheritance. 204 if ( objectDecl->get_name().empty() && options.genC && ! objectDecl->get_bitfieldWidth() ) { 201 205 // only generate an anonymous name when generating C code, otherwise it clutters the output too much 202 206 static UniqueName name = { "__anonymous_object" }; 203 207 objectDecl->set_name( name.newName() ); 204 205 206 207 208 // Stops unused parameter warnings. 209 if ( options.anonymousUnused ) { 210 objectDecl->attributes.push_back( new Attribute( "unused" ) ); 211 } 208 212 } 209 213 -
src/ControlStruct/MLEMutator.cc
r396b830 r1fcc2f3 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T hu Mar 8 17:08:25 201813 // Update Count : 2 1912 // Last Modified On : Tue Oct 22 17:22:44 2019 13 // Update Count : 220 14 14 // 15 15 … … 313 313 } 314 314 315 void MLEMutator::premutate( TryStmt * tryStmt ) { 316 // generate a label for breaking out of a labeled if 317 bool labeledBlock = !(tryStmt->get_labels().empty()); 318 if ( labeledBlock ) { 319 Label brkLabel = generator->newLabel("blockBreak", tryStmt); 320 enclosingControlStructures.push_back( Entry( tryStmt, brkLabel ) ); 321 GuardAction( [this]() { enclosingControlStructures.pop_back(); } ); 322 } // if 323 } 324 325 Statement * MLEMutator::postmutate( TryStmt * tryStmt ) { 326 bool labeledBlock = !(tryStmt->get_labels().empty()); 327 if ( labeledBlock ) { 328 if ( ! enclosingControlStructures.back().useBreakExit().empty() ) { 329 set_breakLabel( enclosingControlStructures.back().useBreakExit() ); 330 } // if 331 } // if 332 return tryStmt; 333 } 334 315 335 void MLEMutator::premutate( CaseStmt *caseStmt ) { 316 336 visit_children = false; -
src/ControlStruct/MLEMutator.h
r396b830 r1fcc2f3 10 10 // Created On : Mon May 18 07:44:20 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T hu Mar 8 16:42:32 201813 // Update Count : 4 112 // Last Modified On : Tue Oct 22 17:22:47 2019 13 // Update Count : 45 14 14 // 15 15 … … 47 47 void premutate( SwitchStmt *switchStmt ); 48 48 Statement * postmutate( SwitchStmt *switchStmt ); 49 void premutate( TryStmt *tryStmt ); 50 Statement * postmutate( TryStmt *tryStmt ); 49 51 50 52 Statement *mutateLoop( Statement *bodyLoop, Entry &e ); … … 73 75 explicit Entry( SwitchStmt *stmt, Label breakExit, Label fallDefaultExit ) : 74 76 stmt( stmt ), breakExit( breakExit ), fallDefaultExit( fallDefaultExit ) {} 77 78 explicit Entry( TryStmt *stmt, Label breakExit ) : 79 stmt( stmt ), breakExit( breakExit ) {} 75 80 76 81 bool operator==( const Statement *other ) { return stmt == other; } -
tests/.expect/alloc-ERROR.txt
r396b830 r1fcc2f3 1 alloc.cfa: 265:1 error: No reasonable alternatives for expression Applying untyped:1 alloc.cfa:311:1 error: No reasonable alternatives for expression Applying untyped: 2 2 Name: ?=? 3 3 ...to: … … 19 19 20 20 21 alloc.cfa: 266:1 error: No reasonable alternatives for expression Applying untyped:21 alloc.cfa:312:1 error: No reasonable alternatives for expression Applying untyped: 22 22 Name: ?=? 23 23 ...to: … … 39 39 40 40 41 alloc.cfa: 267:1 error: No reasonable alternatives for expression Applying untyped:41 alloc.cfa:313:1 error: No reasonable alternatives for expression Applying untyped: 42 42 Name: ?=? 43 43 ...to: … … 50 50 51 51 52 alloc.cfa: 268:1 error: No reasonable alternatives for expression Applying untyped:52 alloc.cfa:314:1 error: No reasonable alternatives for expression Applying untyped: 53 53 Name: ?=? 54 54 ...to: -
tests/.expect/alloc.txt
r396b830 r1fcc2f3 2 2 CFA malloc 0xdeadbeef 3 3 CFA alloc 0xdeadbeef 4 CFA alloc, fill ffffffff 4 CFA array alloc, fill 0xde 5 CFA alloc, fill dededede 6 CFA alloc, fill 3 5 7 6 8 C array calloc, fill 0 … … 10 12 CFA array alloc, no fill 11 13 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 12 CFA array alloc, fill 0xff 13 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 14 CFA array alloc, fill 0xde 15 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 16 CFA array alloc, fill 0xef 17 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 18 CFA array alloc, fill from array 19 0xefefefef 0xefefefef, 0xefefefef 0xefefefef, 0xefefefef 0xefefefef, 0xefefefef 0xefefefef, 0xefefefef 0xefefefef, 0xefefefef 0xefefefef, 0xefefefef 0xefefefef, 0xefefefef 0xefefefef, 0xefefefef 0xefefefef, 0xefefefef 0xefefefef, 0xefefefef 0xefefefef, 0xefefefef 0xefefefef, 0xefefefef 0xefefefef, 0xefefefef 0xefefefef, 0xefefefef 0xefefefef, 0xefefefef 0xefefefef, 0xefefefef 0xefefefef, 0xefefefef 0xefefefef, 0xefefefef 0xefefefef, 0xefefefef 0xefefefef, 14 20 15 C 16 0x deadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef21 C realloc 22 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 17 23 CFA realloc 18 0x deadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0x101010124 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0xefefefef 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 19 25 20 CFA resize a lloc26 CFA resize array alloc 21 27 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 22 28 CFA resize array alloc … … 25 31 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 26 32 CFA resize array alloc, fill 27 0x ffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff33 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 28 34 CFA resize array alloc, fill 29 0x ffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff35 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 30 36 CFA resize array alloc, fill 31 0x ffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff37 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0xdeadbeef 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0x1010101 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 0xdededede 32 38 33 39 C memalign 42 42.5 … … 35 41 CFA posix_memalign 42 42.5 36 42 CFA posix_memalign 42 42.5 37 CFA aligned_alloc 42 42.5 38 CFA align_alloc 42 42.5 39 CFA align_alloc fill 0xffffffff -nan 43 CFA alloc_align 42 42.5 44 CFA alloc_align 42 42.5 45 CFA alloc_align fill 0xdededede -0x1.ededededededep+494 46 CFA alloc_align fill 42 42.5 47 CFA alloc_align 42 42.5 40 48 41 CFA array al ign_alloc49 CFA array alloc_align 42 50 42 42.5, 42 42.5, 42 42.5, 42 42.5, 42 42.5, 42 42.5, 42 42.5, 42 42.5, 42 42.5, 42 42.5, 43 CFA array align_alloc, fill 44 0xffffffff -nan, 0xffffffff -nan, 0xffffffff -nan, 0xffffffff -nan, 0xffffffff -nan, 0xffffffff -nan, 0xffffffff -nan, 0xffffffff -nan, 0xffffffff -nan, 0xffffffff -nan, 51 CFA array alloc_align, fill 52 0xdededede -0x1.ededededededep+494, 0xdededede -0x1.ededededededep+494, 0xdededede -0x1.ededededededep+494, 0xdededede -0x1.ededededededep+494, 0xdededede -0x1.ededededededep+494, 0xdededede -0x1.ededededededep+494, 0xdededede -0x1.ededededededep+494, 0xdededede -0x1.ededededededep+494, 0xdededede -0x1.ededededededep+494, 0xdededede -0x1.ededededededep+494, 53 CFA array alloc_align, fill 54 42 42.5, 42 42.5, 42 42.5, 42 42.5, 42 42.5, 42 42.5, 42 42.5, 42 42.5, 42 42.5, 42 42.5, 55 CFA array alloc_align, fill array 56 42 42.5, 42 42.5, 42 42.5, 42 42.5, 42 42.5, 42 42.5, 42 42.5, 42 42.5, 42 42.5, 42 42.5, 57 CFA realloc array alloc_align 58 42 42.5, 42 42.5, 42 42.5, 42 42.5, 42 42.5, 42 42.5, 42 42.5, 42 42.5, 42 42.5, 42 42.5, 45 59 46 CFA memset 0x ffffffff -nan47 CFA memcpy 0x ffffffff -nan60 CFA memset 0xdededede -0x1.ededededededep+494 61 CFA memcpy 0xdededede -0x1.ededededededep+494 48 62 49 63 CFA array memset 50 0x ffffffff -nan, 0xffffffff -nan, 0xffffffff -nan, 0xffffffff -nan, 0xffffffff -nan, 0xffffffff -nan, 0xffffffff -nan, 0xffffffff -nan, 0xffffffff -nan, 0xffffffff -nan,64 0xdededede -0x1.ededededededep+494, 0xdededede -0x1.ededededededep+494, 0xdededede -0x1.ededededededep+494, 0xdededede -0x1.ededededededep+494, 0xdededede -0x1.ededededededep+494, 0xdededede -0x1.ededededededep+494, 0xdededede -0x1.ededededededep+494, 0xdededede -0x1.ededededededep+494, 0xdededede -0x1.ededededededep+494, 0xdededede -0x1.ededededededep+494, 51 65 CFA array memcpy 52 0x ffffffff -nan, 0xffffffff -nan, 0xffffffff -nan, 0xffffffff -nan, 0xffffffff -nan, 0xffffffff -nan, 0xffffffff -nan, 0xffffffff -nan, 0xffffffff -nan, 0xffffffff -nan,66 0xdededede -0x1.ededededededep+494, 0xdededede -0x1.ededededededep+494, 0xdededede -0x1.ededededededep+494, 0xdededede -0x1.ededededededep+494, 0xdededede -0x1.ededededededep+494, 0xdededede -0x1.ededededededep+494, 0xdededede -0x1.ededededededep+494, 0xdededede -0x1.ededededededep+494, 0xdededede -0x1.ededededededep+494, 0xdededede -0x1.ededededededep+494, 53 67 54 68 CFA new initialize -
tests/.expect/attributes.x64.txt
r396b830 r1fcc2f3 784 784 signed int _X4apd7Fi_Fi_i_Fi_i___1(__attribute__ ((unused,unused,unused)) signed int (*__anonymous_object23)(__attribute__ ((unused)) signed int __anonymous_object24), __attribute__ ((unused,unused,unused)) signed int (*__anonymous_object25)(__attribute__ ((unused)) signed int __anonymous_object26)); 785 785 struct Vad { 786 __attribute__ ((unused)) signed int __anonymous_object27:4;787 __attribute__ ((unused)) signed int __anonymous_object28:4;788 __attribute__ ((unused,unused)) signed int __anonymous_object29:6;786 __attribute__ ((unused)) signed int :4; 787 __attribute__ ((unused)) signed int :4; 788 __attribute__ ((unused,unused)) signed int :6; 789 789 }; 790 790 static inline void _X12_constructorFv_S3Vad_autogen___1(struct Vad *_X4_dstS3Vad_1); -
tests/.expect/attributes.x86.txt
r396b830 r1fcc2f3 784 784 signed int _X4apd7Fi_Fi_i_Fi_i___1(__attribute__ ((unused,unused,unused)) signed int (*__anonymous_object23)(__attribute__ ((unused)) signed int __anonymous_object24), __attribute__ ((unused,unused,unused)) signed int (*__anonymous_object25)(__attribute__ ((unused)) signed int __anonymous_object26)); 785 785 struct Vad { 786 __attribute__ ((unused)) signed int __anonymous_object27:4;787 __attribute__ ((unused)) signed int __anonymous_object28:4;788 __attribute__ ((unused,unused)) signed int __anonymous_object29:6;786 __attribute__ ((unused)) signed int :4; 787 __attribute__ ((unused)) signed int :4; 788 __attribute__ ((unused,unused)) signed int :6; 789 789 }; 790 790 static inline void _X12_constructorFv_S3Vad_autogen___1(struct Vad *_X4_dstS3Vad_1); -
tests/Makefile.am
r396b830 r1fcc2f3 46 46 47 47 # adjust CC to current flags 48 CC = $(if $( ifeq $(DISTCC_CFA_PATH),yes),distcc $(DISTCC_CFA_PATH),$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS})48 CC = $(if $(DISTCC_CFA_PATH),distcc $(DISTCC_CFA_PATH),$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS}) 49 49 CFACC = $(CC) 50 50 -
tests/Makefile.in
r396b830 r1fcc2f3 214 214 215 215 # adjust CC to current flags 216 CC = $(if $( ifeq $(DISTCC_CFA_PATH),yes),distcc $(DISTCC_CFA_PATH),$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS})216 CC = $(if $(DISTCC_CFA_PATH),distcc $(DISTCC_CFA_PATH),$(TARGET_CFA) ${DEBUG_FLAGS} ${ARCH_FLAGS}) 217 217 CCAS = @CCAS@ 218 218 CCASDEPMODE = @CCASDEPMODE@ -
tests/alloc.cfa
r396b830 r1fcc2f3 10 10 // Created On : Wed Feb 3 07:56:22 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Nov 6 17:50:52 201813 // Update Count : 3 3912 // Last Modified On : Sun Oct 20 21:45:21 2019 13 // Update Count : 391 14 14 // 15 15 … … 19 19 #include <stdlib.h> // posix_memalign 20 20 #include <fstream.hfa> 21 #include <stdlib.hfa> 21 #include <stdlib.hfa> // access C malloc, realloc 22 22 23 23 int * foo( int * p, int c ) { return p; } … … 27 27 int main( void ) { 28 28 size_t dim = 10; 29 char fill = '\x ff';30 int * p ;29 char fill = '\xde'; 30 int * p, * p1; 31 31 32 32 // allocation, non-array types 33 34 // int & r = malloc();35 // r = 0xdeadbeef;36 // printf( "C malloc %#x\n", r );37 // free( &r );38 33 39 34 p = (int *)malloc( sizeof(*p) ); // C malloc, type unsafe … … 52 47 free( p ); 53 48 54 p = alloc( fill ); // CFA alloc, fill 49 p = alloc_set( fill ); // CFA alloc, fill 50 printf( "CFA array alloc, fill %#hhx\n", fill ); 55 51 printf( "CFA alloc, fill %08x\n", *p ); 52 free( p ); 53 54 p = alloc_set( 3 ); // CFA alloc, fill 55 printf( "CFA alloc, fill %d\n", *p ); 56 56 free( p ); 57 57 … … 79 79 free( p ); 80 80 81 p = alloc ( 2 * dim, fill );// CFA array alloc, fill81 p = alloc_set( 2 * dim, fill ); // CFA array alloc, fill 82 82 printf( "CFA array alloc, fill %#hhx\n", fill ); 83 83 for ( i; 2 * dim ) { printf( "%#x ", p[i] ); } 84 84 printf( "\n" ); 85 // do not free 85 free( p ); 86 87 p = alloc_set( 2 * dim, 0xdeadbeef ); // CFA array alloc, fill 88 printf( "CFA array alloc, fill %#hhx\n", 0xdeadbeef ); 89 for ( i; 2 * dim ) { printf( "%#x ", p[i] ); } 90 printf( "\n" ); 91 // do not free 92 93 p1 = alloc_set( 2 * dim, p ); // CFA array alloc, fill 94 printf( "CFA array alloc, fill from array\n" ); 95 for ( i; 2 * dim ) { printf( "%#x %#x, ", p[i], p1[i] ); } 96 free( p1 ); 97 printf( "\n" ); 86 98 87 99 … … 90 102 91 103 p = (int *)realloc( p, dim * sizeof(*p) ); // C realloc 92 for ( i; dim ) { p[i] = 0xdeadbeef; }93 printf( "C realloc\n" );94 for ( i; dim ) { printf( "%#x ", p[i] ); }95 printf( "\n" );104 printf( "C realloc\n" ); 105 for ( i; dim ) { printf( "%#x ", p[i] ); } 106 printf( "\n" ); 107 // do not free 96 108 97 109 p = realloc( p, 2 * dim * sizeof(*p) ); // CFA realloc … … 108 120 p = alloc( p, dim ); // CFA resize array alloc 109 121 for ( i; dim ) { p[i] = 0xdeadbeef; } 110 printf( "CFA resize alloc\n" ); 111 for ( i; dim ) { printf( "%#x ", p[i] ); } 112 printf( "\n" ); 122 printf( "CFA resize array alloc\n" ); 123 for ( i; dim ) { printf( "%#x ", p[i] ); } 124 printf( "\n" ); 125 // do not free 113 126 114 127 p = alloc( p, 2 * dim ); // CFA resize array alloc … … 117 130 for ( i; 2 * dim ) { printf( "%#x ", p[i] ); } 118 131 printf( "\n" ); 119 120 p = alloc( p, dim ); // CFA array alloc 132 // do not free 133 134 p = alloc( p, dim ); // CFA resize array alloc 121 135 printf( "CFA resize array alloc\n" ); 122 136 for ( i; dim ) { printf( "%#x ", p[i] ); } 123 137 printf( "\n" ); 124 125 free( p ); 126 p = 0; 127 128 p = alloc( p, dim, fill ); // CFA array alloc, fill 138 // do not free 139 140 p = alloc_set( p, 3 * dim, fill ); // CFA resize array alloc, fill 129 141 printf( "CFA resize array alloc, fill\n" ); 130 for ( i; dim ) { printf( "%#x ", p[i] ); } 131 printf( "\n" ); 132 133 p = alloc( p, 2 * dim, fill ); // CFA array alloc, fill 142 for ( i; 3 * dim ) { printf( "%#x ", p[i] ); } 143 printf( "\n" ); 144 // do not free 145 146 p = alloc_set( p, dim, fill ); // CFA resize array alloc, fill 134 147 printf( "CFA resize array alloc, fill\n" ); 135 for ( i; 2 * dim ) { printf( "%#x ", p[i] ); } 136 printf( "\n" ); 137 138 p = alloc( p, dim, fill ); // CFA array alloc, fill 148 for ( i; dim ) { printf( "%#x ", p[i] ); } 149 printf( "\n" ); 150 // do not free 151 152 p = alloc_set( p, 3 * dim, fill ); // CFA resize array alloc, fill 139 153 printf( "CFA resize array alloc, fill\n" ); 140 for ( i; dim ) { printf( "%#x ", p[i] );; }154 for ( i; 3 * dim ) { printf( "%#x ", p[i] );; } 141 155 printf( "\n" ); 142 156 free( p ); … … 172 186 free( stp ); 173 187 174 stp = &(*aligned_alloc( Alignment )){ 42, 42.5 }; // CFA aligned_alloc 175 assert( (uintptr_t)stp % Alignment == 0 ); 176 printf( "CFA aligned_alloc %d %g\n", stp->x, stp->y ); 177 free( stp ); 178 179 stp = &(*align_alloc( Alignment )){ 42, 42.5 }; // CFA align_alloc 180 assert( (uintptr_t)stp % Alignment == 0 ); 181 printf( "CFA align_alloc %d %g\n", stp->x, stp->y ); 182 free( stp ); 183 184 stp = align_alloc( Alignment, fill ); // CFA memalign, fill 185 assert( (uintptr_t)stp % Alignment == 0 ); 186 printf( "CFA align_alloc fill %#x %a\n", stp->x, stp->y ); 188 stp = &(*alloc_align( Alignment)){ 42, 42.5 }; // CFA alloc_align 189 assert( (uintptr_t)stp % Alignment == 0 ); 190 printf( "CFA alloc_align %d %g\n", stp->x, stp->y ); 191 free( stp ); 192 193 stp = &(*alloc_align( Alignment )){ 42, 42.5 }; // CFA alloc_align 194 assert( (uintptr_t)stp % Alignment == 0 ); 195 printf( "CFA alloc_align %d %g\n", stp->x, stp->y ); 196 free( stp ); 197 198 stp = alloc_align_set( Alignment, fill ); // CFA memalign, fill 199 assert( (uintptr_t)stp % Alignment == 0 ); 200 printf( "CFA alloc_align fill %#x %a\n", stp->x, stp->y ); 201 free( stp ); 202 203 stp = alloc_align_set( Alignment, (Struct){ 42, 42.5 } ); // CFA memalign, fill 204 assert( (uintptr_t)stp % Alignment == 0 ); 205 printf( "CFA alloc_align fill %d %g\n", stp->x, stp->y ); 206 // do not free 207 208 stp = &(*alloc_align( stp, 4096 )){ 42, 42.5 }; // CFA realign 209 assert( (uintptr_t)stp % 4096 == 0 ); 210 printf( "CFA alloc_align %d %g\n", stp->x, stp->y ); 187 211 free( stp ); 188 212 … … 191 215 printf( "\n" ); 192 216 193 stp = al ign_alloc( Alignment, dim ); // CFA array memalign217 stp = alloc_align( Alignment, dim ); // CFA array memalign 194 218 assert( (uintptr_t)stp % Alignment == 0 ); 195 219 for ( i; dim ) { stp[i] = (Struct){ 42, 42.5 }; } 196 printf( "CFA array al ign_alloc\n" );220 printf( "CFA array alloc_align\n" ); 197 221 for ( i; dim ) { printf( "%d %g, ", stp[i].x, stp[i].y ); } 198 222 printf( "\n" ); 199 223 free( stp ); 200 224 201 stp = al ign_alloc( Alignment, dim, fill );// CFA array memalign, fill202 assert( (uintptr_t)stp % Alignment == 0 ); 203 printf( "CFA array al ign_alloc, fill\n" );225 stp = alloc_align_set( Alignment, dim, fill ); // CFA array memalign, fill 226 assert( (uintptr_t)stp % Alignment == 0 ); 227 printf( "CFA array alloc_align, fill\n" ); 204 228 for ( i; dim ) { printf( "%#x %a, ", stp[i].x, stp[i].y ); } 229 printf( "\n" ); 230 free( stp ); 231 232 stp = alloc_align_set( Alignment, dim, (Struct){ 42, 42.5 } ); // CFA array memalign, fill 233 assert( (uintptr_t)stp % Alignment == 0 ); 234 printf( "CFA array alloc_align, fill\n" ); 235 for ( i; dim ) { printf( "%d %g, ", stp[i].x, stp[i].y ); } 236 printf( "\n" ); 237 // do not free 238 239 stp1 = alloc_align_set( Alignment, dim, stp ); // CFA array memalign, fill 240 assert( (uintptr_t)stp % Alignment == 0 ); 241 printf( "CFA array alloc_align, fill array\n" ); 242 for ( i; dim ) { printf( "%d %g, ", stp1[i].x, stp1[i].y ); } 243 printf( "\n" ); 244 free( stp1 ); 245 246 stp = alloc_align( stp, 4096, dim ); // CFA aligned realloc array 247 assert( (uintptr_t)stp % 4096 == 0 ); 248 for ( i; dim ) { stp[i] = (Struct){ 42, 42.5 }; } 249 printf( "CFA realloc array alloc_align\n" ); 250 for ( i; dim ) { printf( "%d %g, ", stp[i].x, stp[i].y ); } 205 251 printf( "\n" ); 206 252 free( stp ); -
tests/concurrent/examples/quickSort.cfa
r396b830 r1fcc2f3 11 11 // Created On : Wed Dec 6 12:15:52 2017 12 12 // Last Modified By : Peter A. Buhr 13 // Last Modified On : Fri Jun 21 08:27:45201914 // Update Count : 17 213 // Last Modified On : Thu Oct 10 13:58:18 2019 14 // Update Count : 176 15 15 // 16 16 … … 66 66 if ( depth > 0 ) { 67 67 depth -= 1; 68 Quicksort rqs = { values, low, right, depth }; // concurrently sort upper half 69 //Quicksort lqs( values, left, high, depth ); // concurrently sort lower half 70 sort( values, left, high, depth ); // concurrently sort lower half 68 Quicksort lqs = { values, low, right, depth }; // concurrently sort lower half 69 Quicksort rqs = { values, left, high, depth }; // concurrently sort upper half 70 // Quicksort lqs = { values, low, right, depth }; // concurrently sort lower half 71 // sort( values, left, high, depth ); // concurrently sort upper half 71 72 } else { 72 73 sort( values, low, right, 0 ); // sequentially sort lower half … … 162 163 processor processors[ (1 << depth) - 1 ] __attribute__(( unused )); // create 2^depth-1 kernel threads 163 164 164 int * values = alloc( size ); // values to be sorted, too large to put on stack165 for ( counter; size ) { // generate unsorted numbers165 int * values = alloc( size ); // values to be sorted, too large to put on stack 166 for ( counter; size ) { // generate unsorted numbers 166 167 values[counter] = size - counter; // descending values 168 } // for 169 for ( int i = 0; i < 200; i +=1 ) { // random shuffle a few values 170 swap( values[rand() % size], values[rand() % size] ); 167 171 } // for 168 172 { … … 178 182 } // main 179 183 184 // for depth in 0 1 2 3 4 5 ; do echo "sort 500000000 values with ${depth} depth" ; time -f "%Uu %Ss %E %Mkb" a.out -t 500000000 ${depth} ; done 185 180 186 // Local Variables: // 181 187 // tab-width: 4 // -
tests/labelledExit.cfa
r396b830 r1fcc2f3 10 10 // Created On : Wed Aug 10 07:29:39 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Nov 6 17:57:42 201813 // Update Count : 412 // Last Modified On : Fri Oct 25 17:41:51 2019 13 // Update Count : 7 14 14 // 15 15 … … 136 136 } 137 137 138 // all nested control options, labelled exits 139 140 Comp: { 141 Try: try { 142 For: for ( ;; ) { 143 While: while ( true ) { 144 Do: do { 145 If: if ( true ) { 146 Switch2: switch ( 3 ) { 147 case 3: 148 break Try; 149 break Comp; 150 break For; continue For; 151 break While; continue While; 152 break Do; continue Do; 153 break If; 154 break Switch2; 155 } // switch 156 } // if 157 } while ( true ); 158 } // while 159 } // for 160 } finally {} // always executed 161 } // compound 162 138 163 // computed goto 139 164 // { -
tests/pybin/tools.py
r396b830 r1fcc2f3 24 24 # helper functions to run terminal commands 25 25 def sh(*cmd, timeout = False, output_file = None, input_file = None, input_text = None, error = subprocess.STDOUT, ignore_dry_run = False): 26 cmd = list(cmd) 27 28 if input_file and input_text: 29 return 401, "Cannot use both text and file inputs" 30 31 # if this is a dry_run, only print the commands that would be ran 32 if settings.dry_run and not ignore_dry_run: 33 cmd = "{} cmd: {}".format(os.getcwd(), ' '.join(cmd)) 34 if output_file and not isinstance(output_file, int): 35 cmd += " > " 36 cmd += output_file 37 38 if error and not isinstance(error, int): 39 cmd += " 2> " 40 cmd += error 41 42 if input_file and not isinstance(input_file, int) and os.path.isfile(input_file): 43 cmd += " < " 44 cmd += input_file 45 46 print(cmd) 47 return 0, None 48 49 with contextlib.ExitStack() as onexit: 50 # add input redirection if needed 51 input_file = openfd(input_file, 'r', onexit, True) 52 53 # add output redirection if needed 54 output_file = openfd(output_file, 'w', onexit, False) 55 56 # add error redirection if needed 57 error = openfd(error, 'w', onexit, False) 58 59 # run the desired command 60 try: 61 proc = subprocess.run( 26 try: 27 cmd = list(cmd) 28 29 if input_file and input_text: 30 return 401, "Cannot use both text and file inputs" 31 32 # if this is a dry_run, only print the commands that would be ran 33 if settings.dry_run and not ignore_dry_run: 34 cmd = "{} cmd: {}".format(os.getcwd(), ' '.join(cmd)) 35 if output_file and not isinstance(output_file, int): 36 cmd += " > " 37 cmd += output_file 38 39 if error and not isinstance(error, int): 40 cmd += " 2> " 41 cmd += error 42 43 if input_file and not isinstance(input_file, int) and os.path.isfile(input_file): 44 cmd += " < " 45 cmd += input_file 46 47 print(cmd) 48 return 0, None 49 50 with contextlib.ExitStack() as onexit: 51 # add input redirection if needed 52 input_file = openfd(input_file, 'r', onexit, True) 53 54 # add output redirection if needed 55 output_file = openfd(output_file, 'w', onexit, False) 56 57 # add error redirection if needed 58 error = openfd(error, 'w', onexit, False) 59 60 # run the desired command 61 # use with statement to make sure proc is cleaned 62 # don't use subprocess.run because we want to send SIGABRT on exit 63 with subprocess.Popen( 62 64 cmd, 63 65 **({'input' : bytes(input_text, encoding='utf-8')} if input_text else {'stdin' : input_file}), 64 66 stdout = output_file, 65 stderr = error, 66 timeout = settings.timeout.single if timeout else None 67 ) 68 69 return proc.returncode, proc.stdout.decode("utf-8") if proc.stdout else None 70 except subprocess.TimeoutExpired: 71 return 124, str(None) 67 stderr = error 68 ) as proc: 69 70 try: 71 out, _ = proc.communicate( 72 timeout = settings.timeout.single if timeout else None 73 ) 74 75 return proc.returncode, out.decode("utf-8") if out else None 76 except subprocess.TimeoutExpired: 77 proc.send_signal(signal.SIGABRT) 78 proc.communicate() 79 return 124, str(None) 80 81 except Exception as ex: 82 print ("Unexpected error: %s" % ex) 83 raise 72 84 73 85 def is_ascii(fname): … … 343 355 # make a directory for this test 344 356 # mkdir makes the parent directory only so add a dummy 345 mkdir(os.path.join(dst, "dir"))357 mkdir(os.path.join(dst, name )) 346 358 347 359 # moves the files -
tests/test.py
r396b830 r1fcc2f3 210 210 except KeyboardInterrupt: 211 211 return False, "" 212 except :213 print("Unexpected error in worker thread ", file=sys.stderr)212 except Exception as ex: 213 print("Unexpected error in worker thread: %s" % ex, file=sys.stderr) 214 214 sys.stderr.flush() 215 215 return False, ""
Note: See TracChangeset
for help on using the changeset viewer.