- Timestamp:
- Jun 23, 2016, 12:23:00 PM (10 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, 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:
- 4d3ca1d8
- Parents:
- c2931ea (diff), d56c05d0 (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:
-
- 28 added
- 2 deleted
- 28 edited
- 1 moved
-
.expect/Array.txt (added)
-
.expect/AsmName.txt (added)
-
.expect/Cast.txt (added)
-
.expect/CastError.txt (added)
-
.expect/Constant0-1.txt (added)
-
.expect/Constant0-1DP.txt (added)
-
.expect/Constant0-1ND.txt (added)
-
.expect/Constant0-1NDDP.txt (added)
-
.expect/DeclarationErrors.txt (added)
-
.expect/DeclarationSpecifier.txt (added)
-
.expect/Enum.txt (added)
-
.expect/Expression.txt (added)
-
.expect/GccExtensions.txt (added)
-
.expect/IdentFuncDeclarator.txt (added)
-
.expect/IdentFuncParamDeclarator.txt (added)
-
.expect/LabelledExit.txt (added)
-
.expect/NumericConstants.txt (added)
-
.expect/Operators.txt (added)
-
.expect/ScopeErrors.txt (added)
-
.expect/ShortCircuit.txt (added)
-
.expect/Switch.txt (added)
-
.expect/Typeof.txt (added)
-
.expect/VariableDeclarator.txt (added)
-
.expect/abs.txt (modified) (1 diff)
-
.expect/ato.txt (added)
-
.expect/io.txt (added)
-
.expect/limits.txt (added)
-
.expect/math.txt (added)
-
.expect/minmax.txt (modified) (1 diff)
-
.expect/swap.txt (added)
-
Cast.c (modified) (1 diff)
-
CommentMisc.c (modified) (1 diff)
-
Constant0-1.c (modified) (4 diffs)
-
Context.c (modified) (1 diff)
-
Enum.c (modified) (3 diffs)
-
Exception.c (modified) (1 diff)
-
Expression.c (modified) (3 diffs)
-
Forall.c (modified) (3 diffs)
-
GccExtensions.c (modified) (1 diff)
-
IdentFuncDeclarator.c (modified) (2 diffs)
-
IdentFuncParamDeclarator.c (modified) (2 diffs)
-
LabelledExit.c (modified) (2 diffs)
-
Makefile.am (modified) (2 diffs)
-
Makefile.in (modified) (10 diffs)
-
NumericConstants.c (modified) (1 diff)
-
OccursError.c (modified) (1 diff)
-
Operators.c (modified) (3 diffs)
-
Scope.c (modified) (2 diffs)
-
ShortCircuit.c (modified) (2 diffs)
-
Statement.c (deleted)
-
StructMember.c (modified) (1 diff)
-
Subrange.c (modified) (1 diff)
-
Switch.c (modified) (1 diff)
-
Tuples.c (moved) (moved from src/tests/Function.c )
-
Typedef.c (modified) (2 diffs)
-
Typeof.c (modified) (1 diff)
-
limits.c (modified) (3 diffs)
-
runTests.sh (deleted)
-
test.py (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/tests/.expect/abs.txt
rc2931ea rf1ee72e 1 /usr/local/bin/cfa -g -Wall -Wno-unused-function abs.c -o abs2 CFA Version 1.0.0 (debug)3 1 char ¿ abs A 4 2 signed int -65 abs 65 -
src/tests/.expect/minmax.txt
rc2931ea rf1ee72e 1 char z a min a 2 signed int 4 3 min 3 3 unsigned int 4 3 min 3 4 signed long int 4 3 min 3 5 unsigned long int 4 3 min 3 6 signed long long int 4 3 min 3 7 unsigned long long int 4 3 min 3 8 float 4 3.1 min 3.1 9 double 4 3.1 min 3.1 10 long double 4 3.1 min 3.1 11 12 char z a max z 13 signed int 4 3 max 4 14 unsigned int 4 3 max 4 15 signed long int 4 3 max 4 16 unsigned long int 4 3 max 4 17 signed long long int 4 3 max 4 18 unsigned long long int 4 3 max 4 19 float 4 3.1 max 4 20 double 4 3.1 max 4 21 long double 4 3.1 max 4 -
src/tests/Cast.c
rc2931ea rf1ee72e 9 9 (int)f; 10 10 (void(*)())f; 11 ([long, long double, *[]()])([f, f, f]);11 // ([long, long double, *[]()])([f, f, f]); 12 12 } 13 13 -
src/tests/CommentMisc.c
rc2931ea rf1ee72e 1 /* single line */2 // single line3 4 // single line containing */5 // single line containing /*6 // single line containing /* */7 8 /* 1st */ int i;9 int i; /* 2nd */10 /* 1st */ int i; /* 2nd */11 /* 1st */ /* 2nd */12 13 /* 1st14 2nd */ int i;15 16 /*17 */18 19 /*20 21 */22 23 /*24 1st25 */26 27 /*28 1st29 2nd30 */31 32 // ignore preprocessor directives33 34 #line 235 #36 #include <fred>37 #define mary abc38 39 1 // alternative ANSI99 brackets 40 2 -
src/tests/Constant0-1.c
rc2931ea rf1ee72e 1 //Constant test declaration 2 // Cforall extension 1 // Constant test declaration 3 2 4 3 // value … … 6 5 int 0; 7 6 const int 0; 8 static const int 0;9 7 int 1; 10 8 const int 1; 11 static const int 1; 12 int 0, 1; 13 const int 0, 1; 9 struct { int i; } 0; 10 const struct { int i; } 1; 11 12 #ifdef DUPS 13 14 int 0; 15 const int 0; 16 int 1; 17 const int 1; 14 18 int (0), (1); 15 19 int ((0)), ((1)); 16 static const int 0, 1; 20 const int 0, 1; 21 const int (0), (1); 17 22 struct { int i; } 0; 18 23 const struct { int i; } 1; 19 static const struct { int i; } 1; 24 25 #endif // DUPS 26 27 #ifndef NEWDECL 20 28 21 29 // pointer 30 31 int *0, *1; 32 int * const (0), * const 1; 33 struct { int i; } *0; 34 const struct { int i; } *0; 35 int (*(* const x)), **0; 36 37 #ifdef DUPS 22 38 23 39 int *0, *1; … … 28 44 int (* const 0), (* const 1); 29 45 int ((* const 0)), ((* const 1)); 46 int (*(* const x)), *(*0); 47 int (*(* const x)), (*(*0)); 30 48 struct { int i; } *0; 49 const struct { int i; } *0; 50 int (*(* const x)), **0; 51 52 #endif // DUPS 53 54 #else 31 55 32 56 // Cforall style … … 34 58 * int x, 0; 35 59 const * int x, 0; 36 static const * int x, 0;37 60 * struct { int i; } 0; 38 61 const * struct { int i; } 0; 39 static const * struct { int i; } 0;40 static * int x, 0;41 static const * int x, 0;42 62 const * * int x, 0; 43 63 64 #ifdef DUPS 65 66 * int x, 0; 67 const * int x, 0; 68 69 #endif // DUPS 70 71 #endif // NEWDECL 72 44 73 int main() { 74 #ifndef NEWDECL 45 75 int 1, * 0; 76 #else 46 77 * int x, 0; 78 #endif // NEWDECL 47 79 } -
src/tests/Context.c
rc2931ea rf1ee72e 1 //cforall context declaration 2 context has_q( otype T ) { 1 // trait declaration 2 3 trait has_q( otype T ) { 3 4 T q( T ); 4 5 }; 5 6 6 7 forall( otype z | has_q( z ) ) void f() { 7 context has_r( otype T, otype U ) {8 trait has_r( otype T, otype U ) { 8 9 T r( T, T (T,U) ); 9 10 }; -
src/tests/Enum.c
rc2931ea rf1ee72e 1 1 //Testing enum declaration 2 enum Colo rs {2 enum Colours { 3 3 Red, 4 4 Yellow, … … 10 10 }; 11 11 12 enum Colours c1; 13 Colours c2; 14 12 15 void f( void ) { 13 16 enum Fruits { … … 17 20 Mango 18 21 } fruit = Mango; 22 enum Fruits f1; 23 Fruits f2; 19 24 } 20 25 21 26 //Dummy main 22 int main(int argc, char const *argv[]) 23 { 24 return 0; 27 int main(int argc, char const *argv[]) { 25 28 } -
src/tests/Exception.c
rc2931ea rf1ee72e 10 10 try { 11 11 x/4; 12 } catch( int ) {12 } catch( int ) { 13 13 } catch( int x ) { 14 14 } catch( struct { int i; } ) { -
src/tests/Expression.c
rc2931ea rf1ee72e 1 int fred() {2 struct s { int i; } *p;3 int i ;1 int main() { 2 struct s { int i; } x, *p = &x; 3 int i = 3; 4 4 5 // order of evaluation (GCC is different)6 /*7 i = sizeof( (int) {3} );8 i = sizeof (int) {3};9 */10 5 // operators 11 6 … … 42 37 i||i; 43 38 p->i; 44 i+=i;45 i-=i;46 39 i*=i; 47 40 i/=i; 48 41 i%=i; 42 i+=i; 43 i-=i; 49 44 i&=i; 50 45 i|=i; … … 54 49 55 50 i?i:i; 56 57 // cast 58 /* 59 double d; 60 int *ip; 61 (int *) i; 62 (* int) i; 63 ([char, int *])[d, d]; 64 [i,ip,ip] = ([int, * int, int *])[1,(void *)2,(void *)3]; 65 [i,ip,ip] = ([int, * int, int *])([1,(void *)2,(void *)3]); 66 */ 67 } 68 69 //Dummy main 70 int main(int argc, char const *argv[]) 71 { 72 return 0; 73 } 51 } // main -
src/tests/Forall.c
rc2931ea rf1ee72e 10 10 void f( int ); 11 11 void h( void (*p)(void) ); 12 12 13 13 int x; 14 14 void (*y)(void); 15 15 char z; 16 16 float w; 17 17 18 18 f( x ); 19 19 f( y ); … … 26 26 forall( otype T ) void f( T, T ); 27 27 forall( otype T, otype U ) void f( T, U ); 28 28 29 29 int x; 30 30 float y; 31 31 int *z; 32 32 float *w; 33 33 34 34 f( x, y ); 35 35 f( z, w ); … … 46 46 } 47 47 48 context sumable( otype T ) {48 trait sumable( otype T ) { 49 49 const T 0; 50 50 T ?+?(T, T); -
src/tests/GccExtensions.c
rc2931ea rf1ee72e 1 int main(int argc, char const *argv[]) 2 asm( "nop" );3 __asm( "nop" );4 __asm__( "nop" );1 int main(int argc, char const *argv[]) { 2 asm( "nop" ); 3 __asm( "nop" ); 4 __asm__( "nop" ); 5 5 6 __complex__ c1;7 _Complex c2;6 __complex__ c1; 7 _Complex c2; 8 8 9 const int i1;10 __const int i2;11 __const__ int i3;9 const int i1; 10 __const int i2; 11 __const__ int i3; 12 12 13 __extension__ const int ex; 13 __extension__ const int ex; 14 struct S { 15 __extension__ int a, b, c; 16 }; 17 int i = __extension__ 3; 18 __extension__ int a, b, c; 19 __extension__ a, __extension__ b, __extension__ c; 20 __extension__ a = __extension__ b + __extension__ c; 21 __extension__ a = __extension__ ( __extension__ b + __extension__ c ); 14 22 15 __inline int f1(); 16 __inline__ int f2(); 23 __inline int f1() {} 24 __inline__ int f2() {} 17 25 18 __signed s1;19 __signed s2;26 __signed s1; 27 __signed s2; 20 28 21 __otypeof(s1) t1;22 __otypeof__(s1) t2;29 __typeof(s1) t1; 30 __typeof__(s1) t2; 23 31 24 __volatile int v1;25 __volatile__ int v2;32 __volatile int v1; 33 __volatile__ int v2; 26 34 27 __attribute__(()) int a1;28 const __attribute(()) int a2;29 const static __attribute(()) int a3;30 const static int __attribute(()) a4;31 const static int a5 __attribute(());32 const static int a6, __attribute(()) a7;35 __attribute__(()) int a1; 36 const __attribute(()) int a2; 37 const static __attribute(()) int a3; 38 const static int __attribute(()) a4; 39 const static int a5 __attribute(()); 40 const static int a6, __attribute(()) a7; 33 41 34 int * __attribute(()) p1;35 int (* __attribute(()) p2);36 // int (__attribute(()) (p3));37 // int ( __attribute(()) (* __attribute(()) p4));42 int * __attribute(()) p1; 43 int (* __attribute(()) p2); 44 // int (__attribute(()) (p3)); 45 // int ( __attribute(()) (* __attribute(()) p4)); 38 46 39 struct __attribute(()) s1;40 struct __attribute(()) s2 { int i; };41 struct __attribute(()) s3 { int i; } x1, __attribute(()) y1;42 struct __attribute(()) s4 { int i; } x2, y2 __attribute(());47 struct __attribute(()) s1; 48 struct __attribute(()) s2 { int i; }; 49 struct __attribute(()) s3 { int i; } x1, __attribute(()) y1; 50 struct __attribute(()) s4 { int i; } x2, y2 __attribute(()); 43 51 44 int m1 [10] __attribute(());45 int m2 [10][10] __attribute(());46 int __attribute(()) m3 [10][10];47 // int ( __attribute(()) m4 [10] )[10];52 int m1 [10] __attribute(()); 53 int m2 [10][10] __attribute(()); 54 int __attribute(()) m3 [10][10]; 55 // int ( __attribute(()) m4 [10] )[10]; 48 56 49 57 return 0; -
src/tests/IdentFuncDeclarator.c
rc2931ea rf1ee72e 1 1 int main() { 2 //int f0[]();3 //int (f0[])();4 //int f0()[];5 //int f0()();6 //int (*f0)()();7 //int ((*f0())())[];8 9 2 int f1; 10 3 int (f2); … … 25 18 int (* const * const f14); 26 19 27 int f15[ ];20 int f15[2]; 28 21 int f16[10]; 29 int (f17[ ]);22 int (f17[2]); 30 23 int (f18[10]); 31 24 32 int *f19[ ];25 int *f19[2]; 33 26 int *f20[10]; 34 int **f21[ ];27 int **f21[2]; 35 28 int **f22[10]; 36 int * const *f23[ ];29 int * const *f23[2]; 37 30 int * const *f24[10]; 38 int * const * const f25[ ];31 int * const * const f25[2]; 39 32 int * const * const f26[10]; 40 33 41 int *(f27[ ]);34 int *(f27[2]); 42 35 int *(f28[10]); 43 int **(f29[ ]);36 int **(f29[2]); 44 37 int **(f30[10]); 45 int * const *(f31[ ]);38 int * const *(f31[2]); 46 39 int * const *(f32[10]); 47 int * const * const (f33[ ]);40 int * const * const (f33[2]); 48 41 int * const * const (f34[10]); 49 42 50 int (*f35[ ]);43 int (*f35[2]); 51 44 int (*f36[10]); 52 int (**f37[ ]);45 int (**f37[2]); 53 46 int (**f38[10]); 54 int (* const *f39[ ]);47 int (* const *f39[2]); 55 48 int (* const *f40[10]); 56 int (* const * const f41[ ]);49 int (* const * const f41[2]); 57 50 int (* const * const f42[10]); 58 51 59 int f43[ ][3];52 int f43[2][3]; 60 53 int f44[3][3]; 61 int (f45[ ])[3];54 int (f45[2])[3]; 62 55 int (f46[3])[3]; 63 int ((f47[ ]))[3];56 int ((f47[2]))[3]; 64 57 int ((f48[3]))[3]; 65 58 66 int *f49[ ][3];59 int *f49[2][3]; 67 60 int *f50[3][3]; 68 int **f51[ ][3];61 int **f51[2][3]; 69 62 int **f52[3][3]; 70 int * const *f53[ ][3];63 int * const *f53[2][3]; 71 64 int * const *f54[3][3]; 72 int * const * const f55[ ][3];65 int * const * const f55[2][3]; 73 66 int * const * const f56[3][3]; 74 67 75 int (*f57[ ][3]);68 int (*f57[2][3]); 76 69 int (*f58[3][3]); 77 int (**f59[ ][3]);70 int (**f59[2][3]); 78 71 int (**f60[3][3]); 79 int (* const *f61[ ][3]);72 int (* const *f61[2][3]); 80 73 int (* const *f62[3][3]); 81 int (* const * const f63[ ][3]);74 int (* const * const f63[2][3]); 82 75 int (* const * const f64[3][3]); 83 76 -
src/tests/IdentFuncParamDeclarator.c
rc2931ea rf1ee72e 1 1 int fred( 2 //int f0[](),3 //int (f0[])(),4 //int f0()[],5 //int f0()(),6 //int (*f0)()(),7 //int ((*f0())())[],8 9 2 int f1, 10 3 int (f2), … … 147 140 int * const *(f116[static const 3][3]), 148 141 int * const * const (f117[static const 3][3]) 149 ) { 150 } 142 ); 151 143 152 144 //Dummy main -
src/tests/LabelledExit.c
rc2931ea rf1ee72e 1 int main() {1 int foo() { 2 2 int i; 3 3 int x, y; … … 130 130 } 131 131 132 #if 0132 #if 1 133 133 Q: if ( i > 5 ) { 134 134 i += 1; -
src/tests/Makefile.am
rc2931ea rf1ee72e 11 11 ## Created On : Sun May 31 09:08:15 2015 12 12 ## Last Modified By : Peter A. Buhr 13 ## Last Modified On : Mon J an 25 22:31:42 201614 ## Update Count : 2513 ## Last Modified On : Mon Jun 20 14:30:52 2016 14 ## Update Count : 33 15 15 ############################################################################### 16 16 … … 19 19 CC = @CFA_BINDIR@/cfa 20 20 21 noinst_PROGRAMS = fstream_test vector_test avl_test # build but do not install 21 .PHONY : list 22 EXTRA_PROGRAMS = fstream_test vector_test avl_test Constant0-1DP Constant0-1ND Constant0-1NDDP # build but do not install 23 22 24 fstream_test_SOURCES = fstream_test.c 23 25 vector_test_SOURCES = vector/vector_int.c vector/array.c vector/vector_test.c 24 26 avl_test_SOURCES = avltree/avl_test.c avltree/avl0.c avltree/avl1.c avltree/avl2.c avltree/avl3.c avltree/avl4.c avltree/avl-private.c 27 28 all-local : 29 python test.py vector_test avl_test Operators NumericConstants Expression Enum AsmName Array Typeof Cast 30 31 all-tests : 32 python test.py --all 33 34 clean-local : 35 -rm -f ${EXTRA_PROGRAMS} 36 37 list : 38 python test.py --list 39 40 Constant0-1DP : Constant0-1.c 41 ${CC} ${CFLAGS} -DDUPS ${<} -o ${@} 42 43 Constant0-1ND : Constant0-1.c 44 ${CC} ${CFLAGS} -DNEWDECL ${<} -o ${@} 45 46 Constant0-1NDDP : Constant0-1.c 47 ${CC} ${CFLAGS} -DNEWDECL -DDUPS ${<} -o ${@} -
src/tests/Makefile.in
rc2931ea rf1ee72e 18 18 ######################## -*- Mode: Makefile-Automake -*- ###################### 19 19 ############################################################################### 20 21 20 VPATH = @srcdir@ 22 21 pkgdatadir = $(datadir)/@PACKAGE@ … … 36 35 PRE_UNINSTALL = : 37 36 POST_UNINSTALL = : 38 noinst_PROGRAMS = fstream_test$(EXEEXT) vector_test$(EXEEXT) \ 39 avl_test$(EXEEXT) 37 EXTRA_PROGRAMS = fstream_test$(EXEEXT) vector_test$(EXEEXT) \ 38 avl_test$(EXEEXT) Constant0-1DP$(EXEEXT) \ 39 Constant0-1ND$(EXEEXT) Constant0-1NDDP$(EXEEXT) 40 40 subdir = src/tests 41 41 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in … … 48 48 CONFIG_CLEAN_FILES = 49 49 CONFIG_CLEAN_VPATH_FILES = 50 PROGRAMS = $(noinst_PROGRAMS) 50 Constant0_1DP_SOURCES = Constant0-1DP.c 51 Constant0_1DP_OBJECTS = Constant0-1DP.$(OBJEXT) 52 Constant0_1DP_LDADD = $(LDADD) 53 Constant0_1ND_SOURCES = Constant0-1ND.c 54 Constant0_1ND_OBJECTS = Constant0-1ND.$(OBJEXT) 55 Constant0_1ND_LDADD = $(LDADD) 56 Constant0_1NDDP_SOURCES = Constant0-1NDDP.c 57 Constant0_1NDDP_OBJECTS = Constant0-1NDDP.$(OBJEXT) 58 Constant0_1NDDP_LDADD = $(LDADD) 51 59 am_avl_test_OBJECTS = avl_test.$(OBJEXT) avl0.$(OBJEXT) avl1.$(OBJEXT) \ 52 60 avl2.$(OBJEXT) avl3.$(OBJEXT) avl4.$(OBJEXT) \ … … 84 92 am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) 85 93 am__v_GEN_0 = @echo " GEN " $@; 86 SOURCES = $(avl_test_SOURCES) $(fstream_test_SOURCES) \ 94 SOURCES = Constant0-1DP.c Constant0-1ND.c Constant0-1NDDP.c \ 95 $(avl_test_SOURCES) $(fstream_test_SOURCES) \ 87 96 $(vector_test_SOURCES) 88 DIST_SOURCES = $(avl_test_SOURCES) $(fstream_test_SOURCES) \ 97 DIST_SOURCES = Constant0-1DP.c Constant0-1ND.c Constant0-1NDDP.c \ 98 $(avl_test_SOURCES) $(fstream_test_SOURCES) \ 89 99 $(vector_test_SOURCES) 90 100 ETAGS = etags … … 235 245 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 236 246 $(am__aclocal_m4_deps): 237 238 clean-noinstPROGRAMS:239 -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)240 247 avl_test$(EXEEXT): $(avl_test_OBJECTS) $(avl_test_DEPENDENCIES) $(EXTRA_avl_test_DEPENDENCIES) 241 248 @rm -f avl_test$(EXEEXT) … … 254 261 -rm -f *.tab.c 255 262 263 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Constant0-1DP.Po@am__quote@ 264 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Constant0-1ND.Po@am__quote@ 265 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Constant0-1NDDP.Po@am__quote@ 256 266 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/array.Po@am__quote@ 257 267 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/avl-private.Po@am__quote@ … … 504 514 check-am: all-am 505 515 check: check-am 506 all-am: Makefile $(PROGRAMS)516 all-am: Makefile all-local 507 517 installdirs: 508 518 install: install-am … … 538 548 clean: clean-am 539 549 540 clean-am: clean-generic clean- noinstPROGRAMSmostlyclean-am550 clean-am: clean-generic clean-local mostlyclean-am 541 551 542 552 distclean: distclean-am … … 607 617 .MAKE: install-am install-strip 608 618 609 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic\610 clean- noinstPROGRAMSctags distclean distclean-compile \619 .PHONY: CTAGS GTAGS all all-am all-local check check-am clean \ 620 clean-generic clean-local ctags distclean distclean-compile \ 611 621 distclean-generic distclean-tags distdir dvi dvi-am html \ 612 622 html-am info info-am install install-am install-data \ … … 621 631 622 632 633 .PHONY : list 634 635 all-local : 636 python test.py vector_test avl_test Operators NumericConstants Expression Enum AsmName Array Typeof Cast 637 638 all-tests : 639 python test.py --all 640 641 clean-local : 642 -rm -f ${EXTRA_PROGRAMS} 643 644 list : 645 python test.py --list 646 647 Constant0-1DP : Constant0-1.c 648 ${CC} ${CFLAGS} -DDUPS ${<} -o ${@} 649 650 Constant0-1ND : Constant0-1.c 651 ${CC} ${CFLAGS} -DNEWDECL ${<} -o ${@} 652 653 Constant0-1NDDP : Constant0-1.c 654 ${CC} ${CFLAGS} -DNEWDECL -DDUPS ${<} -o ${@} 655 623 656 # Tell versions [3.59,3.63) of GNU make to not export all variables. 624 657 # Otherwise a system limit (for SysV at least) may be exceeded. -
src/tests/NumericConstants.c
rc2931ea rf1ee72e 1 1 int main() { 2 1; /* decimal */ 3 2_1;4 2_147_483_647;5 37LL;6 45ull;7 89llu;8 99LLu;9 56_lu;10 88_LLu;2 1; // decimal 3 2_1; 4 2_147_483_647; 5 37LL; 6 45ull; 7 89llu; 8 99LLu; 9 56_lu; 10 88_LLu; 11 11 12 // 0; /* octal */13 0u;14 0_3_77;15 0_377_ul;12 // 0; // octal 13 0u; 14 0_3_77; 15 0_377_ul; 16 16 17 0x1; /* hexadecimal */ 18 0x1u;19 0xabL;20 0x_80000000;21 0x_fff;22 0x_ef3d_aa5c;23 0x_3LL;17 0x1; // hexadecimal 18 0x1u; 19 0xabL; 20 0x_80000000; 21 0x_fff; 22 0x_ef3d_aa5c; 23 0x_3LL; 24 24 25 3.; /* integral real */ 26 3_100.;27 1_000_000.;25 3.; // integral real 26 3_100.; 27 1_000_000.; 28 28 29 3.1; /* integral/fractional real */ 30 3.141_592_654L;31 123_456.123_456;29 3.1; // integral/fractional real 30 3.141_592_654L; 31 123_456.123_456; 32 32 33 3E1; /* integral/exponent real */ 34 3_e1f;35 3_E1_1_F;36 3_E_11;37 3_e_+11;38 3_E_-11;33 3E1; // integral/exponent real 34 3_e1f; 35 3_E1_1_F; 36 3_E_11; 37 3_e_+11; 38 3_E_-11; 39 39 40 3.0E1; /* integral/fractional/exponent real */ 41 3.0_E1L;42 3.0_e1_1;43 3.0_E_11_l;44 3.0_e_+11l;45 3.0_E_-11;46 123_456.123_456E-16;40 3.0E1; // integral/fractional/exponent real 41 3.0_E1L; 42 3.0_e1_1; 43 3.0_E_11_l; 44 3.0_e_+11l; 45 3.0_E_-11; 46 123_456.123_456E-16; 47 47 48 0x_ff.ffp0; /* hex real */ 49 0x_1.ffff_ffff_p_128_l;48 0x_ff.ffp0; // hex real 49 0x_1.ffff_ffff_p_128_l; 50 50 } 51 52 // Local Variables: //53 // compile-command: "../../../bin/cfa -std=c99 NumericConstants.c" //54 // End: // -
src/tests/OccursError.c
rc2931ea rf1ee72e 1 forall( otype T ) void f( void (*)( T, T* ) ); 2 forall( otype U ) void g( U*, U ); 1 forall( otype T ) void f( void (*)( T, T * ) ); 2 forall( otype U ) void g( U, U * ); 3 forall( otype U ) void h( U *, U ); 3 4 4 5 void test() { 6 f( h ); 5 7 f( g ); 6 8 } -
src/tests/Operators.c
rc2931ea rf1ee72e 1 int ?*?( int, int ); 1 int ?*?( int a, int b ) { 2 return 0; 3 } 2 4 3 5 int ?()( int number1, int number2 ) { … … 5 7 } 6 8 7 int ?+?( int, int ); 9 int ?+?( int a, int b ) { 10 return 0; 11 } 8 12 9 int ?=?( int *, int ); 13 int ?=?( int *a, int b ) { 14 return 0; 15 } 10 16 struct accumulator { 11 17 int total; 12 18 }; 13 19 14 char ?()( struct accumulator a, char number1, char number2 ); 20 char ?()( struct accumulator a, char number1, char number2 ) { 21 return 'a'; 22 } 15 23 16 24 void f( void ) { … … 23 31 } 24 32 33 int main(int argc, char const *argv[]) { 34 /* code */ 35 return 0; 36 } 37 25 38 // Local Variables: // 26 39 // tab-width: 4 // -
src/tests/Scope.c
rc2931ea rf1ee72e 3 3 typedef float t; 4 4 y z; 5 otype u = struct { int a; double b; }; 5 //otype u = struct { int a; double b; }; 6 typedef struct { int a; double b; } u; 6 7 int f( int y ); 7 8 y q; 9 struct x { int x; }; 8 10 9 11 y w( y y, u v ) { 10 otype x | { x t(u); }; 12 // otype x | { x t(u); }; 13 void ?{}(struct x *); 14 void ^?{}(struct x *); 15 extern struct x t( u ); 11 16 u u = y; 12 x z = t(u);17 struct x z = t(u); 13 18 } 14 19 15 20 y p; 16 21 17 context has_u( otype z ) {22 trait has_u( otype z ) { 18 23 z u(z); 19 24 }; … … 40 45 } 41 46 47 void some_func() {} 48 42 49 t g( void ) { 43 50 typedef char x; 44 try {51 // try { 45 52 some_func(); 46 } catch ( x x ) {47 t y = x;48 }53 // } catch ( x x ) { 54 // t y = x; 55 // } 49 56 x z; 50 57 } -
src/tests/ShortCircuit.c
rc2931ea rf1ee72e 1 int ?!=?( int, int ); 2 int ?!=?( float, float ); 3 int 0; 4 5 void g( float ); 6 void g( int ); 1 void g( float f ) {} 2 void g( int i ) {} 7 3 8 4 void f( int a ) { … … 14 10 } 15 11 16 //Dummy main 12 void g() { 13 int a; 14 struct { int b; } a; 15 if ( a ) { 16 while ( a ) { 17 int *b; 18 for ( b; a; b ) { 19 } 20 } 21 } 22 } 23 24 #include <fstream> 25 26 struct test_t { 27 int x; 28 }; 29 30 int ?!=?( test_t lhs, int rhs ) { 31 sout | lhs.x | " "; 32 return lhs.x != 0; 33 } 34 35 17 36 int main(int argc, char const *argv[]) 18 37 { 38 test_t true_val, false_val; 39 true_val.x = 1; 40 false_val.x = 0; 41 42 true_val && false_val; 43 sout | endl; 44 45 true_val || false_val; 46 sout | endl; 47 48 false_val && true_val; 49 sout | endl; 50 51 false_val || true_val; 52 sout | endl; 53 19 54 return 0; 20 55 } -
src/tests/StructMember.c
rc2931ea rf1ee72e 10 10 int (*m10)(); 11 11 int *(*m11)(int); 12 T T;13 12 T (T); 14 13 -
src/tests/Subrange.c
rc2931ea rf1ee72e 1 1 // A small context defining the notion of an ordered otype. (The standard 2 2 // library should probably contain a context for this purpose.) 3 context ordered(otype T) {3 trait ordered(otype T) { 4 4 int ?<?(T, T), ?<=?(T, T); 5 5 }; -
src/tests/Switch.c
rc2931ea rf1ee72e 1 int fred() {1 int main(int argc, char const *argv[]) { 2 2 int i; 3 3 switch ( i ) case 3 : i = 1; -
src/tests/Typedef.c
rc2931ea rf1ee72e 18 18 a c; 19 19 20 typedef otypeof(3) x, y; // GCC20 typedef typeof(3) x, y; // GCC 21 21 22 22 x p; … … 24 24 25 25 int main() { 26 typedef otypeof(3) z, p;26 typedef typeof(3) z, p; 27 27 z w; 28 28 p x; -
src/tests/Typeof.c
rc2931ea rf1ee72e 1 1 int main() { 2 2 int *v1; 3 otypeof(v1) v2;4 otypeof(*v1) v3[4];3 typeof(v1) v2; 4 typeof(*v1) v3[4]; 5 5 char *v4[4]; 6 otypeof(otypeof(char *)[4]) v5;7 otypeof (int *) v6;8 otypeof( int ( int, int p ) ) *v7;9 otypeof( [int] ( int, int p ) ) *v8;6 typeof(typeof(char *)[4]) v5; 7 typeof (int *) v6; 8 typeof( int ( int, int p ) ) *v7; 9 typeof( [int] ( int, int p ) ) *v8; 10 10 } -
src/tests/limits.c
rc2931ea rf1ee72e 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // limits.c -- 7 // limits.c -- 8 8 // 9 9 // Author : Peter A. Buhr … … 12 12 // Last Modified On : Tue May 10 20:45:28 2016 13 13 // Update Count : 1 14 // 14 // 15 15 16 16 #include <limits> … … 109 109 long _Complex _1_sqrt_2 = _1_SQRT_2; 110 110 111 int main(int argc, char const *argv[]) { 112 //DUMMY 113 return 0; 114 } 115 111 116 // Local Variables: // 112 117 // tab-width: 4 // -
src/tests/test.py
rc2931ea rf1ee72e 2 2 from __future__ import print_function 3 3 4 from os import listdir 5 from os.path import isfile, join 4 from os import listdir, environ 5 from os.path import isfile, join, splitext 6 6 from subprocess import Popen, PIPE, STDOUT 7 7 8 8 import argparse 9 import os 10 import re 9 11 import sys 10 12 … … 13 15 ################################################################################ 14 16 def listTests(): 15 list = [f.rstrip('.c') for f in listdir('.') 16 if not f.startswith('.') and ( 17 not isfile(f) or f.endswith('.c') 18 )] 17 list = [splitext(f)[0] for f in listdir('./.expect') 18 if not f.startswith('.') and f.endswith('.txt') 19 ] 19 20 20 21 return list … … 29 30 return proc.returncode 30 31 32 def file_replace(fname, pat, s_after): 33 # first, see if the pattern is even in the file. 34 with open(fname) as f: 35 if not any(re.search(pat, line) for line in f): 36 return # pattern does not occur in file so we are done. 37 38 # pattern is in the file, so perform replace operation. 39 with open(fname) as f: 40 out_fname = fname + ".tmp" 41 out = open(out_fname, "w") 42 for line in f: 43 out.write(re.sub(pat, s_after, line)) 44 out.close() 45 os.rename(out_fname, fname) 46 47 def fix_MakeLevel(file) : 48 if environ.get('MAKELEVEL') : 49 file_replace(file, "make\[%i\]" % int(environ.get('MAKELEVEL')), 'make' ) 50 51 31 52 ################################################################################ 32 53 # running test functions … … 40 61 41 62 # build, skipping to next test on error 42 make_ret = sh("make -j 8 %s > %s 2>&1" % (test, out_file), dry_run)63 make_ret = sh("make -j 8 %s 2> %s 1> /dev/null" % (test, out_file), dry_run) 43 64 44 65 if make_ret == 0 : … … 50 71 51 72 retcode = 0 73 74 fix_MakeLevel(out_file) 75 52 76 if not generate : 53 # touch expected files so empty output are supported by default54 sh("touch .expect/%s.txt" % test, dry_run)55 56 77 # diff the output of the files 57 78 retcode = sh("diff .expect/%s.txt .out/%s.log" % (test, test), dry_run) … … 67 88 68 89 if generate : 69 print( "Regenerate tests for: ", end="" ) 70 print( ", ".join( tests ) ) 90 print( "Regenerate tests for: " ) 71 91 72 92 failed = False; 73 93 for t in tests: 74 if not generate : 75 print("%20s " % t, end="") 94 print("%20s " % t, end="") 76 95 sys.stdout.flush() 77 96 test_failed = run_test_instance(t, generate, dry_run) … … 80 99 if not generate : 81 100 print("FAILED" if test_failed else "PASSED") 101 else : 102 print( "Done" ) 82 103 83 104 sh('make clean > /dev/null 2>&1', dry_run) 84 105 85 if generate : 86 print( "Done" ) 87 88 return 0 if failed else 1 106 return 1 if failed else 0 89 107 90 108 ################################################################################ … … 93 111 parser = argparse.ArgumentParser(description='Script which runs cforall tests') 94 112 parser.add_argument('--dry-run', help='Don\'t run the tests, only output the commands', action='store_true') 113 parser.add_argument('--list', help='List all test available', action='store_true') 95 114 parser.add_argument('--all', help='Run all test available', action='store_true') 96 parser.add_argument('-- generate-expected', help='Regenerate the .expect by running the specified tets, can be used with --all option', action='store_true')115 parser.add_argument('--regenerate-expected', help='Regenerate the .expect by running the specified tets, can be used with --all option', action='store_true') 97 116 parser.add_argument('tests', metavar='test', type=str, nargs='*', help='a list of tests to run') 98 117 99 118 options = parser.parse_args() 100 119 101 if len(options.tests) > 0 and options.all : 120 if (len(options.tests) > 0 and options.all and not options.list) \ 121 or (len(options.tests) == 0 and not options.all and not options.list) : 102 122 print('ERROR: must have option \'--all\' or non-empty test list', file=sys.stderr) 103 123 parser.print_help() 104 124 sys.exit(1) 105 125 106 tests = listTests() if options.all else options.tests 126 allTests = listTests() 107 127 108 sys.exit( run_tests(tests, options.generate_expected, options.dry_run) ) 128 if options.all or options.list : 129 tests = allTests 130 131 else : 132 tests = [] 133 for test in options.tests: 134 if test in allTests : 135 tests.append(test) 136 else : 137 print('ERROR: No expected file for test %s, ignoring it' % test, file=sys.stderr) 138 139 if len(tests) == 0 : 140 print('ERROR: No valid test to run', file=sys.stderr) 141 sys.exit(1) 142 143 if options.list : 144 print("\n".join(tests)) 145 146 else : 147 sys.exit( run_tests(tests, options.regenerate_expected, options.dry_run) )
Note:
See TracChangeset
for help on using the changeset viewer.