Changes in / [8b52686:b015035]


Ignore:
Location:
src/tests
Files:
1 added
5 deleted
10 edited

Legend:

Unmodified
Added
Removed
  • src/tests/Enum.c

    r8b52686 rb015035  
    11//Testing enum declaration
    2 enum Colours {
     2enum Colors {
    33        Red,
    44        Yellow,
     
    1010};
    1111
    12 enum Colours c1;
    13 Colours c2;
    14 
    1512void f( void ) {
    1613        enum Fruits {
     
    2017                Mango
    2118        } fruit = Mango;
    22         enum Fruits f1;
    23         Fruits f2;
    2419}
    2520
    2621//Dummy main
    27 int main(int argc, char const *argv[]) {
     22int main(int argc, char const *argv[])
     23{
     24        return 0;
    2825}
  • src/tests/GccExtensions.c

    r8b52686 rb015035  
    1 int main(int argc, char const *argv[]) {
    2         asm( "nop" );
    3         __asm( "nop" );
    4         __asm__( "nop" );
     1int main(int argc, char const *argv[])
     2    asm( "nop" );
     3    __asm( "nop" );
     4    __asm__( "nop" );
    55
    6         __complex__ c1;
    7         _Complex c2;
     6    __complex__ c1;
     7    _Complex c2;
    88
    9         const int i1;
    10         __const int i2;
    11         __const__ int i3;
     9    const int i1;
     10    __const int i2;
     11    __const__ int i3;
    1212
    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;
    2214
    23         __inline int f1() {}
    24         __inline__ int f2() {}
     15    __inline int f1();
     16    __inline__ int f2();
    2517
    26         __signed s1;
    27         __signed s2;
     18    __signed s1;
     19    __signed s2;
    2820
    29         __typeof(s1) t1;
    30         __typeof__(s1) t2;
     21    __otypeof(s1) t1;
     22    __otypeof__(s1) t2;
    3123
    32         __volatile int v1;
    33         __volatile__ int v2;
     24    __volatile int v1;
     25    __volatile__ int v2;
    3426
    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;
    4133
    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));
    4638
    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(());
    5143
    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];
    5648
    5749        return 0;
  • src/tests/IdentFuncDeclarator.c

    r8b52686 rb015035  
    11int main() {
     2        //int f0[]();
     3        //int (f0[])();
     4        //int f0()[];
     5        //int f0()();
     6        //int (*f0)()();
     7        //int ((*f0())())[];
     8
    29        int f1;
    310        int (f2);
     
    1825        int (* const * const f14);
    1926
    20         int f15[2];
     27        int f15[];
    2128        int f16[10];
    22         int (f17[2]);
     29        int (f17[]);
    2330        int (f18[10]);
    2431
    25         int *f19[2];
     32        int *f19[];
    2633        int *f20[10];
    27         int **f21[2];
     34        int **f21[];
    2835        int **f22[10];
    29         int * const *f23[2];
     36        int * const *f23[];
    3037        int * const *f24[10];
    31         int * const * const f25[2];
     38        int * const * const f25[];
    3239        int * const * const f26[10];
    3340
    34         int *(f27[2]);
     41        int *(f27[]);
    3542        int *(f28[10]);
    36         int **(f29[2]);
     43        int **(f29[]);
    3744        int **(f30[10]);
    38         int * const *(f31[2]);
     45        int * const *(f31[]);
    3946        int * const *(f32[10]);
    40         int * const * const (f33[2]);
     47        int * const * const (f33[]);
    4148        int * const * const (f34[10]);
    4249
    43         int (*f35[2]);
     50        int (*f35[]);
    4451        int (*f36[10]);
    45         int (**f37[2]);
     52        int (**f37[]);
    4653        int (**f38[10]);
    47         int (* const *f39[2]);
     54        int (* const *f39[]);
    4855        int (* const *f40[10]);
    49         int (* const * const f41[2]);
     56        int (* const * const f41[]);
    5057        int (* const * const f42[10]);
    5158
    52         int f43[2][3];
     59        int f43[][3];
    5360        int f44[3][3];
    54         int (f45[2])[3];
     61        int (f45[])[3];
    5562        int (f46[3])[3];
    56         int ((f47[2]))[3];
     63        int ((f47[]))[3];
    5764        int ((f48[3]))[3];
    5865
    59         int *f49[2][3];
     66        int *f49[][3];
    6067        int *f50[3][3];
    61         int **f51[2][3];
     68        int **f51[][3];
    6269        int **f52[3][3];
    63         int * const *f53[2][3];
     70        int * const *f53[][3];
    6471        int * const *f54[3][3];
    65         int * const * const f55[2][3];
     72        int * const * const f55[][3];
    6673        int * const * const f56[3][3];
    6774
    68         int (*f57[2][3]);
     75        int (*f57[][3]);
    6976        int (*f58[3][3]);
    70         int (**f59[2][3]);
     77        int (**f59[][3]);
    7178        int (**f60[3][3]);
    72         int (* const *f61[2][3]);
     79        int (* const *f61[][3]);
    7380        int (* const *f62[3][3]);
    74         int (* const * const f63[2][3]);
     81        int (* const * const f63[][3]);
    7582        int (* const * const f64[3][3]);
    7683
  • src/tests/IdentFuncParamDeclarator.c

    r8b52686 rb015035  
    11int fred(
     2        //int f0[](),
     3        //int (f0[])(),
     4        //int f0()[],
     5        //int f0()(),
     6        //int (*f0)()(),
     7        //int ((*f0())())[],
     8
    29        int f1,
    310        int (f2),
     
    140147        int * const *(f116[static const 3][3]),
    141148        int * const * const (f117[static const 3][3])
    142     );
     149        ) {
     150}
    143151
    144152//Dummy main
  • src/tests/LabelledExit.c

    r8b52686 rb015035  
    1 int foo() {
     1int main() {
    22        int i;
    33        int x, y;
     
    130130        }
    131131
    132 #if 1
     132#if 0
    133133  Q: if ( i > 5 ) {
    134134                i += 1;
  • src/tests/NumericConstants.c

    r8b52686 rb015035  
    11int 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;
    1111
    12 //      0;                                                      // octal
    13         0u;
    14         0_3_77;
    15         0_377_ul;
     12//    0;                                                        /* octal */
     13    0u;
     14    0_3_77;
     15    0_377_ul;
    1616
    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;
    2424
    25         3.;                                                     // integral real
    26         3_100.;
    27         1_000_000.;
     25    3.;                                                 /* integral real */
     26    3_100.;
     27    1_000_000.;
    2828
    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;
    3232
    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;
    3939
    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;
    4747
    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;
    5050}
     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 );
     1forall( otype T ) void f( void (*)( T, T* ) );
     2forall( otype U ) void g( U*, U );
    43
    54void test() {
    6     f( h );
    75    f( g );
    86}
  • src/tests/Scope.c

    r8b52686 rb015035  
    33typedef float t;
    44y z;
    5 //otype u = struct { int a; double b; };
    6 typedef struct { int a; double b; } u;
     5otype u = struct { int a; double b; };
    76int f( int y );
    87y q;
    9 struct x { int x; };
    108
    119y 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); };
    1611        u u = y;
    17         struct x z = t(u);
     12        x z = t(u);
    1813}
    1914
     
    4540}
    4641
    47 void some_func() {}
    48 
    4942t g( void ) {
    5043        typedef char x;
    51 //      try {
     44        try {
    5245                some_func();
    53 //      } catch ( x x ) {
    54 //              t y = x;
    55 //      }
     46        } catch ( x x ) {
     47                t y = x;
     48        }
    5649        x z;
    5750}
  • src/tests/ShortCircuit.c

    r8b52686 rb015035  
    1 void g( float f ) {}
    2 void g( int i ) {}
     1int ?!=?( int, int );
     2int ?!=?( float, float );
     3int 0;
     4
     5void g( float );
     6void g( int );
    37
    48void f( int a ) {
     
    1014}
    1115
     16//Dummy main
    1217int main(int argc, char const *argv[])
    1318{
  • src/tests/StructMember.c

    r8b52686 rb015035  
    1010        int (*m10)();
    1111        int *(*m11)(int);
     12        T T;
    1213        T (T);
    1314
Note: See TracChangeset for help on using the changeset viewer.