Changeset 10dc7491
- Timestamp:
- Jun 22, 2016, 4:35:32 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:
- 8b52686
- Parents:
- 6bc4734
- Location:
- src/tests
- Files:
-
- 4 added
- 10 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
src/tests/Enum.c
r6bc4734 r10dc7491 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/GccExtensions.c
r6bc4734 r10dc7491 1 int main(int argc, char const *argv[]) 2 3 4 1 int main(int argc, char const *argv[]) { 2 asm( "nop" ); 3 __asm( "nop" ); 4 __asm__( "nop" ); 5 5 6 7 6 __complex__ c1; 7 _Complex c2; 8 8 9 10 11 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 19 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 25 32 __volatile int v1; 33 __volatile__ int v2; 26 34 27 28 29 30 31 32 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 35 36 // 37 // 42 int * __attribute(()) p1; 43 int (* __attribute(()) p2); 44 // int (__attribute(()) (p3)); 45 // int ( __attribute(()) (* __attribute(()) p4)); 38 46 39 40 41 42 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 45 46 47 // 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
r6bc4734 r10dc7491 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
r6bc4734 r10dc7491 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
r6bc4734 r10dc7491 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/NumericConstants.c
r6bc4734 r10dc7491 1 1 int main() { 2 1; /* decimal */ 3 4 5 6 7 8 9 10 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 14 15 12 // 0; // octal 13 0u; 14 0_3_77; 15 0_377_ul; 16 16 17 0x1; /* hexadecimal */ 18 19 20 21 22 23 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 27 25 3.; // integral real 26 3_100.; 27 1_000_000.; 28 28 29 3.1; /* integral/fractional real */ 30 31 29 3.1; // integral/fractional real 30 3.141_592_654L; 31 123_456.123_456; 32 32 33 3E1; /* integral/exponent real */ 34 35 36 37 38 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 42 43 44 45 46 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 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
r6bc4734 r10dc7491 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/Scope.c
r6bc4734 r10dc7491 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 … … 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
r6bc4734 r10dc7491 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 main17 12 int main(int argc, char const *argv[]) 18 13 { -
src/tests/StructMember.c
r6bc4734 r10dc7491 10 10 int (*m10)(); 11 11 int *(*m11)(int); 12 T T;13 12 T (T); 14 13
Note: See TracChangeset
for help on using the changeset viewer.