Changes in / [8b52686:b015035]
- Location:
- src/tests
- Files:
-
- 1 added
- 5 deleted
- 10 edited
-
.expect/GccExtensions.txt (deleted)
-
.expect/IdentFuncDeclarator.txt (deleted)
-
.expect/IdentFuncParamDeclarator.txt (deleted)
-
.expect/LabelledExit.txt (deleted)
-
Enum.c (modified) (3 diffs)
-
Function.c (added)
-
GccExtensions.c (modified) (1 diff)
-
IdentFuncDeclarator.c (modified) (2 diffs)
-
IdentFuncParamDeclarator.c (modified) (2 diffs)
-
LabelledExit.c (modified) (2 diffs)
-
NumericConstants.c (modified) (1 diff)
-
OccursError.c (modified) (1 diff)
-
Scope.c (modified) (2 diffs)
-
ShortCircuit.c (modified) (2 diffs)
-
StructMember.c (modified) (1 diff)
-
Tuples.c (deleted)
Legend:
- Unmodified
- Added
- Removed
-
src/tests/Enum.c
r8b52686 rb015035 1 1 //Testing enum declaration 2 enum Colo urs {2 enum Colors { 3 3 Red, 4 4 Yellow, … … 10 10 }; 11 11 12 enum Colours c1;13 Colours c2;14 15 12 void f( void ) { 16 13 enum Fruits { … … 20 17 Mango 21 18 } fruit = Mango; 22 enum Fruits f1;23 Fruits f2;24 19 } 25 20 26 21 //Dummy main 27 int main(int argc, char const *argv[]) { 22 int main(int argc, char const *argv[]) 23 { 24 return 0; 28 25 } -
src/tests/GccExtensions.c
r8b52686 rb015035 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; 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 ); 13 __extension__ const int ex; 22 14 23 __inline int f1() {} 24 __inline__ int f2() {} 15 __inline int f1(); 16 __inline__ int f2(); 25 17 26 __signed s1;27 __signed s2;18 __signed s1; 19 __signed s2; 28 20 29 __typeof(s1) t1;30 __typeof__(s1) t2;21 __otypeof(s1) t1; 22 __otypeof__(s1) t2; 31 23 32 __volatile int v1;33 __volatile__ int v2;24 __volatile int v1; 25 __volatile__ int v2; 34 26 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;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; 41 33 42 int * __attribute(()) p1;43 int (* __attribute(()) p2);44 // int (__attribute(()) (p3));45 // int ( __attribute(()) (* __attribute(()) p4));34 int * __attribute(()) p1; 35 int (* __attribute(()) p2); 36 // int (__attribute(()) (p3)); 37 // int ( __attribute(()) (* __attribute(()) p4)); 46 38 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(());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(()); 51 43 52 int m1 [10] __attribute(());53 int m2 [10][10] __attribute(());54 int __attribute(()) m3 [10][10];55 // int ( __attribute(()) m4 [10] )[10];44 int m1 [10] __attribute(()); 45 int m2 [10][10] __attribute(()); 46 int __attribute(()) m3 [10][10]; 47 // int ( __attribute(()) m4 [10] )[10]; 56 48 57 49 return 0; -
src/tests/IdentFuncDeclarator.c
r8b52686 rb015035 1 1 int main() { 2 //int f0[](); 3 //int (f0[])(); 4 //int f0()[]; 5 //int f0()(); 6 //int (*f0)()(); 7 //int ((*f0())())[]; 8 2 9 int f1; 3 10 int (f2); … … 18 25 int (* const * const f14); 19 26 20 int f15[ 2];27 int f15[]; 21 28 int f16[10]; 22 int (f17[ 2]);29 int (f17[]); 23 30 int (f18[10]); 24 31 25 int *f19[ 2];32 int *f19[]; 26 33 int *f20[10]; 27 int **f21[ 2];34 int **f21[]; 28 35 int **f22[10]; 29 int * const *f23[ 2];36 int * const *f23[]; 30 37 int * const *f24[10]; 31 int * const * const f25[ 2];38 int * const * const f25[]; 32 39 int * const * const f26[10]; 33 40 34 int *(f27[ 2]);41 int *(f27[]); 35 42 int *(f28[10]); 36 int **(f29[ 2]);43 int **(f29[]); 37 44 int **(f30[10]); 38 int * const *(f31[ 2]);45 int * const *(f31[]); 39 46 int * const *(f32[10]); 40 int * const * const (f33[ 2]);47 int * const * const (f33[]); 41 48 int * const * const (f34[10]); 42 49 43 int (*f35[ 2]);50 int (*f35[]); 44 51 int (*f36[10]); 45 int (**f37[ 2]);52 int (**f37[]); 46 53 int (**f38[10]); 47 int (* const *f39[ 2]);54 int (* const *f39[]); 48 55 int (* const *f40[10]); 49 int (* const * const f41[ 2]);56 int (* const * const f41[]); 50 57 int (* const * const f42[10]); 51 58 52 int f43[ 2][3];59 int f43[][3]; 53 60 int f44[3][3]; 54 int (f45[ 2])[3];61 int (f45[])[3]; 55 62 int (f46[3])[3]; 56 int ((f47[ 2]))[3];63 int ((f47[]))[3]; 57 64 int ((f48[3]))[3]; 58 65 59 int *f49[ 2][3];66 int *f49[][3]; 60 67 int *f50[3][3]; 61 int **f51[ 2][3];68 int **f51[][3]; 62 69 int **f52[3][3]; 63 int * const *f53[ 2][3];70 int * const *f53[][3]; 64 71 int * const *f54[3][3]; 65 int * const * const f55[ 2][3];72 int * const * const f55[][3]; 66 73 int * const * const f56[3][3]; 67 74 68 int (*f57[ 2][3]);75 int (*f57[][3]); 69 76 int (*f58[3][3]); 70 int (**f59[ 2][3]);77 int (**f59[][3]); 71 78 int (**f60[3][3]); 72 int (* const *f61[ 2][3]);79 int (* const *f61[][3]); 73 80 int (* const *f62[3][3]); 74 int (* const * const f63[ 2][3]);81 int (* const * const f63[][3]); 75 82 int (* const * const f64[3][3]); 76 83 -
src/tests/IdentFuncParamDeclarator.c
r8b52686 rb015035 1 1 int fred( 2 //int f0[](), 3 //int (f0[])(), 4 //int f0()[], 5 //int f0()(), 6 //int (*f0)()(), 7 //int ((*f0())())[], 8 2 9 int f1, 3 10 int (f2), … … 140 147 int * const *(f116[static const 3][3]), 141 148 int * const * const (f117[static const 3][3]) 142 ); 149 ) { 150 } 143 151 144 152 //Dummy main -
src/tests/LabelledExit.c
r8b52686 rb015035 1 int foo() {1 int main() { 2 2 int i; 3 3 int x, y; … … 130 130 } 131 131 132 #if 1132 #if 0 133 133 Q: if ( i > 5 ) { 134 134 i += 1; -
src/tests/NumericConstants.c
r8b52686 rb015035 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; // octal13 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
r8b52686 rb015035 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 ); 1 forall( otype T ) void f( void (*)( T, T* ) ); 2 forall( otype U ) void g( U*, U ); 4 3 5 4 void test() { 6 f( h );7 5 f( g ); 8 6 } -
src/tests/Scope.c
r8b52686 rb015035 3 3 typedef float t; 4 4 y z; 5 //otype u = struct { int a; double b; }; 6 typedef struct { int a; double b; } u; 5 otype u = struct { int a; double b; }; 7 6 int f( int y ); 8 7 y q; 9 struct x { int x; };10 8 11 9 y w( y y, u v ) { 12 // otype x | { x t(u); }; 13 void ?{}(struct x *); 14 void ^?{}(struct x *); 15 extern struct x t( u ); 10 otype x | { x t(u); }; 16 11 u u = y; 17 structx z = t(u);12 x z = t(u); 18 13 } 19 14 … … 45 40 } 46 41 47 void some_func() {}48 49 42 t g( void ) { 50 43 typedef char x; 51 //try {44 try { 52 45 some_func(); 53 //} catch ( x x ) {54 //t y = x;55 //}46 } catch ( x x ) { 47 t y = x; 48 } 56 49 x z; 57 50 } -
src/tests/ShortCircuit.c
r8b52686 rb015035 1 void g( float f ) {} 2 void g( int i ) {} 1 int ?!=?( int, int ); 2 int ?!=?( float, float ); 3 int 0; 4 5 void g( float ); 6 void g( int ); 3 7 4 8 void f( int a ) { … … 10 14 } 11 15 16 //Dummy main 12 17 int main(int argc, char const *argv[]) 13 18 { -
src/tests/StructMember.c
r8b52686 rb015035 10 10 int (*m10)(); 11 11 int *(*m11)(int); 12 T T; 12 13 T (T); 13 14
Note:
See TracChangeset
for help on using the changeset viewer.