Changeset a65d92e
- Timestamp:
- Jun 5, 2015, 9:34:43 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, string, with_gc
- Children:
- 59db689
- Parents:
- 44b5ca0
- Location:
- src/Tests
- Files:
-
- 44 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Tests/ResolvExpr/Abstype.c
r44b5ca0 ra65d92e 3 3 type T | { T x( T ); }; 4 4 5 T y( T t ) 6 { 5 T y( T t ) { 7 6 T t_instance; 8 7 return x( t ); 9 8 } 10 9 11 forall( type T) lvalue T *?( T* );12 int 13 int ?=?( int *, int );14 forall( dtype DT) DT* ?=?( DT * *, DT* );10 forall( type T ) lvalue T *?( T * ); 11 int ?++( int *); 12 int ?=?( int *, int ); 13 forall( dtype DT ) DT * ?=?( DT **, DT * ); 15 14 16 type U = int *;15 type U = int *; 17 16 18 U x( U u ) 19 { 17 U x( U u ) { 20 18 U u_instance = u; 21 19 (*u)++; … … 23 21 } 24 22 25 int *break_abstraction( U u ) 26 { 23 int *break_abstraction( U u ) { 27 24 return u; 28 25 } 26 27 // Local Variables: // 28 // tab-width: 4 // 29 // End: // -
src/Tests/ResolvExpr/Attributes.c
r44b5ca0 ra65d92e 1 // "cfa-cpp -ne simple.c"2 3 1 int @voon; 4 2 double @voon; … … 9 7 void g( int ); 10 8 11 void 12 f() 13 { 14 float x; 15 double x; 16 @bort(x); 17 @bort(int); 18 g( @voon ); 9 void f() { 10 float x; 11 double x; 12 @bort(x); 13 @bort(int); 14 g( @voon ); 19 15 } 16 17 // Local Variables: // 18 // tab-width: 4 // 19 // End: // -
src/Tests/ResolvExpr/Cast.c
r44b5ca0 ra65d92e 1 1 char f; 2 void f() 3 {4 5 6 7 8 9 10 2 3 void f() { 4 char f; 5 double f; 6 (int)f; 7 short f; 8 (int)f; 9 (void(*)())f; 10 ([long, long double, *[]()])([f, f, f]); 11 11 } 12 13 // Local Variables: // 14 // tab-width: 4 // 15 // End: // -
src/Tests/ResolvExpr/CastError.c
r44b5ca0 ra65d92e 1 1 int f; 2 void f() 3 {4 5 6 7 2 3 void f() { 4 int f; 5 double f; 6 (char)f; 7 (int(*)())f; 8 8 } 9 10 // Local Variables: // 11 // tab-width: 4 // 12 // End: // -
src/Tests/ResolvExpr/Forall.c
r44b5ca0 ra65d92e 6 6 void (* ?=?( void (**)(void), void (*)(void) ))(void); 7 7 8 void g1() 9 { 10 forall( type T ) T f( T ); 11 void f( int ); 12 void h( void (*p)(void) ); 8 void g1() { 9 forall( type T ) T f( T ); 10 void f( int ); 11 void h( void (*p)(void) ); 13 12 14 15 16 17 13 int x; 14 void (*y)(void); 15 char z; 16 float w; 18 17 19 20 21 22 23 18 f( x ); 19 f( y ); 20 f( z ); 21 f( w ); 22 h( f( y ) ); 24 23 } 25 24 26 void g2() 27 { 28 forall( type T ) void f( T, T ); 29 forall( type T, type U ) void f( T, U ); 25 void g2() { 26 forall( type T ) void f( T, T ); 27 forall( type T, type U ) void f( T, U ); 30 28 31 32 33 34 29 int x; 30 float y; 31 int *z; 32 float *w; 35 33 36 37 38 34 f( x, y ); 35 f( z, w ); 36 f( x, z ); 39 37 } 38 39 // Local Variables: // 40 // tab-width: 4 // 41 // End: // -
src/Tests/ResolvExpr/Function.c
r44b5ca0 ra65d92e 4 4 float f( float ); 5 5 6 void g() 7 { 8 // selects the same f and a each time 9 // but without a cast would be ambiguous 10 f( (int)a ); 11 (int)f( a ); 6 void g() { 7 // selects the same f each time but without a cast would be ambiguous 8 f( (int)a ); 9 (int)f( a ); 12 10 } 13 11 … … 24 22 [ int, int ] r( int, int, int, int ); 25 23 26 void s() 27 { 28 r( p, q ); 29 r( [ q, p ] ); 30 r( r( p, q ), r( q, q ) ); 24 void s() { 25 r( p, q ); 26 r( [ q, p ] ); 27 r( r( p, q ), r( q, q ) ); 31 28 } 29 30 // Local Variables: // 31 // tab-width: 4 // 32 // End: // -
src/Tests/ResolvExpr/InferParam.c
r44b5ca0 ra65d92e 8 8 void i( float ); 9 9 10 void h() 11 { 12 int a; 13 i( g( a ) ); 10 void h() { 11 int a; 12 i( g( a ) ); 14 13 } 15 14 16 context has_f_and_j( type T, type U ) 17 { 18 U f( T ); 19 U j( T, U ); 15 context has_f_and_j( type T, type U ) { 16 U f( T ); 17 U j( T, U ); 20 18 }; 21 19 … … 23 21 forall( type T, type U | has_f_and_j( T, U ) ) U k( T ); 24 22 25 void l() 26 { 27 int b; 28 i( k( b ) ); 23 void l() { 24 int b; 25 i( k( b ) ); 29 26 } 27 28 // Local Variables: // 29 // tab-width: 4 // 30 // End: // -
src/Tests/ResolvExpr/Members.c
r44b5ca0 ra65d92e 1 // "../../cfa-cpp -nc Members.c"2 3 1 char ?=?( char*, char ); 4 2 int ?=?( int*, int ); … … 13 11 void d( float* ); 14 12 15 struct a_struct 16 { 17 int a; 18 char a; 19 float a; 13 struct a_struct { 14 int a; 15 char a; 16 float a; 20 17 }; 21 18 22 union b_struct 23 { 24 int *a; 25 char *a; 26 float *a; 19 union b_struct { 20 int *a; 21 char *a; 22 float *a; 27 23 }; 28 24 29 void f() 30 { 31 struct a_struct the_struct; 32 union b_struct the_struct; 25 void f() { 26 struct a_struct the_struct; 27 union b_struct the_struct; 33 28 34 35 36 37 29 a( the_struct.a ); 30 b( the_struct.a ); 31 c( the_struct.a ); 32 d( the_struct.a ); 38 33 } 39 34 40 struct c_struct 41 { 42 int; 43 char; 44 float; 35 struct c_struct { 36 int; 37 char; 38 float; 45 39 }; 46 40 47 union d_struct 48 { 49 int*; 50 char*; 51 float*; 41 union d_struct { 42 int*; 43 char*; 44 float*; 52 45 }; 53 46 54 void g() 55 { 56 unsigned short x; 57 struct c_struct x; 58 union d_struct x; 47 void g() { 48 unsigned short x; 49 struct c_struct x; 50 union d_struct x; 59 51 60 61 62 63 52 a( x ); // the 'a' and 'b' calls resolve to the ushort 53 b( x ); // it's debatable whether this is good 54 c( x ); 55 d( x ); 64 56 } 65 57 … … 72 64 struct forward { int y; }; 73 65 74 void h() 75 { 66 void h() { 76 67 q->y; 77 68 } 69 70 // Local Variables: // 71 // tab-width: 4 // 72 // End: // -
src/Tests/ResolvExpr/Misc.c
r44b5ca0 ra65d92e 6 6 void g( unsigned ); 7 7 8 void 9 f( void ) 10 { 11 g( (a, b) ); 12 g( (a, a, b) ); 13 g( sizeof a ); 14 g( sizeof( int ) ); 8 void f( void ) { 9 g( (a, b) ); 10 g( (a, a, b) ); 11 g( sizeof a ); 12 g( sizeof( int ) ); 15 13 } 14 15 // Local Variables: // 16 // tab-width: 4 // 17 // End: // -
src/Tests/ResolvExpr/MiscError.c
r44b5ca0 ra65d92e 5 5 void g( int ); 6 6 7 void 8 f( void ) 9 { 10 g( (b, a) ); 11 g( (b, a, b) ); 12 g( (a, b, b) ); 13 sizeof b; 7 void f( void ) { 8 g( (b, a) ); 9 g( (b, a, b) ); 10 g( (a, b, b) ); 11 sizeof b; 14 12 } 13 14 // Local Variables: // 15 // tab-width: 4 // 16 // End: // -
src/Tests/ResolvExpr/OccursError.c
r44b5ca0 ra65d92e 1 // "./cfa-cpp -c simple.c"2 // "./cfa -v simple.c"3 // "./cfa -CFA simple.c > simple_out.c"4 5 1 forall( type T ) void f( void (*)( T, T* ) ); 6 2 forall( type U ) void g( U*, U ); 7 3 8 void test() 9 { 10 f( g ); 4 void test() { 5 f( g ); 11 6 } 7 8 // Local Variables: // 9 // tab-width: 4 // 10 // End: // -
src/Tests/ResolvExpr/Operators.c
r44b5ca0 ra65d92e 1 1 int ?*?( int, int ); 2 2 3 int 4 ?()( int number1, int number2 ) 5 { 6 return number1 * number2; 3 int ?()( int number1, int number2 ) { 4 return number1 * number2; 7 5 } 8 6 9 7 int ?+?( int, int ); 10 8 11 int ?=?( int*, int ); 12 struct accumulator 13 { 14 int total; 9 int ?=?( int *, int ); 10 struct accumulator { 11 int total; 15 12 }; 16 13 17 14 char ?()( struct accumulator a, char number1, char number2 ); 18 15 19 void 20 f( void ) 21 { 22 char a, b; 23 ?()( a, b ); 24 a(b); 25 a + b; 26 struct accumulator ?+?; // why not, eh? 27 a + b; 16 void f( void ) { 17 char a, b; 18 ?()( a, b ); 19 a(b); 20 a + b; 21 struct accumulator ?+?; // why not, eh? 22 a + b; 28 23 } 24 25 // Local Variables: // 26 // tab-width: 4 // 27 // End: // -
src/Tests/ResolvExpr/Quad.c
r44b5ca0 ra65d92e 1 int ?=?( int *, int );1 int ?=?( int *, int ); 2 2 int ?*?( int, int ); 3 3 4 4 forall( type T | { T ?*?( T, T ); } ) 5 T square( T t ) 6 { 7 return t * t; 5 T square( T t ) { 6 return t * t; 8 7 } 9 8 10 9 forall( type U | { U square( U ); } ) 11 U quad( U u ) 12 { 13 return square( square( u ) ); 10 U quad( U u ) { 11 return square( square( u ) ); 14 12 } 15 13 16 void f() 17 { 18 quad( 7 ); 14 void f() { 15 quad( 7 ); 19 16 } 17 18 // Local Variables: // 19 // tab-width: 4 // 20 // End: // -
src/Tests/ResolvExpr/Rank2.c
r44b5ca0 ra65d92e 1 int ?=?( int *, int );2 forall(dtype DT) DT * ?=?( DT * *, DT* );1 int ?=?( int *, int ); 2 forall(dtype DT) DT * ?=?( DT **, DT * ); 3 3 4 void a() 5 { 6 forall( type T ) void f( T ); 7 void g( forall( type U ) void p( U ) ); 8 g( f ); 4 void a() { 5 forall( type T ) void f( T ); 6 void g( forall( type U ) void p( U ) ); 7 g( f ); 9 8 } 10 9 11 void g() 12 { 13 void h( int *null ); 14 forall( type T ) T id( T ); 15 forall( dtype T ) T *0; 16 int 0; 17 h( id( id( id( 0 ) ) ) ); 10 void g() { 11 void h( int *null ); 12 forall( type T ) T id( T ); 13 forall( dtype T ) T *0; 14 int 0; 15 h( id( id( id( 0 ) ) ) ); 18 16 } 17 18 // Local Variables: // 19 // tab-width: 4 // 20 // End: // -
src/Tests/ResolvExpr/ShortCircuit.c
r44b5ca0 ra65d92e 6 6 void g( int ); 7 7 8 void f( int a ) 9 { 10 int b; 11 float c; 12 g( a ? b : c ); 13 g( a && c ); 14 g( a || b ); 8 void f( int a ) { 9 int b; 10 float c; 11 g( a ? b : c ); 12 g( a && c ); 13 g( a || b ); 15 14 } 15 16 // Local Variables: // 17 // tab-width: 4 // 18 // End: // -
src/Tests/ResolvExpr/Statement.c
r44b5ca0 ra65d92e 1 int ?=?( int *, int );1 int ?=?( int *, int ); 2 2 int ?!=?( int, int ); 3 3 int 0; 4 4 5 void f() 6 { 5 void f() { 7 6 int a; 8 7 struct { int b; } a; 9 8 if ( a ) { 10 11 12 13 14 9 while ( a ) { 10 int *b; 11 for ( b; a; b ) { 12 } 13 } 15 14 } 16 15 } 16 17 // Local Variables: // 18 // tab-width: 4 // 19 // End: // -
src/Tests/SynTree/Array.c
r44b5ca0 ra65d92e 10 10 11 11 int fred() { 12 13 14 15 12 int a1[]; 13 int a2[*]; 14 int a4[3]; 15 int T[3]; 16 16 } 17 17 18 18 int mary( int T[3], 19 int p1[const 3],20 int p2[static 3],21 int p3[static const 3]22 19 int p1[const 3], 20 int p2[static 3], 21 int p3[static const 3] 22 ) { 23 23 } 24 24 … … 27 27 28 28 int (*(jane)())( int T[3], 29 int p1[const 3],30 int p2[static 3],31 int p3[static const 3]32 29 int p1[const 3], 30 int p2[static 3], 31 int p3[static const 3] 32 ) { 33 33 } 34 35 // Local Variables: // 36 // tab-width: 4 // 37 // End: // -
src/Tests/SynTree/Context.c
r44b5ca0 ra65d92e 1 context has_q( type T ) 2 { 3 T q( T ); 1 context has_q( type T ) { 2 T q( T ); 4 3 }; 5 4 6 forall( type z | has_q( z ) ) 7 void f() 8 { 9 context has_r( type T, type U ) 10 { 11 T r( T, T (T,U) ); 12 }; 5 forall( type z | has_q( z ) ) void f() { 6 context has_r( type T, type U ) { 7 T r( T, T (T,U) ); 8 }; 13 9 14 extern type x, y | has_r( x, y ); 15 10 extern type x, y | has_r( x, y ); 16 11 } 12 13 // Local Variables: // 14 // tab-width: 4 // 15 // End: // -
src/Tests/SynTree/DeclarationErrors.c
r44b5ca0 ra65d92e 4 4 typedef int Int; 5 5 static Int volatile static const x28; // duplicate static 6 7 // Local Variables: // 8 // tab-width: 4 // 9 // End: // -
src/Tests/SynTree/DeclarationSpecifier.c
r44b5ca0 ra65d92e 85 85 static const Int inline volatile f48(); 86 86 87 // Local Variables: // 88 // tab-width: 4 // 89 // End: // -
src/Tests/SynTree/Enum.c
r44b5ca0 ra65d92e 1 1 enum Colors { 2 3 4 5 6 7 8 2 Red, 3 Yellow, 4 Pink, 5 Blue, 6 Purple, 7 Orange, 8 Green 9 9 }; 10 10 11 void f( void ) { 12 enum Fruits { 13 Apple, 14 Banana, 15 Pear, 16 Mango 17 } fruit = Mango; 18 } 11 19 12 void f( void ) 13 { 14 enum Fruits { 15 Apple, 16 Banana, 17 Pear, 18 Mango 19 } fruit = Mango; 20 } 20 // Local Variables: // 21 // tab-width: 4 // 22 // End: // -
src/Tests/SynTree/Forall.c
r44b5ca0 ra65d92e 2 2 3 3 forall( type T ) 4 4 void swap( T left, T right ) { 5 5 T temp = left; 6 6 left = right; 7 7 right = temp; 8 8 } 9 9 10 10 context sumable( type T ) { … … 16 16 17 17 type T1 | { const T1 0; T1 ?+?(T1, T1); T1 ?++(T1); [T1] ?+=?(T1,T1); }, 18 19 18 T2(type P1, type P2 ), 19 T3 | sumable(T3); 20 20 21 21 type T2(type P1, type P2) | sumable(T2(P1,P2)) = struct { P1 i; P2 j; }; … … 28 28 29 29 forall( type T | sumable( T ) ) 30 30 T sum( int n, T a[] ) { 31 31 T total = 0; 32 32 int i; … … 34 34 total = total + a[i]; 35 35 return total; 36 36 } 37 37 38 38 forall( type T | { const T 0; T ?+?(T, T); T ?++(T); [T] ?+=?(T,T); } ) 39 39 T twice( T t ) { 40 40 return t + t; 41 41 } 42 42 43 43 int main() { … … 50 50 sum( 10, a ); 51 51 } 52 53 // Local Variables: // 54 // tab-width: 4 // 55 // End: // -
src/Tests/SynTree/Functions.c
r44b5ca0 ra65d92e 4 4 5 5 int f ( 6 7 8 9 10 11 12 13 14 6 int (void), 7 int (int), 8 int ((void)), 9 int ((int)), 10 void g(void) 11 ) { 12 (*g)(); 13 g(); 14 g = h; 15 15 } 16 16 … … 93 93 int ( int, int p ), 94 94 [int](int) 95 96 97 98 95 ) { 96 int (*(*p)[][10])[][3]; 97 * [][10] * [][3] int p; 98 * [] * [int](int) p; 99 99 } 100 100 … … 108 108 109 109 int f( 110 110 int (), 111 111 112 113 114 115 112 int *(), 113 int **(), 114 int * const *(), 115 int * const * const (), 116 116 117 118 117 int ([]), 118 int ([10]), 119 119 120 121 122 123 124 125 126 127 128 120 int *([]), 121 int *([10]), 122 int **([]), 123 int **([10]), 124 int * const *([]), 125 int * const *([10]), 126 int * const * const ([]), 127 int * const * const ([10]) 128 ); 129 129 130 130 int f( 131 131 int (), 132 132 133 134 135 136 133 int *(), 134 int **(), 135 int * const *(), 136 int * const * const (), 137 137 138 139 138 int ([]), 139 int ([10]), 140 140 141 142 143 144 145 146 147 148 149 141 int *([]), 142 int *([10]), 143 int **([]), 144 int **([10]), 145 int * const *([]), 146 int * const *([10]), 147 int * const * const ([]), 148 int * const * const ([10]) 149 ) { 150 150 } 151 151 … … 153 153 154 154 int f( T (T), T T ) { 155 155 T (T); 156 156 } 157 157 … … 162 162 //int f[]() {} 163 163 //int ((*f15())())[] {} 164 165 // Local Variables: // 166 // tab-width: 4 // 167 // End: // -
src/Tests/SynTree/IdentFuncDeclarator.c
r44b5ca0 ra65d92e 1 1 int main() { 2 3 4 5 6 7 8 9 10 2 //int f0[](); 3 //int (f0[])(); 4 //int f0()[]; 5 //int f0()(); 6 //int (*f0)()(); 7 //int ((*f0())())[]; 8 9 int f1; 10 int (f2); 11 11 12 13 14 15 12 int *f3; 13 int **f4; 14 int * const *f5; 15 int * const * const f6; 16 16 17 18 19 20 17 int *(f7); 18 int **(f8); 19 int * const *(f9); 20 int * const * const (f10); 21 21 22 23 24 25 22 int (*f11); 23 int (**f12); 24 int (* const *f13); 25 int (* const * const f14); 26 26 27 28 29 30 27 int f15[]; 28 int f16[10]; 29 int (f17[]); 30 int (f18[10]); 31 31 32 33 34 35 36 37 38 39 32 int *f19[]; 33 int *f20[10]; 34 int **f21[]; 35 int **f22[10]; 36 int * const *f23[]; 37 int * const *f24[10]; 38 int * const * const f25[]; 39 int * const * const f26[10]; 40 40 41 42 43 44 45 46 47 48 41 int *(f27[]); 42 int *(f28[10]); 43 int **(f29[]); 44 int **(f30[10]); 45 int * const *(f31[]); 46 int * const *(f32[10]); 47 int * const * const (f33[]); 48 int * const * const (f34[10]); 49 49 50 51 52 53 54 55 56 57 50 int (*f35[]); 51 int (*f36[10]); 52 int (**f37[]); 53 int (**f38[10]); 54 int (* const *f39[]); 55 int (* const *f40[10]); 56 int (* const * const f41[]); 57 int (* const * const f42[10]); 58 58 59 60 61 62 63 64 59 int f43[][3]; 60 int f44[3][3]; 61 int (f45[])[3]; 62 int (f46[3])[3]; 63 int ((f47[]))[3]; 64 int ((f48[3]))[3]; 65 65 66 67 68 69 70 71 72 73 66 int *f49[][3]; 67 int *f50[3][3]; 68 int **f51[][3]; 69 int **f52[3][3]; 70 int * const *f53[][3]; 71 int * const *f54[3][3]; 72 int * const * const f55[][3]; 73 int * const * const f56[3][3]; 74 74 75 76 77 78 79 80 81 82 75 int (*f57[][3]); 76 int (*f58[3][3]); 77 int (**f59[][3]); 78 int (**f60[3][3]); 79 int (* const *f61[][3]); 80 int (* const *f62[3][3]); 81 int (* const * const f63[][3]); 82 int (* const * const f64[3][3]); 83 83 84 85 84 int f65(int); 85 int (f66)(int); 86 86 87 88 89 90 87 int *f67(int); 88 int **f68(int); 89 int * const *f69(int); 90 int * const * const f70(int); 91 91 92 93 94 95 92 int *(f71)(int); 93 int **(f72)(int); 94 int * const *(f73)(int); 95 int * const * const (f74)(int); 96 96 97 98 99 100 97 int (*f75)(int); 98 int (**f76)(int); 99 int (* const *f77)(int); 100 int (* const * const f78)(int); 101 101 102 103 104 102 int (*(*f79)(int))(); 103 int (*(* const f80)(int))(); 104 int (* const(* const f81)(int))(); 105 105 } 106 107 // Local Variables: // 108 // tab-width: 4 // 109 // End: // -
src/Tests/SynTree/IdentFuncParamDeclarator.c
r44b5ca0 ra65d92e 1 1 int fred( 2 3 4 5 6 7 8 9 10 2 //int f0[](), 3 //int (f0[])(), 4 //int f0()[], 5 //int f0()(), 6 //int (*f0)()(), 7 //int ((*f0())())[], 8 9 int f1, 10 int (f2), 11 11 12 13 14 15 12 int *f3, 13 int **f4, 14 int * const *f5, 15 int * const * const f6, 16 16 17 18 19 20 17 int *(f7), 18 int **(f8), 19 int * const *(f9), 20 int * const * const (f10), 21 21 22 23 24 25 22 int (*f11), 23 int (**f12), 24 int (* const *f13), 25 int (* const * const f14), 26 26 27 28 29 30 27 int f15[], 28 int f16[10], 29 int (f17[]), 30 int (f18[10]), 31 31 32 33 34 35 36 37 38 39 32 int *f19[], 33 int *f20[10], 34 int **f21[], 35 int **f22[10], 36 int * const *f23[], 37 int * const *f24[10], 38 int * const * const f25[], 39 int * const * const f26[10], 40 40 41 42 43 44 45 46 47 48 41 int *(f27[]), 42 int *(f28[10]), 43 int **(f29[]), 44 int **(f30[10]), 45 int * const *(f31[]), 46 int * const *(f32[10]), 47 int * const * const (f33[]), 48 int * const * const (f34[10]), 49 49 50 51 52 53 54 55 56 57 50 int (*f35[]), 51 int (*f36[10]), 52 int (**f37[]), 53 int (**f38[10]), 54 int (* const *f39[]), 55 int (* const *f40[10]), 56 int (* const * const f41[]), 57 int (* const * const f42[10]), 58 58 59 60 61 62 63 64 59 int f43[][3], 60 int f44[3][3], 61 int (f45[])[3], 62 int (f46[3])[3], 63 int ((f47[]))[3], 64 int ((f48[3]))[3], 65 65 66 67 68 69 70 71 72 73 66 int *f49[][3], 67 int *f50[3][3], 68 int **f51[][3], 69 int **f52[3][3], 70 int * const *f53[][3], 71 int * const *f54[3][3], 72 int * const * const f55[][3], 73 int * const * const f56[3][3], 74 74 75 76 77 78 79 80 81 82 75 int (*f57[][3]), 76 int (*f58[3][3]), 77 int (**f59[][3]), 78 int (**f60[3][3]), 79 int (* const *f61[][3]), 80 int (* const *f62[3][3]), 81 int (* const * const f63[][3]), 82 int (* const * const f64[3][3]), 83 83 84 85 84 int f65(int), 85 int (f66)(int), 86 86 87 88 89 90 87 int *f67(int), 88 int **f68(int), 89 int * const *f69(int), 90 int * const * const f70(int), 91 91 92 93 94 95 92 int *(f71)(int), 93 int **(f72)(int), 94 int * const *(f73)(int), 95 int * const * const (f74)(int), 96 96 97 98 99 100 97 int (*f75)(int), 98 int (**f76)(int), 99 int (* const *f77)(int), 100 int (* const * const f78)(int), 101 101 102 103 104 102 int (*(*f79)(int))(), 103 int (*(* const f80)(int))(), 104 int (* const(* const f81)(int))(), 105 105 106 107 108 109 106 int f82[const *], 107 int f83[const 3], 108 int f84[static 3], 109 int f85[static const 3], 110 110 111 112 113 114 111 int (f86[const *]), 112 int (f87[const 3]), 113 int (f88[static 3]), 114 int (f89[static const 3]), 115 115 116 117 118 119 120 116 int *f90[const *], 117 int *f91[const 3], 118 int **f92[static 3], 119 int * const *f93[static const 3], 120 int * const * const f94[static const 3], 121 121 122 123 124 125 126 122 int *(f95[const *]), 123 int *(f96[const 3]), 124 int **(f97[static 3]), 125 int * const *(f98[static const 3]), 126 int * const * const (f99[static const 3]), 127 127 128 129 130 131 128 int f100[const *][3], 129 int f101[const 3][3], 130 int f102[static 3][3], 131 int f103[static const 3][3], 132 132 133 134 135 136 133 int (f104[const *][3]), 134 int (f105[const 3][3]), 135 int (f106[static 3][3]), 136 int (f107[static const 3][3]), 137 137 138 139 140 141 142 138 int *f108[const *][3], 139 int *f109[const 3][3], 140 int **f110[static 3][3], 141 int * const *f111[static const 3][3], 142 int * const * const f112[static const 3][3], 143 143 144 145 146 147 148 149 144 int *(f113[const *][3]), 145 int *(f114[const 3][3]), 146 int **(f115[static 3][3]), 147 int * const *(f116[static const 3][3]), 148 int * const * const (f117[static const 3][3]) 149 ) { 150 150 } 151 152 // Local Variables: // 153 // tab-width: 4 // 154 // End: // -
src/Tests/SynTree/Initialization.c
r44b5ca0 ra65d92e 9 9 10 10 struct { 11 11 [int] w; 12 12 } a = { .w : [2] }; 13 13 … … 15 15 16 16 struct { 17 18 17 int f1, f2, f3; 18 struct { int g1, g2, g3; } f4[4]; 19 19 } v7 = { 20 21 22 23 .g1 : 3,24 g3 : 0,25 26 20 .f1 : 4, 21 f2 : 3, 22 .f4[2] : { 23 .g1 : 3, 24 g3 : 0, 25 }, 26 .f4[3].g3 : 7, 27 27 }; 28 29 // Local Variables: // 30 // tab-width: 4 // 31 // End: // -
src/Tests/SynTree/Scope.c
r44b5ca0 ra65d92e 8 8 9 9 y w(y y, u v) { 10 11 12 10 type x | { x t(u); }; 11 u u = y; 12 x z = t(u); 13 13 } 14 14 … … 17 17 context has_u( type z ) 18 18 { 19 19 z u(z); 20 20 }; 21 21 … … 23 23 y q( t the_t ) 24 24 { 25 25 t y = u( the_t ); 26 26 } 27 27 28 28 t f( y p ) { 29 30 29 int y; 30 typedef char x; 31 31 32 33 34 32 { 33 x y; 34 typedef x z; 35 35 36 37 38 39 40 36 { 37 z x; 38 typedef z y; 39 y z = x; 40 } 41 41 42 43 42 z x = y; 43 } 44 44 45 45 x q = y; 46 46 } 47 47 48 48 t g( void ) { 49 50 51 52 53 54 55 49 typedef char x; 50 try { 51 some_func(); 52 } catch ( x x ) { 53 t y = x; 54 } 55 x z; 56 56 } 57 57 58 y q( i)58 y q( i ) 59 59 int i; 60 60 { 61 switch (i) {62 63 case 0:64 65 default:66 67 61 switch ( i ) { 62 y q = i; 63 case 0: 64 return q; 65 default: 66 return i; 67 } 68 68 } 69 69 70 // Local Variables: // 71 // tab-width: 4 // 72 // End: // -
src/Tests/SynTree/ScopeErrors.c
r44b5ca0 ra65d92e 5 5 float thisIsNotAnError; 6 6 7 int thisIsAlsoNotAnError() 8 { 7 int thisIsAlsoNotAnError() { 9 8 int thisIsNotAnError; 10 9 } 11 10 12 int thisIsAlsoNotAnError( double x ) 13 { 11 int thisIsAlsoNotAnError( double x ) { 14 12 } 15 13 … … 17 15 double thisIsStillNotAnError( double ); 18 16 19 double butThisIsAnError( double ) 20 { 17 double butThisIsAnError( double ) { 21 18 } 22 19 23 double butThisIsAnError( double ) 24 { 20 double butThisIsAnError( double ) { 25 21 } 26 22 23 // Local Variables: // 24 // tab-width: 4 // 25 // End: // -
src/Tests/SynTree/StructMember.c
r44b5ca0 ra65d92e 2 2 3 3 struct S { 4 5 6 7 8 9 10 11 12 13 4 int m1:3, m2:4; 5 int :2; 6 int :3, :4; 7 int m3; 8 int m4, m5, m6; 9 int *m7, *m8, *m9; 10 int (*m10)(); 11 int *(*m11)(int); 12 T T; 13 T (T); 14 14 15 15 // Cforall extensions 16 16 17 18 19 20 21 22 23 24 25 26 17 * int m12, m13; 18 * [ * int ] (int) m14; 19 int ; 20 int , , ; 21 int * , , ; 22 int *, *, *; 23 * int , , ; 24 int (*)(); 25 int (**)( int ); 26 T ; 27 27 28 28 // errors … … 34 34 35 35 union U { 36 37 38 39 36 [5] int m1; 37 int m2[5]; 38 * int m3; 39 int *m4; 40 40 } u; 41 42 // Local Variables: // 43 // tab-width: 4 // 44 // End: // -
src/Tests/SynTree/Tuple.c
r44b5ca0 ra65d92e 4 4 5 5 struct inner { 6 6 int f2, f3; 7 7 }; 8 8 9 9 struct outer { 10 11 12 10 int f1; 11 struct inner i; 12 double f4; 13 13 } s, *sp; 14 14 … … 21 21 22 22 [ short x, unsigned y ] f1( int w ) { 23 23 [ y, x ] = [ x, y ] = [ w, 23 ]; 24 24 } 25 25 26 26 [ [ int, char, long, int ] r ] g1() { 27 28 29 27 short x, p; 28 unsigned int y; 29 [ int, int ] z; 30 30 31 32 31 [ x, y, z ] = [ p, f( 17 ), 3 ]; 32 r = [ x, y, z ]; 33 33 } 34 34 35 35 [ int rc ] main( int argc, ** char argv ) { 36 37 38 39 40 41 42 43 44 45 46 47 36 int a, b, c, d; 37 struct outer t = { .[ f1,f4 ] : [ 1,7.0 ] }; 38 f( [ 3,5 ] ); 39 g( [ 3,5 ], 3 ); 40 f( t1 ); 41 g( t1, 3 ); 42 [ 3,5 ]; 43 [ a,b ] = 3; 44 [ a,b ] = [ 4.6 ]; 45 [ a,b ] = [ c,d ] = [ 3,5 ]; 46 [ a,b,[ c ] ] = [ 2,[ a,b ] ]; 47 [ a,b ] = 3 > 4 ? [ b,6 ] : [ 7,8 ]; 48 48 49 50 51 52 53 54 55 49 t1 = [ a,b ]; 50 t1 = t2 = [ a,b ]; 51 [ a,b ] = [ c,d ] = d += c += 1; 52 [ a,b ] = [ c,d ] = t1; 53 [ a,b ] = t1 = [ c,d ]; 54 [ a,b ] = t1 = t2 = [ c,d ]; 55 t1 = [ 3,4 ] = [ 3,4 ] = t1 = [ 3,4 ]; 56 56 57 58 59 60 61 57 s.[ f1, i.[ f2, f3 ], f4 ] = [ 11, 12, 13, 3.14159 ]; 58 s.[ f1, i.[ f2, f3 ], f4 ] = h( 3, 3, 0, "abc" ); 59 sp->[ f4,f1 ] = sp->[ f1,f4 ]; 60 printf( "expecting 3, 17, 23, 4; got %d, %d, %d, %d\n", s.[ f4, i.[ f3,f2 ], f1 ] ); 61 rc = 0; 62 62 } 63 64 // Local Variables: // 65 // tab-width: 4 // 66 // End: // -
src/Tests/SynTree/TypeGenerator.c
r44b5ca0 ra65d92e 1 1 context addable(type T) { 2 2 T ?+?(T,T); 3 3 }; 4 4 … … 16 16 17 17 int main() { 18 18 (struct(int) node)my_list; 19 19 } 20 21 // Local Variables: // 22 // tab-width: 4 // 23 // End: // -
src/Tests/SynTree/Typedef.c
r44b5ca0 ra65d92e 2 2 3 3 void f( void ) { 4 5 4 int T( T ); 5 T( 3 ); 6 6 } 7 7 8 8 struct { 9 9 T (T); 10 10 } fred = { 3 }; 11 11 … … 14 14 15 15 int g(void) { 16 16 double a; 17 17 } 18 18 a c; … … 27 27 } 28 28 29 / * new-style function definitions */29 // new-style function definitions 30 30 31 31 typedef [10] * int arrayOf10Pointers; … … 40 40 typedef [ * [static 10] int ] t; 41 41 typedef [ * [static 10] int x ] f(); 42 43 // Local Variables: // 44 // tab-width: 4 // 45 // End: // -
src/Tests/SynTree/TypedefDeclarator.c
r44b5ca0 ra65d92e 1 1 typedef int 2 3 4 5 6 7 8 9 10 2 f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, 3 f10, f11, f12, f13, f14, f15, f16, f17, f18, f19, 4 f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, 5 f30, f31, f32, f33, f34, f35, f36, f37, f38, f39, 6 f40, f41, f42, f43, f44, f45, f46, f47, f48, f49, 7 f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, 8 f60, f61, f62, f63, f64, f65, f66, f67, f68, f69, 9 f70, f71, f72, f73, f74, f75, f76, f77, f78, f79, 10 f80, f81, f82, f83, f84, f85, f86, f87, f88, f89; 11 11 12 12 int main() { 13 14 15 16 17 18 19 20 21 13 //int f0[](); 14 //int (f0[])(); 15 //int f0()[]; 16 //int f0()(); 17 //int (*f0)()(); 18 //int ((*f0())())[]; 19 20 int f1; 21 int (f2); 22 22 23 24 25 26 23 int *f3; 24 int **f4; 25 int * const *f5; 26 int * const * const f6; 27 27 28 29 30 31 28 int *(f7); 29 int **(f8); 30 int * const *(f9); 31 int * const * const (f10); 32 32 33 34 35 36 33 int (*f11); 34 int (**f12); 35 int (* const *f13); 36 int (* const * const f14); 37 37 38 39 40 41 38 int f15[]; 39 int f16[10]; 40 int (f17[]); 41 int (f18[10]); 42 42 43 44 45 46 47 48 49 50 43 int *f19[]; 44 int *f20[10]; 45 int **f21[]; 46 int **f22[10]; 47 int * const *f23[]; 48 int * const *f24[10]; 49 int * const * const f25[]; 50 int * const * const f26[10]; 51 51 52 53 54 55 56 57 58 59 52 int *(f27[]); 53 int *(f28[10]); 54 int **(f29[]); 55 int **(f30[10]); 56 int * const *(f31[]); 57 int * const *(f32[10]); 58 int * const * const (f33[]); 59 int * const * const (f34[10]); 60 60 61 62 63 64 65 66 67 68 61 int (*f35[]); 62 int (*f36[10]); 63 int (**f37[]); 64 int (**f38[10]); 65 int (* const *f39[]); 66 int (* const *f40[10]); 67 int (* const * const f41[]); 68 int (* const * const f42[10]); 69 69 70 71 72 73 74 75 70 int f43[][3]; 71 int f44[3][3]; 72 int (f45[])[3]; 73 int (f46[3])[3]; 74 int ((f47[]))[3]; 75 int ((f48[3]))[3]; 76 76 77 78 79 80 81 82 83 84 77 int *f49[][3]; 78 int *f50[3][3]; 79 int **f51[][3]; 80 int **f52[3][3]; 81 int * const *f53[][3]; 82 int * const *f54[3][3]; 83 int * const * const f55[][3]; 84 int * const * const f56[3][3]; 85 85 86 87 88 89 90 91 92 93 86 int (*f57[][3]); 87 int (*f58[3][3]); 88 int (**f59[][3]); 89 int (**f60[3][3]); 90 int (* const *f61[][3]); 91 int (* const *f62[3][3]); 92 int (* const * const f63[][3]); 93 int (* const * const f64[3][3]); 94 94 95 96 95 int f65(int); 96 int (f66)(int); 97 97 98 99 100 101 98 int *f67(int); 99 int **f68(int); 100 int * const *f69(int); 101 int * const * const f70(int); 102 102 103 104 105 106 103 int *(f71)(int); 104 int **(f72)(int); 105 int * const *(f73)(int); 106 int * const * const (f74)(int); 107 107 108 109 110 111 108 int (*f75)(int); 109 int (**f76)(int); 110 int (* const *f77)(int); 111 int (* const * const f78)(int); 112 112 113 114 115 113 int (*(*f79)(int))(); 114 int (*(* const f80)(int))(); 115 int (* const(* const f81)(int))(); 116 116 } 117 118 // Local Variables: // 119 // tab-width: 4 // 120 // End: // -
src/Tests/SynTree/TypedefParamDeclarator.c
r44b5ca0 ra65d92e 1 1 typedef int 2 3 4 5 6 7 8 9 10 11 12 13 2 f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, 3 f10, f11, f12, f13, f14, f15, f16, f17, f18, f19, 4 f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, 5 f30, f31, f32, f33, f34, f35, f36, f37, f38, f39, 6 f40, f41, f42, f43, f44, f45, f46, f47, f48, f49, 7 f50, f51, f52, f53, f54, f55, f56, f57, f58, f59, 8 f60, f61, f62, f63, f64, f65, f66, f67, f68, f69, 9 f70, f71, f72, f73, f74, f75, f76, f77, f78, f79, 10 f80, f81, f82, f83, f84, f85, f86, f87, f88, f89, 11 f90, f91, f92, f93, f94, f95, f96, f97, f98, f99, 12 f100, f101, f102, f103, f104, f105, f106, f107, f108, f109, 13 f110, f111, f112, f113, f114, f115, f116, f117, f118, f119; 14 14 15 15 int fred( 16 16 /* 17 18 19 20 21 22 17 //int f0[](), 18 //int (f0[])(), 19 //int f0()[], 20 //int f0()(), 21 //int (*f0)()(), 22 //int ((*f0())())[], 23 23 */ 24 24 int f1, 25 25 26 27 28 29 26 int *f3, 27 int **f4, 28 int * const *f5, 29 int * const * const f6, 30 30 31 32 33 34 31 int (*f11), 32 int (**f12), 33 int (* const *f13), 34 int (* const * const f14), 35 35 36 37 36 int f15[], 37 int f16[10], 38 38 39 40 41 42 43 44 45 46 39 int *f19[], 40 int *f20[10], 41 int **f21[], 42 int **f22[10], 43 int * const *f23[], 44 int * const *f24[10], 45 int * const * const f25[], 46 int * const * const f26[10], 47 47 48 49 50 51 52 53 54 55 48 int (*f35[]), 49 int (*f36[10]), 50 int (**f37[]), 51 int (**f38[10]), 52 int (* const *f39[]), 53 int (* const *f40[10]), 54 int (* const * const f41[]), 55 int (* const * const f42[10]), 56 56 57 58 57 int f43[][3], 58 int f44[3][3], 59 59 /* 60 61 62 63 60 int (f45[])[3], 61 int (f46[3])[3], 62 int ((f47[]))[3], 63 int ((f48[3]))[3], 64 64 */ 65 66 67 68 69 70 71 72 65 int *f49[][3], 66 int *f50[3][3], 67 int **f51[][3], 68 int **f52[3][3], 69 int * const *f53[][3], 70 int * const *f54[3][3], 71 int * const * const f55[][3], 72 int * const * const f56[3][3], 73 73 74 75 76 77 78 79 80 81 74 int (*f57[][3]), 75 int (*f58[3][3]), 76 int (**f59[][3]), 77 int (**f60[3][3]), 78 int (* const *f61[][3]), 79 int (* const *f62[3][3]), 80 int (* const * const f63[][3]), 81 int (* const * const f64[3][3]), 82 82 83 83 int f65(int), 84 84 /* 85 85 int (f66)(int), 86 86 */ 87 88 89 90 87 int *f67(int), 88 int **f68(int), 89 int * const *f69(int), 90 int * const * const f70(int), 91 91 /* 92 93 94 95 92 int *(f71)(int), 93 int **(f72)(int), 94 int * const *(f73)(int), 95 int * const * const (f74)(int), 96 96 */ 97 98 99 100 97 int (*f75)(int), 98 int (**f76)(int), 99 int (* const *f77)(int), 100 int (* const * const f78)(int), 101 101 102 103 104 102 int (*(*f79)(int))(), 103 int (*(* const f80)(int))(), 104 int (* const(* const f81)(int))(), 105 105 106 107 108 109 106 int f82[const *], 107 int f83[const 3], 108 int f84[static 3], 109 int f85[static const 3], 110 110 111 112 113 114 111 int (f86[const *]), 112 int (f87[const 3]), 113 int (f88[static 3]), 114 int (f89[static const 3]), 115 115 116 117 118 119 120 116 int *f90[const *], 117 int *f91[const 3], 118 int **f92[static 3], 119 int * const *f93[static const 3], 120 int * const * const f94[static const 3], 121 121 122 123 124 125 126 122 int *(f95[const *]), 123 int *(f96[const 3]), 124 int **(f97[static 3]), 125 int * const *(f98[static const 3]), 126 int * const * const (f99[static const 3]), 127 127 128 129 130 131 128 int f100[const *][3], 129 int f101[const 3][3], 130 int f102[static 3][3], 131 int f103[static const 3][3], 132 132 133 134 135 136 133 int (f104[const *][3]), 134 int (f105[const 3][3]), 135 int (f106[static 3][3]), 136 int (f107[static const 3][3]), 137 137 138 139 140 141 142 138 int *f108[const *][3], 139 int *f109[const 3][3], 140 int **f110[static 3][3], 141 int * const *f111[static const 3][3], 142 int * const * const f112[static const 3][3], 143 143 144 145 146 147 148 149 144 int *(f113[const *][3]), 145 int *(f114[const 3][3]), 146 int **(f115[static 3][3]), 147 int * const *(f116[static const 3][3]), 148 int * const * const (f117[static const 3][3]) 149 ) { 150 150 } 151 152 // Local Variables: // 153 // tab-width: 4 // 154 // End: // -
src/Tests/SynTree/VariableDeclarator.c
r44b5ca0 ra65d92e 114 114 115 115 *[]*[]* [ *[]*[] int ]( *[]*[] int, *[]*[] int ) v3; 116 117 // Local Variables: // 118 // tab-width: 4 // 119 // End: // -
src/Tests/gcc/900407-1.c
r44b5ca0 ra65d92e 1 foo (int a, int b, int *p) 2 { 3 int c; 4 p[2] = a + 0x1000; 5 c = b + 0xffff0000; 6 if ((b + 0xffff0000) == 2) 7 c++; 8 p[2] = c; 1 foo ( int a, int b, int *p ) { 2 int c; 3 p[2] = a + 0x1000; 4 c = b + 0xffff0000; 5 if ( (b + 0xffff0000) == 2 ) 6 c++; 7 p[2] = c; 9 8 } 9 10 // Local Variables: // 11 // tab-width: 4 // 12 // End: // -
src/Tests/gcc/900516-1.c
r44b5ca0 ra65d92e 1 /* added 'int' to argument */ 2 f(int c) { return!(c?2.0:1.0); } 1 f( int c ) { return ! ( c ? 2.0 : 1.0 ); } -
src/Tests/gcc/920301-1.c
r44b5ca0 ra65d92e 1 f() { static void*t[];/*={&&x};*/ x:y:;}2 g() { static unsigned p[5];}1 f() { static void*t[]; /*={&&x};*/ x:y: ; } 2 g() { static unsigned p[5]; } -
src/Tests/gcc/920409-1.c
r44b5ca0 ra65d92e 1 x() { int y;y>0.0?y:y-1;}1 x() { int y; y > 0.0 ? y : y - 1; } -
src/Tests/gcc/920409-2.c
r44b5ca0 ra65d92e 1 double x() {int x1,x2;double v; 2 if (((long)(x1-x2))<1)return -1.0;v=t(v);v=y(1,v>0.0?(int)v:((int)v-1));} 1 double x() { 2 int x1, x2; 3 double v; 4 if ( ( (long)(x1-x2) ) < 1 ) 5 return -1.0; 6 v = t( v ); 7 v = y( 1, v > 0.0 ? (int)v : ( (int)v - 1 ) ); 8 } 9 10 // Local Variables: // 11 // tab-width: 4 // 12 // End: // -
src/Tests/gcc/920410-2.c
r44b5ca0 ra65d92e 1 joe() 2 { 3 int j; 1 joe() { 2 int j; 4 3 5 while ( 1 ) 6 { 7 for ( j = 0; j < 4; j++ ) 8 ; 9 for ( j = 0; j < 4; j++ ) 10 ; 11 } 12 } 4 while ( 1 ) { 5 for ( j = 0; j < 4; j++ ); 6 for ( j = 0; j < 4; j++ ); 7 } 8 } 9 10 // Local Variables: // 11 // tab-width: 4 // 12 // End: // -
src/Tests/gcc/920501-1.c
r44b5ca0 ra65d92e 1 a() { int**b[]={&&c};c:;}1 a() { int **b[] = { &&c }; c: ; } -
src/Tests/gcc/920501-11.c
r44b5ca0 ra65d92e 1 typedef struct{int s;}S;foo() {int i=(int)&(S) {(void*)((int)&(S) {1})};} 1 typedef struct{ int s; } S; 2 foo() { 3 int i = (int)&(S){ (void*)((int)&(S) {1}) }; 4 } 5 6 // Local Variables: // 7 // tab-width: 4 // 8 // End: // -
src/Tests/gcc/920501-19.c
r44b5ca0 ra65d92e 1 long long x =0;y() {x=0;}1 long long x = 0; y() { x = 0; }
Note: See TracChangeset
for help on using the changeset viewer.