- Timestamp:
- Jun 14, 2016, 1:23:18 PM (9 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:
- 545ef59, c738ca4, ee51534
- Parents:
- 6cbc25a (diff), c8c03683 (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:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Tests/Abstype.c
r6cbc25a r7ff30d07 1 type T | { T x( T ); };1 otype T | { T x( T ); }; 2 2 3 3 T y( T t ) { … … 6 6 } 7 7 8 forall( type T ) lvalue T *?( T * );8 forall( otype T ) lvalue T *?( T * ); 9 9 int ?++( int * ); 10 10 int ?=?( int *, int ); 11 11 forall( dtype DT ) DT * ?=?( DT **, DT * ); 12 12 13 type U = int *;13 otype U = int *; 14 14 15 15 U x( U u ) { -
src/Tests/Attributes.c
r6cbc25a r7ff30d07 6 6 // @max 7 7 // 8 // 2. a direct application to a manifest type8 // 2. a direct application to a manifest otype 9 9 // 10 10 // @max( int ) 11 11 // 12 // 3. constraining a type variable; the application is implicitly performed at the call site as in (2)12 // 3. constraining a otype variable; the application is implicitly performed at the call site as in (2) 13 13 // 14 // forall( type T | { T @max( T ); } ) T x( T t );14 // forall( otype T | { T @max( T ); } ) T x( T t ); 15 15 // 16 16 // … … 23 23 // x = (*attr_var); 24 24 // 25 // 2. an indirect application to a manifest type25 // 2. an indirect application to a manifest otype 26 26 // 27 27 // (*attr_var)( int ) 28 28 // 29 // 3. a direct application to a type variable29 // 3. a direct application to a otype variable 30 30 // 31 31 // @max( T ) … … 47 47 // 3. polymorphic 48 48 // 49 // forall( type T | constraint( T ) ) int @attr( T );49 // forall( otype T | constraint( T ) ) int @attr( T ); 50 50 51 51 int @max = 3; … … 53 53 int main() { 54 54 int x; 55 type @type(type t); // compiler intrinsic56 type @widest(type t);57 @ type(x) *y; // gcc:typeof(x) *y;58 const @widest(double) *w; // gcc: const typeof(x) *w;59 * @ type(3 + 4) z; // cfa declaration syntax55 otype @otype(otype t); // compiler intrinsic 56 otype @widest(otype t); 57 @otype(x) *y; // gcc: otypeof(x) *y; 58 const @widest(double) *w; // gcc: const otypeof(x) *w; 59 * @otype(3 + 4) z; // cfa declaration syntax 60 60 y = @max; 61 61 z = @max(x) + @size(int); -
src/Tests/InferParam.c
r6cbc25a r7ff30d07 3 3 double ?=?( double*, double ); 4 4 5 forall( type T,type U | { U f(T); } ) U g(T);5 forall( otype T, otype U | { U f(T); } ) U g(T); 6 6 float f( int ); 7 7 double f( int ); … … 13 13 } 14 14 15 context has_f_and_j( type T,type U ) {15 context has_f_and_j( otype T, otype U ) { 16 16 U f( T ); 17 17 U j( T, U ); … … 19 19 20 20 float j( int, float ); 21 forall( type T,type U | has_f_and_j( T, U ) ) U k( T );21 forall( otype T, otype U | has_f_and_j( T, U ) ) U k( T ); 22 22 23 23 void l() { -
src/Tests/Makefile
r6cbc25a r7ff30d07 1 CFA ?= ../ cfa-cpp1 CFA ?= ../driver/cfa-cpp 2 2 CFAOPT ?= -a 3 3 OUTPUT ?= Output … … 32 32 33 33 ${OUTPUTDIR} : 34 mkdir $@34 mkdir -p $@ 35 35 36 36 # remove the expected results directories to generate new ones from the current output -
src/Tests/Members.c
r6cbc25a r7ff30d07 3 3 float ?=?( float*, float ); 4 4 forall( dtype DT ) DT * ?=?( DT**, DT* ); 5 forall( type T) lvalue T *?( T* );5 forall(otype T) lvalue T *?( T* ); 6 6 char *__builtin_memcpy(); 7 7 -
src/Tests/OccursError.c
r6cbc25a r7ff30d07 1 forall( type T ) void f( void (*)( T, T* ) );2 forall( type U ) void g( U*, U );1 forall( otype T ) void f( void (*)( T, T* ) ); 2 forall( otype U ) void g( U*, U ); 3 3 4 4 void test() { -
src/Tests/Quad.c
r6cbc25a r7ff30d07 2 2 int ?*?( int, int ); 3 3 4 forall( type T | { T ?*?( T, T ); } )4 forall( otype T | { T ?*?( T, T ); } ) 5 5 T square( T t ) { 6 6 return t * t; 7 7 } 8 8 9 forall( type U | { U square( U ); } )9 forall( otype U | { U square( U ); } ) 10 10 U quad( U u ) { 11 11 return square( square( u ) ); -
src/Tests/Rank2.c
r6cbc25a r7ff30d07 3 3 4 4 void a() { 5 forall( type T ) void f( T );6 void g( forall( type U ) void p( U ) );5 forall( otype T ) void f( T ); 6 void g( forall( otype U ) void p( U ) ); 7 7 g( f ); 8 8 } … … 10 10 void g() { 11 11 void h( int *null ); 12 forall( type T ) T id( T );12 forall( otype T ) T id( T ); 13 13 forall( dtype T ) T *0; 14 14 int 0;
Note:
See TracChangeset
for help on using the changeset viewer.