- Timestamp:
- Aug 19, 2016, 2:42:04 PM (9 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, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- e85a8631
- Parents:
- 03da511 (diff), ac71a86 (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
- 4 deleted
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tests/.expect/32/gccExtensions.txt
r03da511 r04cdd9b 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 static int *__z__Pi_2; 14 int __src__i_2; 15 int __dst__i_2; 16 asm volatile ( "mov %1, %0\n\tadd $1, %0" : : : ); 17 asm volatile ( "mov %1, %0\n\tadd $1, %0" : "=r" ( __dst__i_2 ) : : ); 18 asm volatile ( "mov %1, %0\n\tadd $1, %0" : "=r" ( __dst__i_2 ) : "r" ( __src__i_2 ) : ); 19 asm ( "mov %1, %0\n\tadd $1, %0" : "=r" ( __dst__i_2 ), "=r" ( __src__i_2 ) : [ __src__i_2 ] "r" ( __dst__i_2 ) : "r0" ); 20 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 21 double _Complex __c1__Xd_2; 12 22 double _Complex __c2__Xd_2; … … 14 24 const int __i2__Ci_2; 15 25 const int __i3__Ci_2; 26 inline int __f1__Fi___2(){ 27 } 28 inline int __f2__Fi___2(){ 29 } 30 int __s1__i_2; 31 int __s2__i_2; 32 volatile int __v1__Vi_2; 33 volatile int __v2__Vi_2; 34 int __t1___2; 35 int __t2___2; 16 36 __extension__ const int __ex__Ci_2; 17 37 struct S { … … 64 84 ((void)(__extension__ __a__i_2=(__extension__ __b__i_2+__extension__ __c__i_2))); 65 85 ((void)(__extension__ __a__i_2=__extension__ (__extension__ __b__i_2+__extension__ __c__i_2))); 66 inline int __f1__Fi___2(){67 }68 inline int __f2__Fi___2(){69 }70 int __s1__i_2;71 int __s2__i_2;72 int __t1___2;73 int __t2___2;74 volatile int __v1__Vi_2;75 volatile int __v2__Vi_2;76 86 int __a1__i_2; 77 87 const int __a2__Ci_2; … … 151 161 struct s4 __y2__3ss4_2; 152 162 ((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)];163 int __m1__A0i_2[((unsigned int )10)]; 164 int __m2__A0A0i_2[((unsigned int )10)][((unsigned int )10)]; 165 int __m3__A0A0i_2[((unsigned int )10)][((unsigned int )10)]; 156 166 int _retVal0 = { 0 }; 157 167 ((void)(_retVal0=0) /* ?{} */); -
src/tests/.expect/64/gccExtensions.txt
r03da511 r04cdd9b 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 static int *__z__Pi_2; 14 int __src__i_2; 15 int __dst__i_2; 16 asm volatile ( "mov %1, %0\n\tadd $1, %0" : : : ); 17 asm volatile ( "mov %1, %0\n\tadd $1, %0" : "=r" ( __dst__i_2 ) : : ); 18 asm volatile ( "mov %1, %0\n\tadd $1, %0" : "=r" ( __dst__i_2 ) : "r" ( __src__i_2 ) : ); 19 asm ( "mov %1, %0\n\tadd $1, %0" : "=r" ( __dst__i_2 ), "=r" ( __src__i_2 ) : [ __src__i_2 ] "r" ( __dst__i_2 ) : "r0" ); 20 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 21 double _Complex __c1__Xd_2; 12 22 double _Complex __c2__Xd_2; … … 14 24 const int __i2__Ci_2; 15 25 const int __i3__Ci_2; 26 inline int __f1__Fi___2(){ 27 } 28 inline int __f2__Fi___2(){ 29 } 30 int __s1__i_2; 31 int __s2__i_2; 32 volatile int __v1__Vi_2; 33 volatile int __v2__Vi_2; 34 int __t1___2; 35 int __t2___2; 16 36 __extension__ const int __ex__Ci_2; 17 37 struct S { … … 64 84 ((void)(__extension__ __a__i_2=(__extension__ __b__i_2+__extension__ __c__i_2))); 65 85 ((void)(__extension__ __a__i_2=__extension__ (__extension__ __b__i_2+__extension__ __c__i_2))); 66 inline int __f1__Fi___2(){67 }68 inline int __f2__Fi___2(){69 }70 int __s1__i_2;71 int __s2__i_2;72 int __t1___2;73 int __t2___2;74 volatile int __v1__Vi_2;75 volatile int __v2__Vi_2;76 86 int __a1__i_2; 77 87 const int __a2__Ci_2; -
src/tests/.expect/declarationErrors.txt
r03da511 r04cdd9b 1 1 CFA Version 1.0.0 (debug) 2 Error: invalid combination of storage classes in declaration of x9: static staticvolatile const short int2 Error: invalid combination of storage classes in declaration of x9: static volatile const short int 3 3 4 Error: invalid combination of storage classes in declaration of x18: static staticconst volatile instance of struct __anonymous04 Error: invalid combination of storage classes in declaration of x18: static const volatile instance of struct __anonymous0 5 5 with members 6 i: int7 6 with body 8 7 9 8 10 Error: invalid combination of storage classes in declaration of x19: static staticconst volatile volatile instance of struct __anonymous19 Error: invalid combination of storage classes in declaration of x19: static const volatile volatile instance of struct __anonymous1 11 10 with members 12 i: int13 11 with body 14 12 15 13 16 Error: invalid combination of storage classes in declaration of x28: static staticvolatile const instance of type Int14 Error: invalid combination of storage classes in declaration of x28: static volatile const instance of type Int 17 15 18 16 make: *** [declarationErrors] Error 1 -
src/tests/Makefile.am
r03da511 r04cdd9b 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 … … 53 53 ${CC} ${CFLAGS} -DERR2 ${<} -o ${@} 54 54 55 declarationSpecifier: declarationSpecifier.c 56 ${CC} ${CFALGS} -CFA -XCFA -p ${<} -o ${@} 57 55 58 gccExtensions : gccExtensions.c 56 59 ${CC} ${CFLAGS} -CFA -XCFA -p ${<} -o ${@} -
src/tests/Makefile.in
r03da511 r04cdd9b 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 … … 660 660 dtor-early-exit-ERR2: dtor-early-exit.c 661 661 ${CC} ${CFLAGS} -DERR2 ${<} -o ${@} 662 663 declarationSpecifier: declarationSpecifier.c 664 ${CC} ${CFALGS} -CFA -XCFA -p ${<} -o ${@} 662 665 663 666 gccExtensions : gccExtensions.c -
src/tests/declarationErrors.c
r03da511 r04cdd9b 1 static short int volatile static const x9; // duplicate static 2 struct { int i; } const static volatile static x18; // duplicate static 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 // declarationErrors.c -- 8 // 9 // Author : Peter A. Buhr 10 // Created On : Wed Aug 17 08:23:43 2016 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Aug 17 08:27:15 2016 13 // Update Count : 2 14 // 15 16 const short static int volatile x4; 17 const static volatile short int x4; 18 static short int volatile static const x9; // duplicate static 19 struct { int i; } const static volatile static x18; // duplicate static 3 20 struct { int i; } const static volatile static volatile x19; // duplicate static & volatile 4 21 typedef int Int; 5 static Int volatile static const x28; // duplicate static 22 static Int volatile static const x28; // duplicate static 23 24 const static inline const volatile int f01(); // duplicate const 25 volatile inline const volatile static int f02(); // duplicate volatile 26 const inline const volatile int static f03(); // duplicate const 27 volatile inline static const volatile int f04(); // duplicate volatile 28 const static const inline volatile int f05(); // duplicate const 29 volatile static const volatile inline int f06(); // duplicate volatile 30 const static const volatile int inline f07(); // duplicate const 31 volatile static const int inline volatile f08(); // duplicate volatile 6 32 7 33 //Dummy main … … 10 36 return 0; 11 37 } 38 39 // Local Variables: // 40 // tab-width: 4 // 41 // compile-command: "cfa declarationErrors.c" // 42 // End: // -
src/tests/declarationSpecifier.c
r03da511 r04cdd9b 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 // declarationSpecifier.c -- 8 // 9 // Author : Peter A. Buhr 10 // Created On : Wed Aug 17 08:21:04 2016 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Aug 17 08:24:33 2016 13 // Update Count : 2 14 // 15 1 16 typedef short int Int; 2 3 17 4 18 const short int volatile x1; 5 19 static const short int volatile x2; 6 20 const static short int volatile x3; 7 const short static int volatile x4;8 21 const static volatile short int x4; 9 22 const short int static volatile x5; … … 11 24 const short volatile int static x7; 12 25 short int volatile static const x8; 13 static short int volatile static const x9; // duplicate static14 26 15 27 const volatile struct { int i; } x10; … … 21 33 struct { int i; } const static volatile x16; 22 34 struct { int i; } const volatile static x17; 23 struct { int i; } const static volatile static x18; // duplicate static24 struct { int i; } const static volatile static volatile x19; // duplicate static & volatile25 35 26 36 const Int volatile x20; … … 32 42 const volatile Int static x26; 33 43 Int volatile static const x27; 34 static Int volatile static const x28; // duplicate static35 44 36 45 const volatile struct { Int i; } x29; … … 42 51 struct { Int i; } const static volatile x35; 43 52 struct { Int i; } const volatile static x36; 44 45 46 const static inline const volatile int f01(); // duplicate const47 volatile inline const volatile static int f02(); // duplicate volatile48 const inline const volatile int static f03(); // duplicate const49 volatile inline static const volatile int f04(); // duplicate volatile50 const static const inline volatile int f05(); // duplicate const51 volatile static const volatile inline int f06(); // duplicate volatile52 const static const volatile int inline f07(); // duplicate const53 volatile static const int inline volatile f08(); // duplicate volatile54 53 55 54 static inline const volatile int f11(); … … 94 93 return 0; 95 94 } 95 96 // Local Variables: // 97 // tab-width: 4 // 98 // compile-command: "cfa declarationSpecifier.c" // 99 // End: // -
src/tests/dtor-early-exit.c
r03da511 r04cdd9b 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 // dtor-early-exit.c -- 8 // 9 // Author : Rob Schluntz 10 // Created On : Wed Aug 17 08:26:25 2016 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Aug 17 08:29:37 2016 13 // Update Count : 2 14 // 15 1 16 #include <fstream> 2 17 #include <stdlib> … … 215 230 h(); 216 231 } 232 233 // Local Variables: // 234 // tab-width: 4 // 235 // compile-command: "cfa dtor-early-exit" // 236 // End: // -
src/tests/exception.c
r03da511 r04cdd9b 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/functions.c
r03da511 r04cdd9b 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 // functions.c -- 8 // 9 // Author : Peter A. Buhr 10 // Created On : Wed Aug 17 08:39:58 2016 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Aug 17 08:40:52 2016 13 // Update Count : 1 14 // 15 1 16 // ANSI function definitions 2 17 … … 165 180 // Local Variables: // 166 181 // tab-width: 4 // 182 // compile-command: "cfa functions.c" // 167 183 // End: // -
src/tests/gccExtensions.c
r03da511 r04cdd9b 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 // 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 : Wed Aug 17 09:26:50 2016 13 // Update Count : 10 14 // 15 16 extern int x asm( "xx" ); 17 1 18 int main(int argc, char const *argv[]) { 19 // asm extensions 20 2 21 asm( "nop" ); 3 22 __asm( "nop" ); 4 23 __asm__( "nop" ); 24 25 static int y asm( "yy" ); 26 #ifdef __CFA__ 27 static * int z asm( "zz" ); // CFA declaration 28 #endif // __CFA__ 29 30 int src; 31 int dst; 32 33 asm volatile ( "mov %1, %0\n\t" 34 "add $1, %0" : : : ); 35 36 asm volatile ( "mov %1, %0\n\t" 37 "add $1, %0" 38 : "=" "r" (dst)); 39 40 asm volatile ( "mov %1, %0\n\t" 41 "add $1, %0" 42 : "=r" (dst) 43 : "r" (src)); 44 45 asm ( "mov %1, %0\n\t" 46 "add $1, %0" 47 : "=r" (dst), "=r" (src) 48 : [src] "r" (dst) 49 : "r0"); 50 51 L1: L2: 52 asm goto ( "frob %%r5, %1; jc %l[L1]; mov (%2), %%r5" 53 : /* No outputs. */ 54 : "r"(src), "r"(&dst) 55 : "r5", "memory" 56 : L1, L2 ); 57 58 // alternative type/qualifer names 5 59 6 60 __complex__ c1; … … 10 64 __const int i2; 11 65 __const__ int i3; 66 67 __inline int f1() {} 68 __inline__ int f2() {} 69 70 __signed s1; 71 __signed s2; 72 73 __volatile int v1; 74 __volatile__ int v2; 75 76 // symbol table attributes 77 78 __typeof(s1) t1; 79 __typeof__(s1) t2; 80 81 // strange extension qualifier 12 82 13 83 __extension__ const int ex; … … 21 91 __extension__ a = __extension__ ( __extension__ b + __extension__ c ); 22 92 23 __inline int f1() {} 24 __inline__ int f2() {} 25 26 __signed s1; 27 __signed s2; 28 29 __typeof(s1) t1; 30 __typeof__(s1) t2; 31 32 __volatile int v1; 33 __volatile__ int v2; 93 // attributes 34 94 35 95 __attribute__(()) int a1; … … 57 117 return 0; 58 118 } 119 120 // Local Variables: // 121 // tab-width: 4 // 122 // compile-command: "cfa gccExtensions.c" // 123 // End: // -
src/tests/identFuncDeclarator.c
r03da511 r04cdd9b 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 // identFuncDeclarator.c -- 8 // 9 // Author : Peter A. Buhr 10 // Created On : Wed Aug 17 08:36:34 2016 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Aug 17 08:37:06 2016 13 // Update Count : 1 14 // 15 1 16 int main() { 2 17 int f1; … … 97 112 int (* const(* const f81)(int))(); 98 113 } 114 115 // Local Variables: // 116 // tab-width: 4 // 117 // compile-command: "cfa identFuncDeclarator.c" // 118 // End: // -
src/tests/identParamDeclarator.c
r03da511 r04cdd9b 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 // identParamDeclarator.c -- 8 // 9 // Author : Peter A. Buhr 10 // Created On : Wed Aug 17 08:37:56 2016 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Aug 17 08:38:42 2016 13 // Update Count : 1 14 // 15 1 16 int fred( 2 17 int f1, … … 147 162 return 0; 148 163 } 164 165 // Local Variables: // 166 // tab-width: 4 // 167 // compile-command: "cfa identParamDeclarator.c" // 168 // End: // -
src/tests/labelledExit.c
r03da511 r04cdd9b 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/test.py
r03da511 r04cdd9b 99 99 return False 100 100 101 # find the test data for a given test name102 def filterTests(testname) :103 found = [test for test in allTests if test.name == testname]104 return (found[0] if len(found) == 1 else Test(testname, testname) )105 106 101 ################################################################################ 107 102 # running test functions … … 141 136 if not dry_run and fileContainsOnly(out_file, "make: *** No rule to make target `%s'. Stop." % test.name) : 142 137 retcode = 1; 143 error = "\t\tNo make target for test %s!" % test 138 error = "\t\tNo make target for test %s!" % test.name 144 139 sh("rm %s" % out_file, False) 145 140 … … 252 247 # already existing tests and create new info for the new tests 253 248 if options.regenerate_expected : 254 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) ) 255 255 256 256 else : -
src/tests/variableDeclarator.c
r03da511 r04cdd9b 1 //Variable declarations test 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 // variableDeclarator.c -- 8 // 9 // Author : Peter A. Buhr 10 // Created On : Wed Aug 17 08:41:42 2016 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Aug 17 08:42:21 2016 13 // Update Count : 1 14 // 15 16 // Variable declarations test 2 17 int f1; 3 18 int (f2); … … 164 179 return 0; 165 180 } 181 182 // Local Variables: // 183 // tab-width: 4 // 184 // compile-command: "cfa variableDeclarator.c" // 185 // End: //
Note:
See TracChangeset
for help on using the changeset viewer.