- Timestamp:
- Jun 20, 2016, 11:30:03 AM (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:
- 439a2b4
- Parents:
- fbaebc6
- Location:
- src/tests
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified src/tests/Context.c ¶
rfbaebc6 re5b96bf 1 1 //cforall context declaration 2 context has_q( otype T ) {2 trait has_q( otype T ) { 3 3 T q( T ); 4 4 }; -
TabularUnified src/tests/Forall.c ¶
rfbaebc6 re5b96bf 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); -
TabularUnified src/tests/Operators.c ¶
rfbaebc6 re5b96bf 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 // -
TabularUnified src/tests/Scope.c ¶
rfbaebc6 re5b96bf 15 15 y p; 16 16 17 context has_u( otype z ) {17 trait has_u( otype z ) { 18 18 z u(z); 19 19 }; -
TabularUnified src/tests/Subrange.c ¶
rfbaebc6 re5b96bf 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 }; -
TabularUnified src/tests/Switch.c ¶
rfbaebc6 re5b96bf 1 int fred() {1 int main(int argc, char const *argv[]) { 2 2 int i; 3 3 switch ( i ) case 3 : i = 1; -
TabularUnified src/tests/Typedef.c ¶
rfbaebc6 re5b96bf 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;
Note: See TracChangeset
for help on using the changeset viewer.