- Timestamp:
- Aug 16, 2016, 3:20:06 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 1f6d4624
- Parents:
- 950f7a7 (diff), 7880579 (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:
- src/tests
- Files:
-
- 2 added
- 3 deleted
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tests/.expect/32/extension.txt
r950f7a7 r7527e63 100 100 ((void)((__extension__ __a__i_2 , __extension__ __b__i_2) , __extension__ __c__i_2)); 101 101 } 102 __attribute__ ((constructor(),)) static void _init_extension(void){103 int _global_init0;104 ((void)((*((int *)(&__a__i_1)))=_global_init0) /* ?{} */);105 int _global_init1;106 ((void)((*((int *)(&__b__i_1)))=_global_init1) /* ?{} */);107 int _global_init2;108 ((void)((*((int *)(&__c__i_1)))=_global_init2) /* ?{} */);109 }110 __attribute__ ((destructor(),)) static void _destroy_extension(void){111 ((void)((*((int *)(&__c__i_1)))) /* ^?{} */);112 ((void)((*((int *)(&__b__i_1)))) /* ^?{} */);113 ((void)((*((int *)(&__a__i_1)))) /* ^?{} */);114 } -
src/tests/.expect/32/gccExtensions.txt
r950f7a7 r7527e63 5 5 extern void exit(int __status); 6 6 extern int printf(const char *__restrict __format, ...); 7 extern int __x__i_1; 7 8 int main(int __argc__i_1, const char **__argv__PPCc_1){ 8 9 asm ( "nop" : : : ); 9 10 asm ( "nop" : : : ); 10 11 asm ( "nop" : : : ); 12 static int __y__i_2; 13 int __src__i_2; 14 int __dst__i_2; 15 asm volatile ( "mov %1, %0\n\tadd $1, %0" : : : ); 16 asm volatile ( "mov %1, %0\n\tadd $1, %0" : "=r" ( __dst__i_2 ) : : ); 17 asm volatile ( "mov %1, %0\n\tadd $1, %0" : "=r" ( __dst__i_2 ) : "r" ( __src__i_2 ) : ); 18 asm ( "mov %1, %0\n\tadd $1, %0" : "=r" ( __dst__i_2 ), "=r" ( __src__i_2 ) : [ __src__i_2 ] "r" ( __dst__i_2 ) : "r0" ); 11 19 double _Complex __c1__Xd_2; 12 20 double _Complex __c2__Xd_2; … … 151 159 struct s4 __y2__3ss4_2; 152 160 ((void)___constructor__F_P3ss4_autogen___2(((struct s4 *)(&__y2__3ss4_2)))); 153 int __m1__A0i_2[(( longunsigned int )10)];154 int __m2__A0A0i_2[(( long unsigned int )10)][((longunsigned int )10)];155 int __m3__A0A0i_2[(( long unsigned int )10)][((longunsigned int )10)];161 int __m1__A0i_2[((unsigned int )10)]; 162 int __m2__A0A0i_2[((unsigned int )10)][((unsigned int )10)]; 163 int __m3__A0A0i_2[((unsigned int )10)][((unsigned int )10)]; 156 164 int _retVal0 = { 0 }; 157 165 ((void)(_retVal0=0) /* ?{} */); -
src/tests/.expect/64/extension.txt
r950f7a7 r7527e63 100 100 ((void)((__extension__ __a__i_2 , __extension__ __b__i_2) , __extension__ __c__i_2)); 101 101 } 102 __attribute__ ((constructor(),)) static void _init_extension(void){103 int _global_init0;104 ((void)((*((int *)(&__a__i_1)))=_global_init0) /* ?{} */);105 int _global_init1;106 ((void)((*((int *)(&__b__i_1)))=_global_init1) /* ?{} */);107 int _global_init2;108 ((void)((*((int *)(&__c__i_1)))=_global_init2) /* ?{} */);109 }110 __attribute__ ((destructor(),)) static void _destroy_extension(void){111 ((void)((*((int *)(&__c__i_1)))) /* ^?{} */);112 ((void)((*((int *)(&__b__i_1)))) /* ^?{} */);113 ((void)((*((int *)(&__a__i_1)))) /* ^?{} */);114 } -
src/tests/.expect/64/gccExtensions.txt
r950f7a7 r7527e63 5 5 extern void exit(int __status); 6 6 extern int printf(const char *__restrict __format, ...); 7 extern int __x__i_1; 7 8 int main(int __argc__i_1, const char **__argv__PPCc_1){ 8 9 asm ( "nop" : : : ); 9 10 asm ( "nop" : : : ); 10 11 asm ( "nop" : : : ); 12 static int __y__i_2; 13 int __src__i_2; 14 int __dst__i_2; 15 asm volatile ( "mov %1, %0\n\tadd $1, %0" : : : ); 16 asm volatile ( "mov %1, %0\n\tadd $1, %0" : "=r" ( __dst__i_2 ) : : ); 17 asm volatile ( "mov %1, %0\n\tadd $1, %0" : "=r" ( __dst__i_2 ) : "r" ( __src__i_2 ) : ); 18 asm ( "mov %1, %0\n\tadd $1, %0" : "=r" ( __dst__i_2 ), "=r" ( __src__i_2 ) : [ __src__i_2 ] "r" ( __dst__i_2 ) : "r0" ); 19 L2: L1: asm goto ( "frob %%r5, %1; jc %l[L1]; mov (%2), %%r5" : : "r" ( __src__i_2 ), "r" ( (&__dst__i_2) ) : "r5", "memory" : L1, L2 ); 11 20 double _Complex __c1__Xd_2; 12 21 double _Complex __c2__Xd_2; -
src/tests/Makefile.am
r950f7a7 r7527e63 11 11 ## Created On : Sun May 31 09:08:15 2015 12 12 ## Last Modified By : Peter A. Buhr 13 ## Last Modified On : Sat Jul 9 11:23:24 201614 ## Update Count : 3 513 ## Last Modified On : Mon Aug 15 12:24:54 2016 14 ## Update Count : 39 15 15 ############################################################################### 16 16 … … 27 27 28 28 all-local : 29 +python test.py vector_test avl_test operators numericConstants expression enum asmNamearray typeof cast dtor-early-exit init_once29 @+python test.py vector_test avl_test operators numericConstants expression enum array typeof cast dtor-early-exit init_once 30 30 31 31 all-tests : 32 +python test.py --all32 @+python test.py --all # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program 33 33 34 34 clean-local : 35 -rm -f ${EXTRA_PROGRAMS}35 rm -f ${EXTRA_PROGRAMS} 36 36 37 37 list : 38 +python test.py --list38 @+python test.py --list 39 39 40 40 constant0-1DP : constant0-1.c -
src/tests/Makefile.in
r950f7a7 r7527e63 635 635 636 636 all-local : 637 +python test.py vector_test avl_test operators numericConstants expression enum asmNamearray typeof cast dtor-early-exit init_once637 @+python test.py vector_test avl_test operators numericConstants expression enum array typeof cast dtor-early-exit init_once 638 638 639 639 all-tests : 640 +python test.py --all640 @+python test.py --all # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program 641 641 642 642 clean-local : 643 -rm -f ${EXTRA_PROGRAMS}643 rm -f ${EXTRA_PROGRAMS} 644 644 645 645 list : 646 +python test.py --list646 @+python test.py --list 647 647 648 648 constant0-1DP : constant0-1.c -
src/tests/exception.c
r950f7a7 r7527e63 11 11 x/4; 12 12 } catch( int ) { 13 } catch( int x ) {13 } catch( float x ) { 14 14 } catch( struct { int i; } ) { 15 15 } catch( struct { int i; } x ) { … … 21 21 } catch( * struct { int i; } x ) { 22 22 } catch( ... ) { 23 //} finally {23 } finally { 24 24 } // try 25 25 } -
src/tests/gccExtensions.c
r950f7a7 r7527e63 1 // 2 // Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo 3 // 4 // The contents of this file are covered under the licence agreement in the 5 // file "LICENCE" distributed with Cforall. 6 // 7 // gccExtensions.c -- 8 // 9 // Author : Peter A. Buhr 10 // Created On : Sun Aug 14 17:28:17 2016 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Aug 15 12:44:35 2016 13 // Update Count : 5 14 // 15 16 extern int x asm( "xx" ); 17 1 18 int main(int argc, char const *argv[]) { 2 19 asm( "nop" ); 3 20 __asm( "nop" ); 4 21 __asm__( "nop" ); 22 23 static int y asm( "yy" ); 24 // static * int z asm( "zz" ); // CFA declaration 25 26 int src; 27 int dst; 28 29 asm volatile ( "mov %1, %0\n\t" 30 "add $1, %0" : : : ); 31 32 asm volatile ( "mov %1, %0\n\t" 33 "add $1, %0" 34 : "=" "r" (dst)); 35 36 asm volatile ( "mov %1, %0\n\t" 37 "add $1, %0" 38 : "=r" (dst) 39 : "r" (src)); 40 41 asm ( "mov %1, %0\n\t" 42 "add $1, %0" 43 : "=r" (dst), "=r" (src) 44 : [src] "r" (dst) 45 : "r0"); 46 47 L1: L2: 48 asm goto ( "frob %%r5, %1; jc %l[L1]; mov (%2), %%r5" 49 : /* No outputs. */ 50 : "r"(src), "r"(&dst) 51 : "r5", "memory" 52 : L1, L2 ); 5 53 6 54 __complex__ c1; … … 57 105 return 0; 58 106 } 107 108 // Local Variables: // 109 // tab-width: 4 // 110 // compile-command: "cfa gccExtensions.c" // 111 // End: // -
src/tests/init_once.c
r950f7a7 r7527e63 92 92 init_once y = x; 93 93 94 void static_variable() { 95 static init_once x; 96 } 97 94 98 int main() { 95 99 // local variables … … 179 183 } 180 184 } 185 186 // function-scoped static variable 187 for (int i = 0; i < 10; i++) { 188 static_variable(); 189 } 181 190 } 182 191 -
src/tests/labelledExit.c
r950f7a7 r7527e63 1 // 2 // Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo 3 // 4 // The contents of this file are covered under the licence agreement in the 5 // file "LICENCE" distributed with Cforall. 6 // 7 // labelledExit.c -- 8 // 9 // Author : Peter A. Buhr 10 // Created On : Wed Aug 10 07:29:39 2016 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Aug 10 07:30:15 2016 13 // Update Count : 1 14 // 15 1 16 int foo() { 2 17 int i; … … 136 151 else 137 152 i += 1; 138 139 153 } 140 154 141 int main( int argc, char const *argv[]) {155 int main( int argc, char const *argv[] ) { 142 156 /* code */ 143 return 0;144 157 } 145 158 146 159 // Local Variables: // 147 160 // tab-width: 4 // 148 // compile-command: "cfa LabelledExit.c" //161 // compile-command: "cfa labelledExit.c" // 149 162 // End: // -
src/tests/switch.c
r950f7a7 r7527e63 10 10 // Created On : Tue Jul 12 06:50:22 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T ue Jul 12 18:02:23201613 // Update Count : 2212 // Last Modified On : Thu Aug 4 11:44:29 2016 13 // Update Count : 31 14 14 // 15 15 … … 33 33 } // switch 34 34 35 // switch (3 ) { 36 // int j; 37 // case 3: 38 // break; 39 // case 4: 40 // j = 0; 41 // } 35 switch ( 3 ) { 36 int j; 37 case 3: 38 break; 39 case 4: 40 j = 0; 41 } 42 43 switch ( i ) { 44 case 1, 2, 3: 45 switch ( i ) { 46 case 2, 3, 4: 47 7; 48 } 49 } 42 50 43 51 switch ( i ) { … … 49 57 default: 50 58 i = 3; 51 case 3:59 case 19: 52 60 case 'A' ... 'Z': 53 case 5... 6:54 case 2 , 4:61 case 1 ... 6: 62 case 20, 30: 55 63 j = 3; 56 64 f( 3 ); … … 78 86 struct S { int i; }; 79 87 S s; 80 case 3:88 case 19: 81 89 case 'A' ... 'Z': 82 case 5... 6:83 case 2 , 4, 7:90 case 0 ... 6: 91 case 20, 30, 40: 84 92 i = 3; 85 93 f( 3 ); -
src/tests/test.py
r950f7a7 r7527e63 23 23 # parses the Makefile to find the machine type (32-bit / 64-bit) 24 24 def getMachineType(): 25 with open('Makefile') as file: 26 makefile = file.read() 27 m = re.search("CFA_FLAGS\s*=\s*-m(.*)", makefile) 28 return m.group(1) if m else '64' 25 sh('echo "int main() { return 0; }" > .dummy.c') 26 sh("make .dummy", print2stdout=False) 27 _, out = sh("file .dummy", print2stdout=False) 28 sh("rm -f .dummy.c > /dev/null 2>&1") 29 sh("rm -f .dummy > /dev/null 2>&1") 30 return re.search("ELF\s([0-9]+)-bit", out).group(1) 29 31 30 32 # reads the directory ./.expect and indentifies the tests … … 97 99 return False 98 100 99 # find the test data for a given test name100 def filterTests(testname) :101 found = [test for test in allTests if test.name == testname]102 return (found[0] if len(found) == 1 else Test(testname, testname) )103 104 101 ################################################################################ 105 102 # running test functions … … 139 136 if not dry_run and fileContainsOnly(out_file, "make: *** No rule to make target `%s'. Stop." % test.name) : 140 137 retcode = 1; 141 error = "\t\tNo make target for test %s!" % test 138 error = "\t\tNo make target for test %s!" % test.name 142 139 sh("rm %s" % out_file, False) 143 140 … … 250 247 # already existing tests and create new info for the new tests 251 248 if options.regenerate_expected : 252 tests = map(filterTests, options.tests) 249 for testname in options.tests : 250 if testname.endswith(".c") or testname.endswith(".cc") or testname.endswith(".cpp") : 251 print('ERROR: "%s", tests are not allowed to end with a C/C++/CFA extension, ignoring it' % testname, file=sys.stderr) 252 else : 253 found = [test for test in allTests if test.name == testname] 254 tests.append( found[0] if len(found) == 1 else Test(testname, testname) ) 253 255 254 256 else :
Note: See TracChangeset
for help on using the changeset viewer.