Changeset 933f32f for tests


Ignore:
Timestamp:
May 24, 2019, 10:19:41 AM (6 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
d908563
Parents:
6a9d4b4 (diff), 292642a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into cleanup-dtors

Location:
tests
Files:
9 added
6 deleted
67 edited

Legend:

Unmodified
Added
Removed
  • tests/.expect/KRfunctions.x64.txt

    r6a9d4b4 r933f32f  
    6262    __attribute__ ((unused)) signed int _X10_retval_f5i_1;
    6363}
    64 signed int (*_X2f6FFi_i__iPiPi__1(signed int _X1ai_1, signed int *_X1bPi_1, signed int *_X1cPi_1))(signed int __anonymous_object0){
     64signed int (*_X2f6FFi_i__iPiPi__1(signed int _X1ai_1, signed int *_X1bPi_1, signed int *_X1cPi_1))(__attribute__ ((unused)) signed int __anonymous_object0){
    6565    __attribute__ ((unused)) signed int (*_X10_retval_f6Fi_i__1)(signed int __anonymous_object1);
    6666}
     
    104104    signed int _X1bi_2;
    105105    {
    106         signed int *(*_tmp_cp_ret2)(signed int _X1xi_1, signed int _X1yi_1);
    107         void __cleanup_dtor4(signed int *(**_dst)(signed int _X1xi_1, signed int _X1yi_1)){
    108             ((void)((*_dst)) /* ^?{} */);
    109         }
    110         __attribute__ ((cleanup(__destroy_Destructor))) struct __Destructor _ret_dtor4 = { 0, ((void (*)(void *__anonymous_object6))__cleanup_dtor4) };
    111         void **_dtype_static_member_4 = ((void **)(&_ret_dtor4._X6objectPY12__T_generic__1));
    112         ((void)(_X1xFPi_ii__2=(((void)(((void)(_tmp_cp_ret2=_X3f10FFPi_ii__iPiPid__1(3, (&_X1ai_2), (&_X1bi_2), 3.5))) , ((*_dtype_static_member_4)=((void *)(&_tmp_cp_ret2))))) , _tmp_cp_ret2)));
     106        signed int *(*_tmp_cp_ret4)(signed int _X1xi_1, signed int _X1yi_1);
     107        ((void)(_X1xFPi_ii__2=(((void)(_tmp_cp_ret4=_X3f10FFPi_ii__iPiPid__1(3, (&_X1ai_2), (&_X1bi_2), 3.5))) , _tmp_cp_ret4)));
    113108    }
    114109
  • tests/.expect/KRfunctions.x86.txt

    r6a9d4b4 r933f32f  
    6262    __attribute__ ((unused)) signed int _X10_retval_f5i_1;
    6363}
    64 signed int (*_X2f6FFi_i__iPiPi__1(signed int _X1ai_1, signed int *_X1bPi_1, signed int *_X1cPi_1))(signed int __anonymous_object0){
     64signed int (*_X2f6FFi_i__iPiPi__1(signed int _X1ai_1, signed int *_X1bPi_1, signed int *_X1cPi_1))(__attribute__ ((unused)) signed int __anonymous_object0){
    6565    __attribute__ ((unused)) signed int (*_X10_retval_f6Fi_i__1)(signed int __anonymous_object1);
    6666}
     
    104104    signed int _X1bi_2;
    105105    {
    106         signed int *(*_tmp_cp_ret2)(signed int _X1xi_1, signed int _X1yi_1);
    107         void __cleanup_dtor4(signed int *(**_dst)(signed int _X1xi_1, signed int _X1yi_1)){
    108             ((void)((*_dst)) /* ^?{} */);
    109         }
    110         __attribute__ ((cleanup(__destroy_Destructor))) struct __Destructor _ret_dtor4 = { 0, ((void (*)(void *__anonymous_object6))__cleanup_dtor4) };
    111         void **_dtype_static_member_4 = ((void **)(&_ret_dtor4._X6objectPY12__T_generic__1));
    112         ((void)(_X1xFPi_ii__2=(((void)(((void)(_tmp_cp_ret2=_X3f10FFPi_ii__iPiPid__1(3, (&_X1ai_2), (&_X1bi_2), 3.5))) , ((*_dtype_static_member_4)=((void *)(&_tmp_cp_ret2))))) , _tmp_cp_ret2)));
     106        signed int *(*_tmp_cp_ret4)(signed int _X1xi_1, signed int _X1yi_1);
     107        ((void)(_X1xFPi_ii__2=(((void)(_tmp_cp_ret4=_X3f10FFPi_ii__iPiPid__1(3, (&_X1ai_2), (&_X1bi_2), 3.5))) , _tmp_cp_ret4)));
    113108    }
    114109
  • tests/.expect/abs.txt

    r6a9d4b4 r933f32f  
    33signed long int         -65     abs 65
    44signed long long int    -65     abs 65
    5 float                   -65     abs 65
    6 double                  -65     abs 65
    7 long double             -65     abs 65
    8 float _Complex          -65-2i  abs 65.0308
    9 double _Complex         -65-2i  abs 65.0307619515564
    10 long double _Complex    -65-2i  abs 65.0307619515564342
     5float                   -65.    abs 65.
     6double                  -65.    abs 65.
     7long double             -65.    abs 65.
     8float _Complex          -65.-2.i        abs 65.0308
     9double _Complex         -65.-2.i        abs 65.0307619515564
     10long double _Complex    -65.-2.i        abs 65.0307619515564342
  • tests/.expect/ato.txt

    r6a9d4b4 r933f32f  
    2222-123.456789012345679 -123.45678901234567890123456789
    2323-123.456-123.456i -123.456-123.456i
    24 0+0i 2  3
     240.+0.i 2  3
    2525-123.456789012346+123.456789012346i -123.4567890123456+123.4567890123456i
    2626123.456789012345679-123.456789012345679i 123.45678901234567890123456789-123.45678901234567890123456789i
  • tests/.expect/attributes.x64.txt

    r6a9d4b4 r933f32f  
    640640}
    641641__attribute__ ((unused,used,unused)) signed int (*_X2f4FFi_i____1())(signed int __anonymous_object1);
    642 __attribute__ ((unused,unused)) signed int (*_X2f4FFi_i____1())(signed int __anonymous_object2){
     642__attribute__ ((unused,unused)) signed int (*_X2f4FFi_i____1())(__attribute__ ((unused)) signed int __anonymous_object2){
    643643    __attribute__ ((unused)) signed int (*_X10_retval_f4Fi_i__1)(signed int __anonymous_object3);
    644644}
  • tests/.expect/attributes.x86.txt

    r6a9d4b4 r933f32f  
    640640}
    641641__attribute__ ((unused,used,unused)) signed int (*_X2f4FFi_i____1())(signed int __anonymous_object1);
    642 __attribute__ ((unused,unused)) signed int (*_X2f4FFi_i____1())(signed int __anonymous_object2){
     642__attribute__ ((unused,unused)) signed int (*_X2f4FFi_i____1())(__attribute__ ((unused)) signed int __anonymous_object2){
    643643    __attribute__ ((unused)) signed int (*_X10_retval_f4Fi_i__1)(signed int __anonymous_object3);
    644644}
  • tests/.expect/castError.txt

    r6a9d4b4 r933f32f  
    1 castError.cfa:7:1 error: Cannot choose between 3 alternatives for expression
    2 Cast of:
     1castError.cfa:21:1 error: Cannot choose between 3 alternatives for expression
     2Explicit Cast of:
    33  Name: f
    44... to:
    55  char Alternatives are:
    6 Cost ( 1, 0, 0, 0, 0, 0 ): Cast of:
     6Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
    77     Variable Expression: f: function
    88       accepting unspecified arguments
     
    1616 Environment:
    1717
    18 Cost ( 1, 0, 0, 0, 0, 0 ): Cast of:
     18Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
    1919     Variable Expression: f: double
    2020   ... to:
     
    2525 Environment:
    2626
    27 Cost ( 1, 0, 0, 0, 0, 0 ): Cast of:
     27Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of:
    2828     Variable Expression: f: signed int
    2929   ... to:
     
    3535
    3636
     37castError.cfa:26:1 error: Cannot choose between 2 alternatives for expression
     38Generated Cast of:
     39  Comma Expression:
     40    constant expression (3 3: signed int)
     41    Name: v
     42... to: nothing Alternatives are:
     43Cost ( 0, 0, 2, 0, 0, 0, 0 ): Generated Cast of:
     44     Comma Expression:
     45       constant expression (3 3: signed int)
     46       Variable Expression: v: unsigned char
     47   ... to: nothing
     48 (types:
     49   void
     50 )
     51 Environment:
     52
     53Cost ( 0, 0, 2, 0, 0, 0, 0 ): Generated Cast of:
     54     Comma Expression:
     55       constant expression (3 3: signed int)
     56       Variable Expression: v: signed short int
     57   ... to: nothing
     58 (types:
     59   void
     60 )
     61 Environment:
     62
     63
  • tests/.expect/completeTypeError.txt

    r6a9d4b4 r933f32f  
    1 completeTypeError.cfa:33:1 error: No reasonable alternatives for expression Applying untyped:
    2   Name: *?
    3 ...to:
    4   Name: v
     1completeTypeError.cfa:34:1 error: Cannot choose between 2 alternatives for expression
     2Generated Cast of:
     3  Applying untyped:
     4    Name: *?
     5  ...to:
     6    Name: x
    57
    6 completeTypeError.cfa:34:1 error: No reasonable alternatives for expression Applying untyped:
    7   Name: *?
    8 ...to:
    9   Name: y
     8... to: nothing Alternatives are:
     9Cost ( 0, 1, 2, 0, 1, -1, 0 ): Generated Cast of:
     10     Application of
     11       Variable Expression: *?: forall
     12         DT: object type
     13         function
     14       ... with parameters
     15         intrinsic pointer to instance of type DT (not function type)
     16       ... returning
     17         _retval__operator_deref: reference to instance of type DT (not function type)
     18         ... with attributes:
     19           Attribute with name: unused
     20
     21
     22     ... to arguments
     23       Variable Expression: x: pointer to instance of struct A with body 0
     24
     25   ... to: nothing
     26 (types:
     27   void
     28 )
     29 Environment:( _80_4_DT ) -> instance of struct A with body 0 (no widening)
     30
     31
     32Cost ( 0, 1, 2, 0, 1, -1, 0 ): Generated Cast of:
     33     Application of
     34       Variable Expression: *?: forall
     35         DT: object type
     36         function
     37       ... with parameters
     38         intrinsic pointer to instance of type DT (not function type)
     39       ... returning
     40         _retval__operator_deref: reference to instance of type DT (not function type)
     41         ... with attributes:
     42           Attribute with name: unused
     43
     44
     45     ... to arguments
     46       Variable Expression: x: pointer to instance of struct B with body 1
     47
     48   ... to: nothing
     49 (types:
     50   void
     51 )
     52 Environment:( _80_4_DT ) -> instance of struct B with body 1 (no widening)
     53
     54
    1055
    1156completeTypeError.cfa:35:1 error: No reasonable alternatives for expression Applying untyped:
     
    2469  Name: v
    2570
    26 completeTypeError.cfa:58:1 error: No reasonable alternatives for expression Applying untyped:
     71completeTypeError.cfa:59:1 error: No reasonable alternatives for expression Applying untyped:
    2772  Name: baz
    2873...to:
    2974  Name: y
    3075
    31 completeTypeError.cfa:59:1 error: No reasonable alternatives for expression Applying untyped:
     76completeTypeError.cfa:60:1 error: No reasonable alternatives for expression Applying untyped:
    3277  Name: quux
    3378...to:
    3479  Name: y
    3580
    36 completeTypeError.cfa:60:1 error: No reasonable alternatives for expression Applying untyped:
    37   Name: *?
    38 ...to:
    39   Name: y
    40 
    41 completeTypeError.cfa:72:1 error: No resolvable alternatives for expression Applying untyped:
     81completeTypeError.cfa:72:1 error: No alternatives with satisfiable assertions for Applying untyped:
    4282  Name: baz
    4383...to:
    4484  Name: z
    4585
    46 Alternatives with failing assertions are:
    47 Cost ( 0, 1, 0, 1, -5, 0 ): Application of
    48      Variable Expression: baz: forall
    49        T: sized object type
    50        ... with assertions
    51          ?=?: pointer to function
    52          ... with parameters
    53            reference to instance of type T (not function type)
    54            instance of type T (not function type)
    55          ... returning
    56            _retval__operator_assign: instance of type T (not function type)
    57            ... with attributes:
    58              Attribute with name: unused
     86   Unsatisfiable alternative:
     87Cost ( 0, 1, 0, 0, 1, -5, 0 ): Application of
     88         Variable Expression: baz: forall
     89           T: sized object type
     90           ... with assertions
     91             ?=?: pointer to function
     92             ... with parameters
     93               reference to instance of type T (not function type)
     94               instance of type T (not function type)
     95             ... returning
     96               _retval__operator_assign: instance of type T (not function type)
     97               ... with attributes:
     98                 Attribute with name: unused
    5999
    60100
    61          ?{}: pointer to function
     101             ?{}: pointer to function
     102             ... with parameters
     103               reference to instance of type T (not function type)
     104             ... returning nothing
     105
     106             ?{}: pointer to function
     107             ... with parameters
     108               reference to instance of type T (not function type)
     109               instance of type T (not function type)
     110             ... returning nothing
     111
     112             ^?{}: pointer to function
     113             ... with parameters
     114               reference to instance of type T (not function type)
     115             ... returning nothing
     116
     117
     118           function
    62119         ... with parameters
    63            reference to instance of type T (not function type)
     120           pointer to instance of type T (not function type)
    64121         ... returning nothing
    65122
    66          ?{}: pointer to function
    67          ... with parameters
    68            reference to instance of type T (not function type)
    69            instance of type T (not function type)
    70          ... returning nothing
     123       ... to arguments
     124         Variable Expression: z: pointer to instance of type T (not function type)
    71125
    72          ^?{}: pointer to function
    73          ... with parameters
    74            reference to instance of type T (not function type)
    75          ... returning nothing
     126     (types:
     127       void
     128     )
     129     Environment:( _99_0_T ) -> instance of type T (not function type) (no widening)
     130
     131   Could not satisfy assertion:
     132?=?: pointer to function
     133     ... with parameters
     134       reference to instance of type _99_0_T (not function type)
     135       instance of type _99_0_T (not function type)
     136     ... returning
     137       _retval__operator_assign: instance of type _99_0_T (not function type)
     138       ... with attributes:
     139         Attribute with name: unused
    76140
    77141
    78        function
    79      ... with parameters
    80        pointer to instance of type T (not function type)
    81      ... returning nothing
    82 
    83    ... to arguments
    84      Variable Expression: z: pointer to instance of type T (not function type)
    85 
    86  (types:
    87    void
    88  )
    89  Environment:( _73_0_T ) -> instance of type T (not function type) (no widening)
    90 
    91 
    92 
  • tests/.expect/complex.txt

    r6a9d4b4 r933f32f  
    11x:3+2i y:4+5i z:7+7i
    2 x:3+2i y:4+5i z:7+7i
     2x:3.+2.i y:4.+5.i z:7.+7.i
    33x:2.1+1.3i y:3.2+4.5i z:5.3+5.8i
    44x:2.1+1.3i y:3.2+4.5i z:5.3+5.8i
  • tests/.expect/declarationSpecifier.x64.txt

    r6a9d4b4 r933f32f  
    11221122    __attribute__ ((unused)) signed int _X12_retval_maini_1;
    11231123    {
    1124         ((void)(_X12_retval_maini_1=((signed int )0)) /* ?{} */);
    1125     }
    1126 
    1127     return _X12_retval_maini_1;
    1128     {
    11291124        ((void)(_X12_retval_maini_1=0) /* ?{} */);
    11301125    }
     
    11371132    __attribute__ ((unused)) signed int _X12_retval_maini_1;
    11381133    {
    1139         signed int _tmp_cp_ret2;
    1140         __attribute__ ((cleanup(__destroy_Destructor))) struct __Destructor _ret_dtor4 = { 0, ((void (*)(void *__anonymous_object0))_X11_destructorFv_i_intrinsic___1) };
    1141         void **_dtype_static_member_4 = ((void **)(&_ret_dtor4._X6objectPY12__T_generic__1));
    1142         ((void)(_X12_retval_maini_1=(((void)(((void)(_tmp_cp_ret2=invoke_main(_X4argci_1, _X4argvPPc_1, _X4envpPPc_1))) , ((*_dtype_static_member_4)=((void *)(&_tmp_cp_ret2))))) , _tmp_cp_ret2)) /* ?{} */);
     1134        signed int _tmp_cp_ret4;
     1135        ((void)(_X12_retval_maini_1=(((void)(_tmp_cp_ret4=invoke_main(_X4argci_1, _X4argvPPc_1, _X4envpPPc_1))) , _tmp_cp_ret4)) /* ?{} */);
    11431136    }
    11441137
  • tests/.expect/declarationSpecifier.x86.txt

    r6a9d4b4 r933f32f  
    11221122    __attribute__ ((unused)) signed int _X12_retval_maini_1;
    11231123    {
    1124         ((void)(_X12_retval_maini_1=((signed int )0)) /* ?{} */);
    1125     }
    1126 
    1127     return _X12_retval_maini_1;
    1128     {
    11291124        ((void)(_X12_retval_maini_1=0) /* ?{} */);
    11301125    }
     
    11371132    __attribute__ ((unused)) signed int _X12_retval_maini_1;
    11381133    {
    1139         signed int _tmp_cp_ret2;
    1140         __attribute__ ((cleanup(__destroy_Destructor))) struct __Destructor _ret_dtor4 = { 0, ((void (*)(void *__anonymous_object0))_X11_destructorFv_i_intrinsic___1) };
    1141         void **_dtype_static_member_4 = ((void **)(&_ret_dtor4._X6objectPY12__T_generic__1));
    1142         ((void)(_X12_retval_maini_1=(((void)(((void)(_tmp_cp_ret2=invoke_main(_X4argci_1, _X4argvPPc_1, _X4envpPPc_1))) , ((*_dtype_static_member_4)=((void *)(&_tmp_cp_ret2))))) , _tmp_cp_ret2)) /* ?{} */);
     1134        signed int _tmp_cp_ret4;
     1135        ((void)(_X12_retval_maini_1=(((void)(_tmp_cp_ret4=invoke_main(_X4argci_1, _X4argvPPc_1, _X4envpPPc_1))) , _tmp_cp_ret4)) /* ?{} */);
    11431136    }
    11441137
  • tests/.expect/extension.x64.txt

    r6a9d4b4 r933f32f  
    457457
    458458    {
    459         signed int _tmp_cp_ret2;
    460         __attribute__ ((cleanup(__destroy_Destructor))) struct __Destructor _ret_dtor4 = { 0, ((void (*)(void *__anonymous_object0))_X11_destructorFv_i_intrinsic___1) };
    461         void **_dtype_static_member_4 = ((void **)(&_ret_dtor4._X6objectPY12__T_generic__1));
    462         ((void)(((void)(((void)(_tmp_cp_ret2=__extension__ _X4fredFi_i__1(3))) , ((*_dtype_static_member_4)=((void *)(&_tmp_cp_ret2))))) , _tmp_cp_ret2));
     459        signed int _tmp_cp_ret4;
     460        ((void)(((void)(_tmp_cp_ret4=__extension__ _X4fredFi_i__1(3))) , _tmp_cp_ret4));
    463461    }
    464462
  • tests/.expect/extension.x86.txt

    r6a9d4b4 r933f32f  
    457457
    458458    {
    459         signed int _tmp_cp_ret2;
    460         __attribute__ ((cleanup(__destroy_Destructor))) struct __Destructor _ret_dtor4 = { 0, ((void (*)(void *__anonymous_object0))_X11_destructorFv_i_intrinsic___1) };
    461         void **_dtype_static_member_4 = ((void **)(&_ret_dtor4._X6objectPY12__T_generic__1));
    462         ((void)(((void)(((void)(_tmp_cp_ret2=__extension__ _X4fredFi_i__1(3))) , ((*_dtype_static_member_4)=((void *)(&_tmp_cp_ret2))))) , _tmp_cp_ret2));
     459        signed int _tmp_cp_ret4;
     460        ((void)(((void)(_tmp_cp_ret4=__extension__ _X4fredFi_i__1(3))) , _tmp_cp_ret4));
    463461    }
    464462
  • tests/.expect/functions.x64.txt

    r6a9d4b4 r933f32f  
    11void _X1hFv___1(void){
    22}
    3 signed int _X1fFi_Fi__Fi_i_Fi__Fi_i_Fv____1(signed int (*__anonymous_object0)(void), signed int (*__anonymous_object1)(signed int __anonymous_object2), signed int (*__anonymous_object3)(void), signed int (*__anonymous_object4)(signed int __anonymous_object5), void (*_X1gFv___1)(void)){
     3signed int _X1fFi_Fi__Fi_i_Fi__Fi_i_Fv____1(__attribute__ ((unused)) signed int (*__anonymous_object0)(void), __attribute__ ((unused)) signed int (*__anonymous_object1)(signed int __anonymous_object2), __attribute__ ((unused)) signed int (*__anonymous_object3)(void), __attribute__ ((unused)) signed int (*__anonymous_object4)(signed int __anonymous_object5), void (*_X1gFv___1)(void)){
    44    __attribute__ ((unused)) signed int _X9_retval_fi_1;
    55    {
     
    9999    __attribute__ ((unused)) signed int _X9_retval_fi_1;
    100100}
    101 signed int _X1fFi_i__1(signed int __anonymous_object7){
     101signed int _X1fFi_i__1(__attribute__ ((unused)) signed int __anonymous_object7){
    102102    __attribute__ ((unused)) signed int _X9_retval_fi_1;
    103103}
     
    130130    __attribute__ ((unused)) struct _conc__tuple2_0 _X9_retval_fT2ii_1 = {  };
    131131}
    132 struct _conc__tuple2_0 _X1fFT2ii_ii__1(signed int __anonymous_object9, signed int _X1xi_1){
     132struct _conc__tuple2_0 _X1fFT2ii_ii__1(__attribute__ ((unused)) signed int __anonymous_object9, signed int _X1xi_1){
    133133    __attribute__ ((unused)) struct _conc__tuple2_0 _X9_retval_fT2ii_1 = {  };
    134134}
     
    167167    __attribute__ ((unused)) struct _conc__tuple3_1 _X9_retval_fT3iii_1 = {  };
    168168}
    169 struct _conc__tuple3_1 _X1fFT3iii_iii__1(signed int __anonymous_object12, signed int _X1xi_1, signed int __anonymous_object13){
     169struct _conc__tuple3_1 _X1fFT3iii_iii__1(__attribute__ ((unused)) signed int __anonymous_object12, signed int _X1xi_1, __attribute__ ((unused)) signed int __anonymous_object13){
    170170    __attribute__ ((unused)) struct _conc__tuple3_1 _X9_retval_fT3iii_1 = {  };
    171171}
     
    180180    __attribute__ ((unused)) struct _conc__tuple3_2 _X9_retval_fT3iiPi_1 = {  };
    181181}
    182 struct _conc__tuple3_2 _X1fFT3iiPi_iiPi__1(signed int __anonymous_object15, signed int _X1xi_1, signed int *_X1yPi_1){
     182struct _conc__tuple3_2 _X1fFT3iiPi_iiPi__1(__attribute__ ((unused)) signed int __anonymous_object15, signed int _X1xi_1, signed int *_X1yPi_1){
    183183    __attribute__ ((unused)) struct _conc__tuple3_2 _X9_retval_fT3iiPi_1 = {  };
    184184}
     
    190190const double _X3fooFd___1(void);
    191191const double _X3fooFd_i__1(signed int __anonymous_object19);
    192 const double _X3fooFd_d__1(double __anonymous_object20){
     192const double _X3fooFd_d__1(__attribute__ ((unused)) double __anonymous_object20){
    193193    __attribute__ ((unused)) const double _X11_retval_fooKd_1;
    194194    {
     
    242242
    243243}
    244 struct S _X3rtnFS1S_i__1(signed int __anonymous_object21){
     244struct S _X3rtnFS1S_i__1(__attribute__ ((unused)) signed int __anonymous_object21){
    245245    __attribute__ ((unused)) struct S _X11_retval_rtnS1S_1;
    246246}
    247 signed int _X1fFi_Fi_ii_Fi_i___1(signed int (*__anonymous_object22)(signed int __anonymous_object23, signed int _X1pi_1), signed int (*__anonymous_object24)(signed int __anonymous_object25)){
     247signed int _X1fFi_Fi_ii_Fi_i___1(__attribute__ ((unused)) signed int (*__anonymous_object22)(signed int __anonymous_object23, signed int _X1pi_1), __attribute__ ((unused)) signed int (*__anonymous_object24)(signed int __anonymous_object25)){
    248248    __attribute__ ((unused)) signed int _X9_retval_fi_1;
    249249    signed int (*(*_X2pcPA0A0PA0A0i_2)[][((unsigned long int )10)])[][((unsigned long int )3)];
     
    271271}
    272272signed int _X1fFi_Fi__FPi__FPPi__FPKPi__FPKPi__PiPiPPiPPiPPPiPPPiPPKPiPPKPiPKPKPiPKPKPi__1(signed int (*__anonymous_object27)(), signed int *(*__anonymous_object28)(), signed int **(*__anonymous_object29)(), signed int *const *(*__anonymous_object30)(), signed int *const *const (*__anonymous_object31)(), signed int *__anonymous_object32, signed int __anonymous_object33[((unsigned long int )10)], signed int **__anonymous_object34, signed int *__anonymous_object35[((unsigned long int )10)], signed int ***__anonymous_object36, signed int **__anonymous_object37[((unsigned long int )10)], signed int *const **__anonymous_object38, signed int *const *__anonymous_object39[((unsigned long int )10)], signed int *const *const *__anonymous_object40, signed int *const *const __anonymous_object41[((unsigned long int )10)]);
    273 signed int _X1fFi_Fi__FPi__FPPi__FPKPi__FPKPi__PiPiPPiPPiPPPiPPPiPPKPiPPKPiPKPKPiPKPKPi__1(signed int (*__anonymous_object42)(), signed int *(*__anonymous_object43)(), signed int **(*__anonymous_object44)(), signed int *const *(*__anonymous_object45)(), signed int *const *const (*__anonymous_object46)(), signed int *__anonymous_object47, signed int __anonymous_object48[((unsigned long int )10)], signed int **__anonymous_object49, signed int *__anonymous_object50[((unsigned long int )10)], signed int ***__anonymous_object51, signed int **__anonymous_object52[((unsigned long int )10)], signed int *const **__anonymous_object53, signed int *const *__anonymous_object54[((unsigned long int )10)], signed int *const *const *__anonymous_object55, signed int *const *const __anonymous_object56[((unsigned long int )10)]){
     273signed int _X1fFi_Fi__FPi__FPPi__FPKPi__FPKPi__PiPiPPiPPiPPPiPPPiPPKPiPPKPiPKPKPiPKPKPi__1(__attribute__ ((unused)) signed int (*__anonymous_object42)(), __attribute__ ((unused)) signed int *(*__anonymous_object43)(), __attribute__ ((unused)) signed int **(*__anonymous_object44)(), __attribute__ ((unused)) signed int *const *(*__anonymous_object45)(), __attribute__ ((unused)) signed int *const *const (*__anonymous_object46)(), __attribute__ ((unused)) signed int *__anonymous_object47, __attribute__ ((unused)) signed int __anonymous_object48[((unsigned long int )10)], __attribute__ ((unused)) signed int **__anonymous_object49, __attribute__ ((unused)) signed int *__anonymous_object50[((unsigned long int )10)], __attribute__ ((unused)) signed int ***__anonymous_object51, __attribute__ ((unused)) signed int **__anonymous_object52[((unsigned long int )10)], __attribute__ ((unused)) signed int *const **__anonymous_object53, __attribute__ ((unused)) signed int *const *__anonymous_object54[((unsigned long int )10)], __attribute__ ((unused)) signed int *const *const *__anonymous_object55, __attribute__ ((unused)) signed int *const *const __anonymous_object56[((unsigned long int )10)]){
    274274    __attribute__ ((unused)) signed int _X9_retval_fi_1;
    275275}
  • tests/.expect/functions.x86.txt

    r6a9d4b4 r933f32f  
    11void _X1hFv___1(void){
    22}
    3 signed int _X1fFi_Fi__Fi_i_Fi__Fi_i_Fv____1(signed int (*__anonymous_object0)(void), signed int (*__anonymous_object1)(signed int __anonymous_object2), signed int (*__anonymous_object3)(void), signed int (*__anonymous_object4)(signed int __anonymous_object5), void (*_X1gFv___1)(void)){
     3signed int _X1fFi_Fi__Fi_i_Fi__Fi_i_Fv____1(__attribute__ ((unused)) signed int (*__anonymous_object0)(void), __attribute__ ((unused)) signed int (*__anonymous_object1)(signed int __anonymous_object2), __attribute__ ((unused)) signed int (*__anonymous_object3)(void), __attribute__ ((unused)) signed int (*__anonymous_object4)(signed int __anonymous_object5), void (*_X1gFv___1)(void)){
    44    __attribute__ ((unused)) signed int _X9_retval_fi_1;
    55    {
     
    9999    __attribute__ ((unused)) signed int _X9_retval_fi_1;
    100100}
    101 signed int _X1fFi_i__1(signed int __anonymous_object7){
     101signed int _X1fFi_i__1(__attribute__ ((unused)) signed int __anonymous_object7){
    102102    __attribute__ ((unused)) signed int _X9_retval_fi_1;
    103103}
     
    130130    __attribute__ ((unused)) struct _conc__tuple2_0 _X9_retval_fT2ii_1 = {  };
    131131}
    132 struct _conc__tuple2_0 _X1fFT2ii_ii__1(signed int __anonymous_object9, signed int _X1xi_1){
     132struct _conc__tuple2_0 _X1fFT2ii_ii__1(__attribute__ ((unused)) signed int __anonymous_object9, signed int _X1xi_1){
    133133    __attribute__ ((unused)) struct _conc__tuple2_0 _X9_retval_fT2ii_1 = {  };
    134134}
     
    167167    __attribute__ ((unused)) struct _conc__tuple3_1 _X9_retval_fT3iii_1 = {  };
    168168}
    169 struct _conc__tuple3_1 _X1fFT3iii_iii__1(signed int __anonymous_object12, signed int _X1xi_1, signed int __anonymous_object13){
     169struct _conc__tuple3_1 _X1fFT3iii_iii__1(__attribute__ ((unused)) signed int __anonymous_object12, signed int _X1xi_1, __attribute__ ((unused)) signed int __anonymous_object13){
    170170    __attribute__ ((unused)) struct _conc__tuple3_1 _X9_retval_fT3iii_1 = {  };
    171171}
     
    180180    __attribute__ ((unused)) struct _conc__tuple3_2 _X9_retval_fT3iiPi_1 = {  };
    181181}
    182 struct _conc__tuple3_2 _X1fFT3iiPi_iiPi__1(signed int __anonymous_object15, signed int _X1xi_1, signed int *_X1yPi_1){
     182struct _conc__tuple3_2 _X1fFT3iiPi_iiPi__1(__attribute__ ((unused)) signed int __anonymous_object15, signed int _X1xi_1, signed int *_X1yPi_1){
    183183    __attribute__ ((unused)) struct _conc__tuple3_2 _X9_retval_fT3iiPi_1 = {  };
    184184}
     
    190190const double _X3fooFd___1(void);
    191191const double _X3fooFd_i__1(signed int __anonymous_object19);
    192 const double _X3fooFd_d__1(double __anonymous_object20){
     192const double _X3fooFd_d__1(__attribute__ ((unused)) double __anonymous_object20){
    193193    __attribute__ ((unused)) const double _X11_retval_fooKd_1;
    194194    {
     
    242242
    243243}
    244 struct S _X3rtnFS1S_i__1(signed int __anonymous_object21){
     244struct S _X3rtnFS1S_i__1(__attribute__ ((unused)) signed int __anonymous_object21){
    245245    __attribute__ ((unused)) struct S _X11_retval_rtnS1S_1;
    246246}
    247 signed int _X1fFi_Fi_ii_Fi_i___1(signed int (*__anonymous_object22)(signed int __anonymous_object23, signed int _X1pi_1), signed int (*__anonymous_object24)(signed int __anonymous_object25)){
     247signed int _X1fFi_Fi_ii_Fi_i___1(__attribute__ ((unused)) signed int (*__anonymous_object22)(signed int __anonymous_object23, signed int _X1pi_1), __attribute__ ((unused)) signed int (*__anonymous_object24)(signed int __anonymous_object25)){
    248248    __attribute__ ((unused)) signed int _X9_retval_fi_1;
    249249    signed int (*(*_X2pcPA0A0PA0A0i_2)[][((unsigned int )10)])[][((unsigned int )3)];
     
    271271}
    272272signed int _X1fFi_Fi__FPi__FPPi__FPKPi__FPKPi__PiPiPPiPPiPPPiPPPiPPKPiPPKPiPKPKPiPKPKPi__1(signed int (*__anonymous_object27)(), signed int *(*__anonymous_object28)(), signed int **(*__anonymous_object29)(), signed int *const *(*__anonymous_object30)(), signed int *const *const (*__anonymous_object31)(), signed int *__anonymous_object32, signed int __anonymous_object33[((unsigned int )10)], signed int **__anonymous_object34, signed int *__anonymous_object35[((unsigned int )10)], signed int ***__anonymous_object36, signed int **__anonymous_object37[((unsigned int )10)], signed int *const **__anonymous_object38, signed int *const *__anonymous_object39[((unsigned int )10)], signed int *const *const *__anonymous_object40, signed int *const *const __anonymous_object41[((unsigned int )10)]);
    273 signed int _X1fFi_Fi__FPi__FPPi__FPKPi__FPKPi__PiPiPPiPPiPPPiPPPiPPKPiPPKPiPKPKPiPKPKPi__1(signed int (*__anonymous_object42)(), signed int *(*__anonymous_object43)(), signed int **(*__anonymous_object44)(), signed int *const *(*__anonymous_object45)(), signed int *const *const (*__anonymous_object46)(), signed int *__anonymous_object47, signed int __anonymous_object48[((unsigned int )10)], signed int **__anonymous_object49, signed int *__anonymous_object50[((unsigned int )10)], signed int ***__anonymous_object51, signed int **__anonymous_object52[((unsigned int )10)], signed int *const **__anonymous_object53, signed int *const *__anonymous_object54[((unsigned int )10)], signed int *const *const *__anonymous_object55, signed int *const *const __anonymous_object56[((unsigned int )10)]){
     273signed int _X1fFi_Fi__FPi__FPPi__FPKPi__FPKPi__PiPiPPiPPiPPPiPPPiPPKPiPPKPiPKPKPiPKPKPi__1(__attribute__ ((unused)) signed int (*__anonymous_object42)(), __attribute__ ((unused)) signed int *(*__anonymous_object43)(), __attribute__ ((unused)) signed int **(*__anonymous_object44)(), __attribute__ ((unused)) signed int *const *(*__anonymous_object45)(), __attribute__ ((unused)) signed int *const *const (*__anonymous_object46)(), __attribute__ ((unused)) signed int *__anonymous_object47, __attribute__ ((unused)) signed int __anonymous_object48[((unsigned int )10)], __attribute__ ((unused)) signed int **__anonymous_object49, __attribute__ ((unused)) signed int *__anonymous_object50[((unsigned int )10)], __attribute__ ((unused)) signed int ***__anonymous_object51, __attribute__ ((unused)) signed int **__anonymous_object52[((unsigned int )10)], __attribute__ ((unused)) signed int *const **__anonymous_object53, __attribute__ ((unused)) signed int *const *__anonymous_object54[((unsigned int )10)], __attribute__ ((unused)) signed int *const *const *__anonymous_object55, __attribute__ ((unused)) signed int *const *const __anonymous_object56[((unsigned int )10)]){
    274274    __attribute__ ((unused)) signed int _X9_retval_fi_1;
    275275}
  • tests/.expect/gccExtensions.x64.txt

    r6a9d4b4 r933f32f  
    292292    signed int _X2m3A0A0i_2[((unsigned long int )10)][((unsigned long int )10)];
    293293    {
    294         ((void)(_X12_retval_maini_1=((signed int )0)) /* ?{} */);
     294        ((void)(_X12_retval_maini_1=0) /* ?{} */);
    295295    }
    296296
     
    307307    __attribute__ ((unused)) signed int _X12_retval_maini_1;
    308308    {
    309         signed int _tmp_cp_ret2;
    310         __attribute__ ((cleanup(__destroy_Destructor))) struct __Destructor _ret_dtor4 = { 0, ((void (*)(void *__anonymous_object0))_X11_destructorFv_i_intrinsic___1) };
    311         void **_dtype_static_member_4 = ((void **)(&_ret_dtor4._X6objectPY12__T_generic__1));
    312         ((void)(_X12_retval_maini_1=(((void)(((void)(_tmp_cp_ret2=invoke_main(_X4argci_1, _X4argvPPc_1, _X4envpPPc_1))) , ((*_dtype_static_member_4)=((void *)(&_tmp_cp_ret2))))) , _tmp_cp_ret2)) /* ?{} */);
     309        signed int _tmp_cp_ret4;
     310        ((void)(_X12_retval_maini_1=(((void)(_tmp_cp_ret4=invoke_main(_X4argci_1, _X4argvPPc_1, _X4envpPPc_1))) , _tmp_cp_ret4)) /* ?{} */);
    313311    }
    314312
  • tests/.expect/gccExtensions.x86.txt

    r6a9d4b4 r933f32f  
    292292    signed int _X2m3A0A0i_2[((unsigned int )10)][((unsigned int )10)];
    293293    {
    294         ((void)(_X12_retval_maini_1=((signed int )0)) /* ?{} */);
     294        ((void)(_X12_retval_maini_1=0) /* ?{} */);
    295295    }
    296296
     
    307307    __attribute__ ((unused)) signed int _X12_retval_maini_1;
    308308    {
    309         signed int _tmp_cp_ret2;
    310         __attribute__ ((cleanup(__destroy_Destructor))) struct __Destructor _ret_dtor4 = { 0, ((void (*)(void *__anonymous_object0))_X11_destructorFv_i_intrinsic___1) };
    311         void **_dtype_static_member_4 = ((void **)(&_ret_dtor4._X6objectPY12__T_generic__1));
    312         ((void)(_X12_retval_maini_1=(((void)(((void)(_tmp_cp_ret2=invoke_main(_X4argci_1, _X4argvPPc_1, _X4envpPPc_1))) , ((*_dtype_static_member_4)=((void *)(&_tmp_cp_ret2))))) , _tmp_cp_ret2)) /* ?{} */);
     309        signed int _tmp_cp_ret4;
     310        ((void)(_X12_retval_maini_1=(((void)(_tmp_cp_ret4=invoke_main(_X4argci_1, _X4argvPPc_1, _X4envpPPc_1))) , _tmp_cp_ret4)) /* ?{} */);
    313311    }
    314312
  • tests/.expect/identity.txt

    r6a9d4b4 r933f32f  
    99double                  4.1
    1010long double             4.1
    11 float _Complex          -4.1-2i
    12 double _Complex         -4.1-2i
    13 long double _Complex    -4.1-2i
     11float _Complex          -4.1-2.i
     12double _Complex         -4.1-2.i
     13long double _Complex    -4.1-2.i
  • tests/.expect/io1.txt

    r6a9d4b4 r933f32f  
    119 6 28 0 7 1 2
    2 1 2 3
    3 123
    4 123
     20 1 2 3
     30123
     40123
    55
    66opening delimiters
  • tests/.expect/loopctrl.txt

    r6a9d4b4 r933f32f  
    191910 8 6 4 2
    2020
     211 2 3 4 5 6 7 8 9 10
     2210 9 8 7 6 5 4 3 2 1 0
     232 4 6 8 10
     242.1 3.8 5.5 7.2 8.9
     2510 8 6 4 2 0
     2612.1 10.4 8.7 7. 5.3 3.6
    2127
    2228N N N N N N N N N N
     
    243010 9 8 7 6 5 4 3 2 1
    2531
    26 
    27323 6 9
    28 
    2933
    3034(0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9)
     
    4044(10 10)(9 9)(8 8)(7 7)(6 6)(5 5)(4 4)(3 3)(2 2)(1 1)(0 0)
    4145(10 10)(9 9)(8 8)(7 7)(6 6)(5 5)(4 4)(3 3)(2 2)(1 1)(0 0)
     46
     470 -5 1 -4 2 -3 3 -2 4 -1 5 0 6 1 7 2 8 3 9 4
     480 -5 1 -6 2 -7 3 -8 4 -9 5 -10 6 -11 7 -12 8 -13 9 -14
     490 -5 1 -3 2 -1 3 1 4 3 5 5 6 7 7 9 8 11 9 13
     500 -5 1 -7 2 -9 3 -11 4 -13 5 -15 6 -17 7 -19 8 -21 9 -23
     51
     520 -5 1 -4 2 -3 3 -2 4 -1 5 0 6 1 7 2 8 3 9 4
     530 -5 1 -6 2 -7 3 -8 4 -9 5 -10 6 -11 7 -12 8 -13 9 -14
     540 -5 1 -3 2 -1 3 1 4 3 5 5 6 7 7 9 8 11 9 13
     550 -5 1 -7 2 -9 3 -11 4 -13 5 -15 6 -17 7 -19 8 -21 9 -23
     56
     570 -5 1.5 1 -7 2.5 2 -9 3.5 3 -11 4.5 4 -13 5.5 5 -15 6.5 6 -17 7.5 7 -19 8.5 8 -21 9.5 9 -23 10.5
     580 -5 1.5 1 -7 2.5 2 -9 3.5 3 -11 4.5 4 -13 5.5 5 -15 6.5 6 -17 7.5 7 -19 8.5 8 -21 9.5 9 -23 10.5
     590 -5 1.5 1 -7 2.5 2 -9 3.5 3 -11 4.5 4 -13 5.5 5 -15 6.5 6 -17 7.5 7 -19 8.5 8 -21 9.5 9 -23 10.5
  • tests/.expect/math1.txt

    r6a9d4b4 r933f32f  
    1 fmod:1 1 1 1 1 1
    2 remainder:-1 -1 -1
     1fmod:1. 1. 1. 1. 1. 1.
     2remainder:-1. -1. -1.
    33remquo:7 0.0999999 7 0.1 7 0.0999999999999999999
    4 div:7, 0.2 7, 0.2 7, 0.2
    5 fma:-2 -2 -2
    6 fdim:2 2 2
     4div:7., 0.2 7., 0.2 7., 0.2
     5fma:-2. -2. -2.
     6fdim:2. 2. 2.
    77nan:nan nan nan
    88exp:2.71828 2.71828182845905 2.71828182845904524 1.46869+2.28736i 1.46869393991589+2.28735528717884i 1.46869393991588516+2.28735528717884239i
    9 exp2:2 2 2
     9exp2:2. 2. 2.
    1010expm1:1.71828 1.71828182845905 1.71828182845904524
    11 pow:1 1 1 0.273957+0.583701i 0.273957253830121+0.583700758758615i -0.638110484918098871+0.705394566961838155i
    12 \ 16 256
    13 \ 912673 256 64 -64 0.015625 -0.015625 18.3791736799526 0.264715-1.1922i
     11pow:1. 1. 1. 0.273957+0.583701i 0.273957253830121+0.583700758758615i -0.638110484918098871+0.705394566961838155i
     1216 \ 2 = 256
     13912673 256 64 -64 0 0
     140.015625 -0.015625 18.3791736799526 0.264715-1.1922i
     150 0 18.3791736799526 0.264715-1.1922i
     1616
     174 16
  • tests/.expect/math2.txt

    r6a9d4b4 r933f32f  
    1 log:0 0 0 0.346574+0.785398i 0.346573590279973+0.785398163397448i 0.346573590279972655+0.78539816339744831i
    2 log2:3 3 3
    3 log10:2 2 2
     1log:0. 0. 0. 0.346574+0.785398i 0.346573590279973+0.785398163397448i 0.346573590279972655+0.78539816339744831i
     2log2:3. 3. 3.
     3log10:2. 2. 2.
    44log1p:0.693147 0.693147180559945 0.693147180559945309
    55ilogb:0 0 0
    6 logb:3 3 3
    7 sqrt:1 1 1 1.09868+0.45509i 1.09868411346781+0.455089860562227i 1.09868411346780997+0.455089860562227341i
    8 cbrt:3 3 3
     6logb:3. 3. 3.
     7sqrt:1. 1. 1. 1.09868+0.45509i 1.09868411346781+0.455089860562227i 1.09868411346780997+0.455089860562227341i
     8cbrt:3. 3. 3.
    99hypot:1.41421 1.4142135623731 1.41421356237309505
    1010sin:0.841471 0.841470984807897 0.841470984807896507 1.29846+0.634964i 1.29845758141598+0.634963914784736i 1.29845758141597729+0.634963914784736108i
     
    1212tan:1.55741 1.5574077246549 1.55740772465490223 0.271753+1.08392i 0.271752585319512+1.08392332733869i 0.271752585319511717+1.08392332733869454i
    1313asin:1.5708 1.5707963267949 1.57079632679489662 0.666239+1.06128i 0.666239432492515+1.06127506190504i 0.666239432492515255+1.06127506190503565i
    14 acos:0 0 0 0.904557-1.06128i 0.904556894302381-1.06127506190504i 0.904556894302381364-1.06127506190503565i
     14acos:0. 0. 0. 0.904557-1.06128i 0.904556894302381-1.06127506190504i 0.904556894302381364-1.06127506190503565i
    1515atan:0.785398 0.785398163397448 0.78539816339744831 1.01722+0.402359i 1.01722196789785+0.402359478108525i 1.01722196789785137+0.402359478108525094i
    1616atan2:0.785398 0.785398163397448 0.78539816339744831 atan:0.785398 0.785398163397448 0.78539816339744831
  • tests/.expect/math3.txt

    r6a9d4b4 r933f32f  
    22cosh:1.54308 1.54308063481524 1.54308063481524378 0.83373+0.988898i 0.833730025131149+0.988897705762865i 0.833730025131149049+0.988897705762865096i
    33tanh:0.761594 0.761594155955765 0.761594155955764888 1.08392+0.271753i 1.08392332733869+0.271752585319512i 1.08392332733869454+0.271752585319511717i
    4 acosh:0 0 0 1.06128+0.904557i 1.06127506190504+0.904556894302381i 1.06127506190503565+0.904556894302381364i
     4acosh:0. 0. 0. 1.06128+0.904557i 1.06127506190504+0.904556894302381i 1.06127506190503565+0.904556894302381364i
    55asinh:0.881374 0.881373587019543 0.881373587019543025 1.06128+0.666239i 1.06127506190504+0.666239432492515i 1.06127506190503565+0.666239432492515255i
    66atanh:inf inf inf 0.402359+1.01722i 0.402359478108525+1.01722196789785i 0.402359478108525094+1.01722196789785137i
     
    99lgamma:1.79176 1.79175946922805 1.791759469228055
    1010lgamma:1.79176 1 1.79175946922805 1 1.791759469228055 1
    11 tgamma:6 6 6
     11tgamma:6. 6. 6.
  • tests/.expect/math4.txt

    r6a9d4b4 r933f32f  
    1 floor:1 1 1
    2 ceil:2 2 2
    3 trunc:3 3 3
    4 rint:2 2 2
     1floor:1. 1. 1.
     2ceil:2. 2. 2.
     3trunc:3. 3. 3.
     4rint:2. 2. 2.
    55rint:2 2 2
    66rint:2 2 2
    77lrint:2 2 2
    88llrint:2 2 2
    9 nearbyint:4 4 4
    10 round:2 2 2
     9nearbyint:4. 4. 4.
     10round:2. 2. 2.
    1111round:2 2 2
    1212round:2 2 2
    1313lround:2 2 2
    1414llround:2 2 2
    15 copysign:-1 -1 -1
     15copysign:-1. -1. -1.
    1616frexp:0.5 3 0.5 3 0.5 3
    17 ldexp:8 8 8
    18 modf:2 0.3 2 0.3 2 0.3
    19 modf:2, 0.3 2, 0.3 2, 0.3
    20 nextafter:2 2 2
    21 nexttoward:2 2 2
    22 scalbn:16 16 16
    23 scalbln:16 16 16
     17ldexp:8. 8. 8.
     18modf:2. 0.3 2. 0.3 2. 0.3
     19modf:2., 0.3 2., 0.3 2., 0.3
     20nextafter:2. 2. 2.
     21nexttoward:2. 2. 2.
     22scalbn:16. 16. 16.
     23scalbln:16. 16. 16.
  • tests/.expect/minmax.txt

    r6a9d4b4 r933f32f  
    66signed long long int    4 3     min 3
    77unsigned long long int  4 3     min 3
    8 float                   4 3.1   min 3.1
    9 double                  4 3.1   min 3.1
    10 long double             4 3.1   min 3.1
     8float                   4. 3.1  min 3.1
     9double                  4. 3.1  min 3.1
     10long double             4. 3.1  min 3.1
    1111
    1212char                    z a     max z
     
    1717signed long long int    4 3     max 4
    1818unsigned long long int  4 3     max 4
    19 float                   4 3.1   max 4
    20 double                  4 3.1   max 4
    21 long double             4 3.1   max 4
     19float                   4. 3.1  max 4.
     20double                  4. 3.1  max 4.
     21long double             4. 3.1  max 4.
  • tests/.expect/references.txt

    r6a9d4b4 r933f32f  
    35353
    36363
    37 3 9 { 1, 7 }, [1, 2, 3]
     373 9 { 1., 7. }, [1, 2, 3]
    3838Destructing a Y
    3939Destructing a Y
  • tests/.expect/sum.txt

    r6a9d4b4 r933f32f  
     1sum from 5 to 15 is 95, check 95
     2sum from 5 to 15 is 95, check 95
    13sum from 5 to 15 is 95, check 95
    24sum from 5 to 15 is 95, check 95
  • tests/Makefile.am

    r6a9d4b4 r933f32f  
    2323installed=no
    2424
     25INSTALL_FLAGS=-in-tree
     26DEBUG_FLAGS=-debug -O0
     27
    2528quick_test=avl_test operators numericConstants expression enum array typeof cast raii/dtor-early-exit raii/init_once attributes
    2629
     
    2831timeouts=
    2932
    30 TEST_PY = python ${builddir}/test.py
     33TEST_PY = python3 ${builddir}/test.py
    3134
    3235# applies to both programs
     
    3639        -Wno-unused-function \
    3740        -quiet @CFA_FLAGS@ \
    38         -DIN_DIR="${srcdir}/.in/"
     41        -DIN_DIR="${abs_srcdir}/.in/"
    3942
    4043AM_CFLAGS += ${DEBUG_FLAGS} ${INSTALL_FLAGS} ${ARCH_FLAGS}
    4144CC = @CFACC@
    4245
    43 PRETTY_PATH=cd ${srcdir} &&
     46PRETTY_PATH=mkdir -p $(dir $(abspath ${@})) && cd ${srcdir} &&
    4447
    4548.PHONY: list .validate
     
    4851
    4952avl_test_SOURCES = avltree/avl_test.cfa avltree/avl0.cfa avltree/avl1.cfa avltree/avl2.cfa avltree/avl3.cfa avltree/avl4.cfa avltree/avl-private.cfa
    50 # automake doesn't know we still need C rules so pretend like we have a C program
    51 _dummy_hack_SOURCES = .dummy_hack.c
     53# automake doesn't know we still need C/CPP rules so pretend like we have a C program
     54_dummy_hack_SOURCES = .dummy_hack.c .dummy_hackxx.cpp
    5255
    5356#----------------------------------------------------------------------------------------------------------------
     
    7477        @echo "int main() { return 0; }" > ${@}
    7578
     79.dummy_hackxx.cpp:
     80        @echo "int bar() { return 0; }" > ${@}
     81
    7682concurrency :
    7783        @+${TEST_PY} --debug=${debug}  --install=${installed} -Iconcurrent
     
    7985#----------------------------------------------------------------------------------------------------------------
    8086
     87# Use for all tests, make sure the path are correct and all flags are added
     88CFACOMPILETEST=$(PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) $($(shell echo "${@}_FLAGS" | sed 's/-\|\//_/g'))
     89
     90# Use for tests that either generate an executable, print directyl to stdout or the make command is expected to fail
     91CFATEST_STDOUT=$(CFACOMPILETEST) -o $(abspath ${@})
     92
     93# Use for tests where the make command is expecte to succeed but the expected.txt should be compared to stderr
     94CFATEST_STDERR=$(CFACOMPILETEST) 2> $(abspath ${@})
     95
     96#----------------------------------------------------------------------------------------------------------------
     97
    8198# implicit rule so not all test require a rule
    8299% : %.cfa $(CFACC)
    83         $(PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     100        $(CFATEST_STDOUT)
    84101
    85 declarationSpecifier: declarationSpecifier.cfa $(CFACC)
    86         $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     102% : %.cpp
     103        $(PRETTY_PATH) $(CXXCOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    87104
    88 gccExtensions : gccExtensions.cfa $(CFACC)
    89         $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     105#------------------------------------------------------------------------------
     106# TARGET WITH STANDARD RULE BUT CUSTOM FLAGS
     107#------------------------------------------------------------------------------
     108# Expected failures
     109declarationSpecifier_FLAGS= -CFA -XCFA -p
     110gccExtensions_FLAGS= -CFA -XCFA -p
     111extension_FLAGS= -CFA -XCFA -p
     112attributes_FLAGS= -CFA -XCFA -p
     113functions_FLAGS= -CFA -XCFA -p
     114KRfunctions_FLAGS= -CFA -XCFA -p
     115gmp_FLAGS= -lgmp
    90116
    91 extension : extension.cfa $(CFACC)
    92         $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     117#------------------------------------------------------------------------------
     118# Expected failures
     119completeTypeError_FLAGS= -DERR1
    93120
    94 attributes : attributes.cfa $(CFACC)
    95         $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     121#------------------------------------------------------------------------------
     122# CUSTOM TARGET
     123#------------------------------------------------------------------------------
     124typedefRedef-ERR1: typedefRedef.cfa $(CFACC)
     125        $(CFATEST_STDOUT) -DERR1
    96126
    97 functions: functions.cfa $(CFACC)
    98         $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     127alloc-ERROR: alloc.cfa $(CFACC)
     128        $(CFATEST_STDOUT) -DERR1
    99129
    100 KRfunctions : KRfunctions.cfa $(CFACC)
    101         $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     130nested-types-ERR1: nested-types.cfa $(CFACC)
     131        $(CFATEST_STDOUT) -DERR1
    102132
    103 sched-ext-parse : sched-ext-parse.c $(CFACC)
    104         $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     133nested-types-ERR2: nested-types.cfa $(CFACC)
     134        $(CFATEST_STDOUT) -DERR2
    105135
    106 gmp : gmp.cfa $(CFACC)
    107         $(PRETTY_PATH) $(CFACOMPILE) -lgmp $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     136raii/dtor-early-exit-ERR1: raii/dtor-early-exit.cfa $(CFACC)
     137        $(CFATEST_STDOUT) -DERR1
     138
     139raii/dtor-early-exit-ERR2: raii/dtor-early-exit.cfa $(CFACC)
     140        $(CFATEST_STDOUT) -DERR2
     141
     142raii/memberCtors-ERR1: raii/memberCtors.cfa $(CFACC)
     143        $(CFATEST_STDOUT) -DERR1
     144
     145raii/ctor-autogen-ERR1: raii/ctor-autogen.cfa $(CFACC)
     146        $(CFATEST_STDOUT) -DERR1
    108147
    109148#builtins
    110149builtins/sync: builtins/sync.cfa $(CFACC)
    111         $(PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) 2> $(abspath ${@}) -fsyntax-only
    112 
    113 #------------------------------------------------------------------------------
    114 
    115 #To make errors path independent we need to cd into the correct directories
    116 completeTypeError : completeTypeError.cfa $(CFACC)
    117         $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    118 
    119 typedefRedef-ERR1: typedefRedef.cfa $(CFACC)
    120         $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    121 
    122 alloc-ERROR: alloc.cfa $(CFACC)
    123         $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    124 
    125 fallthrough-ERROR: fallthrough.cfa $(CFACC)
    126         $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    127 
    128 nested-types-ERR1: nested-types.cfa $(CFACC)
    129         $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    130 
    131 nested-types-ERR2: nested-types.cfa $(CFACC)
    132         $(PRETTY_PATH) $(CFACOMPILE) -DERR2 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    133 
    134 # Constructor/destructor tests
    135 raii/dtor-early-exit-ERR1: raii/dtor-early-exit.cfa $(CFACC)
    136         $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    137 
    138 raii/dtor-early-exit-ERR2: raii/dtor-early-exit.cfa $(CFACC)
    139         $(PRETTY_PATH) $(CFACOMPILE) -DERR2 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    140 
    141 raii/memberCtors-ERR1: raii/memberCtors.cfa $(CFACC)
    142         $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    143 
    144 raii/ctor-autogen-ERR1: raii/ctor-autogen.cfa $(CFACC)
    145         $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     150        $(CFATEST_STDERR) -fsyntax-only
    146151
    147152# Warnings
    148153warnings/self-assignment: warnings/self-assignment.cfa $(CFACC)
    149         $(PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) 2> $(abspath ${@}) -fsyntax-only
     154        $(CFATEST_STDERR) -fsyntax-only
  • tests/Makefile.in

    r6a9d4b4 r933f32f  
    107107CONFIG_CLEAN_FILES = config.py
    108108CONFIG_CLEAN_VPATH_FILES = test.py
    109 am__dummy_hack_OBJECTS = .dummy_hack.$(OBJEXT)
     109am__dummy_hack_OBJECTS = .dummy_hack.$(OBJEXT) .dummy_hackxx.$(OBJEXT)
    110110_dummy_hack_OBJECTS = $(am__dummy_hack_OBJECTS)
    111111_dummy_hack_LDADD = $(LDADD)
     
    155155am__v_CCLD_0 = @echo "  CCLD    " $@;
    156156am__v_CCLD_1 =
     157CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
     158        $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
     159LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
     160        $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \
     161        $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
     162        $(AM_CXXFLAGS) $(CXXFLAGS)
     163AM_V_CXX = $(am__v_CXX_@AM_V@)
     164am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@)
     165am__v_CXX_0 = @echo "  CXX     " $@;
     166am__v_CXX_1 =
     167CXXLD = $(CXX)
     168CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
     169        $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
     170        $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
     171AM_V_CXXLD = $(am__v_CXXLD_@AM_V@)
     172am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@)
     173am__v_CXXLD_0 = @echo "  CXXLD   " $@;
     174am__v_CXXLD_1 =
    157175SOURCES = $(_dummy_hack_SOURCES) $(avl_test_SOURCES)
    158176DIST_SOURCES = $(_dummy_hack_SOURCES) $(avl_test_SOURCES)
     
    186204DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
    187205ACLOCAL = @ACLOCAL@
    188 ALLOCA = @ALLOCA@
    189206AMTAR = @AMTAR@
    190207AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
     
    358375debug = yes
    359376installed = no
     377INSTALL_FLAGS = -in-tree
     378DEBUG_FLAGS = -debug -O0
    360379quick_test = avl_test operators numericConstants expression enum array typeof cast raii/dtor-early-exit raii/init_once attributes
    361380concurrent =
    362381timeouts =
    363 TEST_PY = python ${builddir}/test.py
     382TEST_PY = python3 ${builddir}/test.py
    364383
    365384# applies to both programs
    366385AM_CFLAGS = $(if $(test), 2> $(test), ) -g -Wall -Wno-unused-function \
    367         -quiet @CFA_FLAGS@ -DIN_DIR="${srcdir}/.in/" ${DEBUG_FLAGS} \
    368         ${INSTALL_FLAGS} ${ARCH_FLAGS}
    369 PRETTY_PATH = cd ${srcdir} &&
     386        -quiet @CFA_FLAGS@ -DIN_DIR="${abs_srcdir}/.in/" \
     387        ${DEBUG_FLAGS} ${INSTALL_FLAGS} ${ARCH_FLAGS}
     388PRETTY_PATH = mkdir -p $(dir $(abspath ${@})) && cd ${srcdir} &&
    370389avl_test_SOURCES = avltree/avl_test.cfa avltree/avl0.cfa avltree/avl1.cfa avltree/avl2.cfa avltree/avl3.cfa avltree/avl4.cfa avltree/avl-private.cfa
    371 # automake doesn't know we still need C rules so pretend like we have a C program
    372 _dummy_hack_SOURCES = .dummy_hack.c
     390# automake doesn't know we still need C/CPP rules so pretend like we have a C program
     391_dummy_hack_SOURCES = .dummy_hack.c .dummy_hackxx.cpp
     392
     393#----------------------------------------------------------------------------------------------------------------
     394
     395# Use for all tests, make sure the path are correct and all flags are added
     396CFACOMPILETEST = $(PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) $($(shell echo "${@}_FLAGS" | sed 's/-\|\//_/g'))
     397
     398# Use for tests that either generate an executable, print directyl to stdout or the make command is expected to fail
     399CFATEST_STDOUT = $(CFACOMPILETEST) -o $(abspath ${@})
     400
     401# Use for tests where the make command is expecte to succeed but the expected.txt should be compared to stderr
     402CFATEST_STDERR = $(CFACOMPILETEST) 2> $(abspath ${@})
     403
     404#------------------------------------------------------------------------------
     405# TARGET WITH STANDARD RULE BUT CUSTOM FLAGS
     406#------------------------------------------------------------------------------
     407# Expected failures
     408declarationSpecifier_FLAGS = -CFA -XCFA -p
     409gccExtensions_FLAGS = -CFA -XCFA -p
     410extension_FLAGS = -CFA -XCFA -p
     411attributes_FLAGS = -CFA -XCFA -p
     412functions_FLAGS = -CFA -XCFA -p
     413KRfunctions_FLAGS = -CFA -XCFA -p
     414gmp_FLAGS = -lgmp
     415
     416#------------------------------------------------------------------------------
     417# Expected failures
     418completeTypeError_FLAGS = -DERR1
    373419all: all-am
    374420
    375421.SUFFIXES:
    376 .SUFFIXES: .c .cfa .dummy_hack .lo .o .obj .validate
     422.SUFFIXES: .c .cfa .cpp .dummy_hack .dummy_hackxx .lo .o .obj .validate
    377423$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(top_srcdir)/src/cfa.make $(am__configure_deps)
    378424        @for dep in $?; do \
     
    410456.dummy_hack$(EXEEXT): $(_dummy_hack_OBJECTS) $(_dummy_hack_DEPENDENCIES) $(EXTRA__dummy_hack_DEPENDENCIES)
    411457        @rm -f .dummy_hack$(EXEEXT)
    412         $(AM_V_CCLD)$(LINK) $(_dummy_hack_OBJECTS) $(_dummy_hack_LDADD) $(LIBS)
     458        $(AM_V_CXXLD)$(CXXLINK) $(_dummy_hack_OBJECTS) $(_dummy_hack_LDADD) $(LIBS)
    413459avltree/$(am__dirstamp):
    414460        @$(MKDIR_P) avltree
     
    444490
    445491@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/.dummy_hack.Po@am__quote@
     492@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/.dummy_hackxx.Po@am__quote@
    446493
    447494.c.o:
     
    468515@AMDEP_TRUE@@am__fastdepCC_FALSE@       DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    469516@am__fastdepCC_FALSE@   $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
     517
     518.cpp.o:
     519@am__fastdepCXX_TRUE@   $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
     520@am__fastdepCXX_TRUE@   $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
     521@am__fastdepCXX_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Po
     522@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
     523@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     524@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $<
     525
     526.cpp.obj:
     527@am__fastdepCXX_TRUE@   $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
     528@am__fastdepCXX_TRUE@   $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
     529@am__fastdepCXX_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Po
     530@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
     531@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     532@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
     533
     534.cpp.lo:
     535@am__fastdepCXX_TRUE@   $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
     536@am__fastdepCXX_TRUE@   $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
     537@am__fastdepCXX_TRUE@   $(am__mv) $$depbase.Tpo $$depbase.Plo
     538@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
     539@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     540@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $<
    470541
    471542mostlyclean-libtool:
     
    718789        @echo "int main() { return 0; }" > ${@}
    719790
     791.dummy_hackxx.cpp:
     792        @echo "int bar() { return 0; }" > ${@}
     793
    720794concurrency :
    721795        @+${TEST_PY} --debug=${debug}  --install=${installed} -Iconcurrent
     
    725799# implicit rule so not all test require a rule
    726800% : %.cfa $(CFACC)
    727         $(PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    728 
    729 declarationSpecifier: declarationSpecifier.cfa $(CFACC)
    730         $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    731 
    732 gccExtensions : gccExtensions.cfa $(CFACC)
    733         $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    734 
    735 extension : extension.cfa $(CFACC)
    736         $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    737 
    738 attributes : attributes.cfa $(CFACC)
    739         $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    740 
    741 functions: functions.cfa $(CFACC)
    742         $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    743 
    744 KRfunctions : KRfunctions.cfa $(CFACC)
    745         $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    746 
    747 sched-ext-parse : sched-ext-parse.c $(CFACC)
    748         $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    749 
    750 gmp : gmp.cfa $(CFACC)
    751         $(PRETTY_PATH) $(CFACOMPILE) -lgmp $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     801        $(CFATEST_STDOUT)
     802
     803% : %.cpp
     804        $(PRETTY_PATH) $(CXXCOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     805
     806#------------------------------------------------------------------------------
     807# CUSTOM TARGET
     808#------------------------------------------------------------------------------
     809typedefRedef-ERR1: typedefRedef.cfa $(CFACC)
     810        $(CFATEST_STDOUT) -DERR1
     811
     812alloc-ERROR: alloc.cfa $(CFACC)
     813        $(CFATEST_STDOUT) -DERR1
     814
     815nested-types-ERR1: nested-types.cfa $(CFACC)
     816        $(CFATEST_STDOUT) -DERR1
     817
     818nested-types-ERR2: nested-types.cfa $(CFACC)
     819        $(CFATEST_STDOUT) -DERR2
     820
     821raii/dtor-early-exit-ERR1: raii/dtor-early-exit.cfa $(CFACC)
     822        $(CFATEST_STDOUT) -DERR1
     823
     824raii/dtor-early-exit-ERR2: raii/dtor-early-exit.cfa $(CFACC)
     825        $(CFATEST_STDOUT) -DERR2
     826
     827raii/memberCtors-ERR1: raii/memberCtors.cfa $(CFACC)
     828        $(CFATEST_STDOUT) -DERR1
     829
     830raii/ctor-autogen-ERR1: raii/ctor-autogen.cfa $(CFACC)
     831        $(CFATEST_STDOUT) -DERR1
    752832
    753833#builtins
    754834builtins/sync: builtins/sync.cfa $(CFACC)
    755         $(PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) 2> $(abspath ${@}) -fsyntax-only
    756 
    757 #------------------------------------------------------------------------------
    758 
    759 #To make errors path independent we need to cd into the correct directories
    760 completeTypeError : completeTypeError.cfa $(CFACC)
    761         $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    762 
    763 typedefRedef-ERR1: typedefRedef.cfa $(CFACC)
    764         $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    765 
    766 alloc-ERROR: alloc.cfa $(CFACC)
    767         $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    768 
    769 fallthrough-ERROR: fallthrough.cfa $(CFACC)
    770         $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    771 
    772 nested-types-ERR1: nested-types.cfa $(CFACC)
    773         $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    774 
    775 nested-types-ERR2: nested-types.cfa $(CFACC)
    776         $(PRETTY_PATH) $(CFACOMPILE) -DERR2 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    777 
    778 # Constructor/destructor tests
    779 raii/dtor-early-exit-ERR1: raii/dtor-early-exit.cfa $(CFACC)
    780         $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    781 
    782 raii/dtor-early-exit-ERR2: raii/dtor-early-exit.cfa $(CFACC)
    783         $(PRETTY_PATH) $(CFACOMPILE) -DERR2 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    784 
    785 raii/memberCtors-ERR1: raii/memberCtors.cfa $(CFACC)
    786         $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
    787 
    788 raii/ctor-autogen-ERR1: raii/ctor-autogen.cfa $(CFACC)
    789         $(PRETTY_PATH) $(CFACOMPILE) -DERR1 $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})
     835        $(CFATEST_STDERR) -fsyntax-only
    790836
    791837# Warnings
    792838warnings/self-assignment: warnings/self-assignment.cfa $(CFACC)
    793         $(PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) 2> $(abspath ${@}) -fsyntax-only
     839        $(CFATEST_STDERR) -fsyntax-only
    794840
    795841# Tell versions [3.59,3.63) of GNU make to not export all variables.
  • tests/array.cfa

    r6a9d4b4 r933f32f  
    1 //Testing array declarations
     1//                               -*- Mode: C -*-
     2//
     3// Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
     4//
     5// The contents of this file are covered under the licence agreement in the
     6// file "LICENCE" distributed with Cforall.
     7//
     8// array.cfa -- test array declarations
     9//
     10// Author           : Peter A. Buhr
     11// Created On       : Tue Feb 19 21:18:06 2019
     12// Last Modified By : Peter A. Buhr
     13// Last Modified On : Tue Feb 19 21:18:46 2019
     14// Update Count     : 1
     15//
     16
    217int a1[];
    318//int a2[*];
     
    3449}
    3550
    36 //Dummy main
    37 int main(int argc, char const *argv[])
    38 {
    39         return 0;
    40 }
     51int main() {}
     52
     53// Local Variables: //
     54// tab-width: 4 //
     55// compile-command: "cfa array.cfa" //
     56// End: //
  • tests/builtins/sync.cfa

    r6a9d4b4 r933f32f  
    1111        volatile __int128 * vp16 = 0; __int128 * rp16 = 0; __int128 v16 = 0;
    1212        #endif
     13        struct type * volatile * vpp = 0; struct type ** rpp = 0; struct type * vp = 0;
    1314
    1415        { char ret; ret = __sync_fetch_and_add(vp1, v1); }
     
    180181        { _Bool ret; ret = __sync_bool_compare_and_swap_16(vp16, v16,v16); }
    181182        #endif
     183        { _Bool ret; ret = __sync_bool_compare_and_swap(vpp, vp, vp); }
    182184
    183185        { char ret; ret = __sync_val_compare_and_swap(vp1, v1, v1); }
     
    193195        { __int128 ret; ret = __sync_val_compare_and_swap_16(vp16, v16,v16); }
    194196        #endif
     197        { struct type * ret; ret = __sync_val_compare_and_swap(vpp, vp, vp); }
     198
    195199
    196200        { char ret; ret = __sync_lock_test_and_set(vp1, v1); }
     
    230234        { __atomic_clear(vp1, v1); }
    231235
    232         { char ret; ret = __atomic_exchange_n(vp1, &v1, __ATOMIC_SEQ_CST); }
     236        { char ret; ret = __atomic_exchange_n(vp1, v1, __ATOMIC_SEQ_CST); }
    233237        { char ret; ret = __atomic_exchange_1(vp1, v1, __ATOMIC_SEQ_CST); }
    234238        { char ret; __atomic_exchange(vp1, &v1, &ret, __ATOMIC_SEQ_CST); }
    235         { short ret; ret = __atomic_exchange_n(vp2, &v2, __ATOMIC_SEQ_CST); }
     239        { short ret; ret = __atomic_exchange_n(vp2, v2, __ATOMIC_SEQ_CST); }
    236240        { short ret; ret = __atomic_exchange_2(vp2, v2, __ATOMIC_SEQ_CST); }
    237241        { short ret; __atomic_exchange(vp2, &v2, &ret, __ATOMIC_SEQ_CST); }
    238         { int ret; ret = __atomic_exchange_n(vp4, &v4, __ATOMIC_SEQ_CST); }
     242        { int ret; ret = __atomic_exchange_n(vp4, v4, __ATOMIC_SEQ_CST); }
    239243        { int ret; ret = __atomic_exchange_4(vp4, v4, __ATOMIC_SEQ_CST); }
    240244        { int ret; __atomic_exchange(vp4, &v4, &ret, __ATOMIC_SEQ_CST); }
    241         { long long int ret; ret = __atomic_exchange_n(vp8, &v8, __ATOMIC_SEQ_CST); }
     245        { long long int ret; ret = __atomic_exchange_n(vp8, v8, __ATOMIC_SEQ_CST); }
    242246        { long long int ret; ret = __atomic_exchange_8(vp8, v8, __ATOMIC_SEQ_CST); }
    243247        { long long int ret; __atomic_exchange(vp8, &v8, &ret, __ATOMIC_SEQ_CST); }
    244248        #if defined(__SIZEOF_INT128__)
    245         { __int128 ret; ret = __atomic_exchange_n(vp16, &v16, __ATOMIC_SEQ_CST); }
     249        { __int128 ret; ret = __atomic_exchange_n(vp16, v16, __ATOMIC_SEQ_CST); }
    246250        { __int128 ret; ret = __atomic_exchange_16(vp16, v16, __ATOMIC_SEQ_CST); }
    247251        { __int128 ret; __atomic_exchange(vp16, &v16, &ret, __ATOMIC_SEQ_CST); }
    248252        #endif
     253        { struct type * ret; ret = __atomic_exchange_n(vpp, vp, __ATOMIC_SEQ_CST); }
     254        { struct type * ret; __atomic_exchange(vpp, &vp, &ret, __ATOMIC_SEQ_CST); }
    249255
    250256        { char ret; ret = __atomic_load_n(vp1, __ATOMIC_SEQ_CST); }
     
    265271        { __int128 ret; __atomic_load(vp16, &ret, __ATOMIC_SEQ_CST); }
    266272        #endif
     273        { struct type * ret; ret = __atomic_load_n(vpp, __ATOMIC_SEQ_CST); }
     274        { struct type * ret; __atomic_load(vpp, &ret, __ATOMIC_SEQ_CST); }
    267275
    268276        { _Bool ret; ret = __atomic_compare_exchange_n(vp1, rp1, v1, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); }
     
    283291        { _Bool ret; ret = __atomic_compare_exchange(vp16, rp16, &v16, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); }
    284292        #endif
     293        { _Bool ret; ret = __atomic_compare_exchange_n(vpp, rpp, vp, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); }
     294        { _Bool ret; ret = __atomic_compare_exchange(vpp, rpp, &vp, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); }
    285295
    286296        { __atomic_store_n(vp1, v1, __ATOMIC_SEQ_CST); }
     
    301311        { __atomic_store(vp16, &v16, __ATOMIC_SEQ_CST); }
    302312        #endif
     313        { __atomic_store_n(vpp, vp, __ATOMIC_SEQ_CST); }
     314        { __atomic_store(vpp, &vp, __ATOMIC_SEQ_CST); }
    303315
    304316        { char ret; ret = __atomic_add_fetch(vp1, v1, __ATOMIC_SEQ_CST); }
  • tests/castError.cfa

    r6a9d4b4 r933f32f  
    1 //Testing some of the invalid casts of chars
     1//
     2// Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
     3//
     4// The contents of this file are covered under the licence agreement in the
     5// file "LICENCE" distributed with Cforall.
     6//
     7// castError.cfa -- test invalid casts
     8//
     9// Author           : Peter A. Buhr
     10// Created On       : Tue Feb 19 21:15:39 2019
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Tue Feb 19 21:16:44 2019
     13// Update Count     : 1
     14//
     15
    216int f;
    317
     
    721        (char)f;
    822        (int(*)())f;
     23
     24        unsigned char v;
     25        short int v;
     26        3, v;           // implicit void cast
    927}
    1028
    11 //Dummy main
    12 int main(int argc, char const *argv[])
    13 {
    14         return 0;
    15 }
     29int main() {}
     30
     31// Local Variables: //
     32// tab-width: 4 //
     33// compile-command: "cfa castError.cfa" //
     34// End: //
  • tests/completeTypeError.cfa

    r6a9d4b4 r933f32f  
    55forall(dtype T | sized(T)) void quux(T *);
    66
    7 struct A; // incomplete
    8 struct B {}; // complete
     7struct A;       // incomplete
     8struct B {};    // complete
    99
    1010int main() {
    11         int *i;
    12         void *v;
     11        int * i;
     12        void * v;
    1313
    1414        A * x;
     
    1919        // okay
    2020        *i;
    21         *x; // picks B
     21        *y;
    2222        *z;
    2323        foo(i);
     
    3232        // bad
    3333        *v;
    34         *y;
     34        *x;     // ambiguous
    3535        foo(v);
    3636        baz(v);
     
    5252void qux(T * y) {
    5353        // okay
     54        *y;
    5455        bar(y);
    5556        qux(y);
     
    5859        baz(y);
    5960        quux(y);
    60         *y;
    6161}
    6262
  • tests/concurrent/examples/boundedBufferEXT.cfa

    r6a9d4b4 r933f32f  
    11//
     2// Cforall Version 1.0.0 Copyright (C) 2018 University of Waterloo
     3//
    24// The contents of this file are covered under the licence agreement in the
    35// file "LICENCE" distributed with Cforall.
     
    810// Created On       : Wed Apr 18 22:52:12 2018
    911// Last Modified By : Peter A. Buhr
    10 // Last Modified On : Tue Dec 11 21:55:02 2018
    11 // Update Count     : 9
     12// Last Modified On : Fri Mar 22 13:41:33 2019
     13// Update Count     : 12
    1214//
    1315
    14 #include <stdlib.hfa>                                                                           // random
     16#include <stdlib.hfa>                                                                   // random
    1517#include <fstream.hfa>
    1618#include <kernel.hfa>
     
    120122// Local Variables: //
    121123// tab-width: 4 //
    122 // compile-command: "cfa boundedBufferEXT.c" //
     124// compile-command: "cfa boundedBufferEXT.cfa" //
    123125// End: //
  • tests/concurrent/examples/boundedBufferINT.cfa

    r6a9d4b4 r933f32f  
    11//
     2// Cforall Version 1.0.0 Copyright (C) 2017 University of Waterloo
     3//
    24// The contents of this file are covered under the licence agreement in the
    35// file "LICENCE" distributed with Cforall.
     
    810// Created On       : Mon Oct 30 12:45:13 2017
    911// Last Modified By : Peter A. Buhr
    10 // Last Modified On : Tue Dec 11 21:55:45 2018
    11 // Update Count     : 84
     12// Last Modified On : Fri Mar 22 13:41:52 2019
     13// Update Count     : 88
    1214//
    1315
    14 #include <stdlib.hfa>                                                                           // random
     16#include <stdlib.hfa>                                                                   // random
    1517#include <fstream.hfa>
    1618#include <kernel.hfa>
     
    121123// Local Variables: //
    122124// tab-width: 4 //
    123 // compile-command: "cfa boundedBufferINT.c" //
     125// compile-command: "cfa boundedBufferINT.cfa" //
    124126// End: //
  • tests/concurrent/examples/datingService.cfa

    r6a9d4b4 r933f32f  
    11//
     2// Cforall Version 1.0.0 Copyright (C) 2017 University of Waterloo
     3//
    24// The contents of this file are covered under the licence agreement in the
    35// file "LICENCE" distributed with Cforall.
     
    810// Created On       : Mon Oct 30 12:56:20 2017
    911// Last Modified By : Peter A. Buhr
    10 // Last Modified On : Tue Dec 11 21:55:34 2018
    11 // Update Count     : 28
     12// Last Modified On : Fri Mar 22 13:41:39 2019
     13// Update Count     : 31
    1214//
    1315
    14 #include <stdlib.hfa>                                                                           // random
     16#include <stdlib.hfa>                                                                   // random
    1517#include <fstream.hfa>
    1618#include <kernel.hfa>
     
    110112// Local Variables: //
    111113// tab-width: 4 //
    112 // compile-command: "cfa datingService.c" //
     114// compile-command: "cfa datingService.cfa" //
    113115// End: //
  • tests/concurrent/examples/matrixSum.cfa

    r6a9d4b4 r933f32f  
    1 //                               -*- Mode: C -*-
    21//
    32// Cforall Version 1.0.0 Copyright (C) 2017 University of Waterloo
     
    1110// Created On       : Mon Oct  9 08:29:28 2017
    1211// Last Modified By : Peter A. Buhr
    13 // Last Modified On : Tue Dec 11 21:54:55 2018
    14 // Update Count     : 15
     12// Last Modified On : Wed Feb 20 08:37:53 2019
     13// Update Count     : 16
    1514//
    1615
  • tests/concurrent/examples/quickSort.cfa

    r6a9d4b4 r933f32f  
     1//
     2// Cforall Version 1.0.0 Copyright (C) 2017 University of Waterloo
    13//
    24// The contents of this file are covered under the licence agreement in the
     
    911// Created On       : Wed Dec  6 12:15:52 2017
    1012// Last Modified By : Peter A. Buhr
    11 // Last Modified On : Sat Dec 22 08:44:27 2018
    12 // Update Count     : 168
     13// Last Modified On : Fri Mar 22 13:42:01 2019
     14// Update Count     : 170
    1315//
    1416
     
    178180// Local Variables: //
    179181// tab-width: 4 //
    180 // compile-command: "cfa quickSort.c" //
     182// compile-command: "cfa quickSort.cfa" //
    181183// End: //
  • tests/concurrent/waitfor/parse2.cfa

    r6a9d4b4 r933f32f  
    1010// Created On       : Wed Aug 30 17:53:29 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Aug 30 17:55:17 2017
    13 // Update Count     : 2
     12// Last Modified On : Fri Mar 22 13:42:11 2019
     13// Update Count     : 3
    1414//
    1515
     
    246246// Local Variables: //
    247247// tab-width: 4 //
    248 // compile-command: "cfa waitfor.c" //
     248// compile-command: "cfa waitfor.cfa" //
    249249// End: //
  • tests/config.py.in

    r6a9d4b4 r933f32f  
    1 #!/usr/bin/env python
     1#!/usr/bin/env python3
    22# encoding: utf-8
    33"""
  • tests/coroutine/.expect/fmtLines.txt

    r6a9d4b4 r933f32f  
    1616difi  ed B  y :   Pete  r A. 
    1717 Buh  r//   Last   Mod  ifie 
    18 d On   : T  ue D  ec 1  1 2
    19 :31:  12 2  018/  / Up  date 
    20  Cou  nt       :   32/  /#in 
     18d On   : F  ri M  ar 2  2 1
     19:41:  03 2  019/  / Up  date 
     20 Cou  nt       :   33/  /#in 
    2121clud  e <f  stre  am.h  fa># 
    2222incl  ude   <cor  outi  ne.h 
     
    7676th:   4 //  // c  ompi  le-c 
    7777omma  nd:   "cfa   fmt  Line 
    78 s.c"   ///  / En  d: /  /
     78s.cf  a" /  ///   End:   //
  • tests/coroutine/.in/fmtLines.txt

    r6a9d4b4 r933f32f  
    1010// Created On       : Sun Sep 17 21:56:15 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Dec 11 23:31:12 2018
    13 // Update Count     : 32
     12// Last Modified On : Fri Mar 22 13:41:03 2019
     13// Update Count     : 33
    1414//
    1515
     
    6464// Local Variables: //
    6565// tab-width: 4 //
    66 // compile-command: "cfa fmtLines.c" //
     66// compile-command: "cfa fmtLines.cfa" //
    6767// End: //
  • tests/coroutine/fibonacci.cfa

    r6a9d4b4 r933f32f  
    1010// Created On       : Thu Jun  8 07:29:37 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Dec 11 21:57:33 2018
    13 // Update Count     : 25
     12// Last Modified On : Fri Mar 22 13:40:35 2019
     13// Update Count     : 26
    1414//
    1515
     
    4545// Local Variables: //
    4646// tab-width: 4 //
    47 // compile-command: "cfa fibonacci.c" //
     47// compile-command: "cfa fibonacci.cfa" //
    4848// End: //
  • tests/coroutine/fibonacci_1.cfa

    r6a9d4b4 r933f32f  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // fibonacci_1.c -- 1-state finite-state machine: precomputed first two states returning f(n - 2)
     7// fibonacci_1.cfa -- 1-state finite-state machine: precomputed first two states returning f(n - 1)
    88//
    99// Author           : Peter A. Buhr
    1010// Created On       : Thu Apr 26 23:20:08 2018
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Dec 11 21:57:54 2018
    13 // Update Count     : 14
     12// Last Modified On : Thu Mar 21 08:10:45 2019
     13// Update Count     : 25
    1414//
    1515
     
    1717#include <coroutine.hfa>
    1818
    19 coroutine Fibonacci { int ret; };                                               // used for communication
     19coroutine Fibonacci { int fn1; };                                               // used for communication
    2020
    2121void main( Fibonacci & fib ) with( fib ) {                              // called on first resume
    22         int fn, fn1 = 1, fn2 = 0;                                                       // precompute first two states
     22        int fn;
     23        [fn1, fn] = [0, 1];                                                                     // precompute first two states
    2324        for () {
    24                 ret = fn2;
    25                 fn = fn1 + fn2;  fn2 = fn1;  fn1 = fn;                  // general case
    2625                suspend();                                                                              // restart last resume
     26                [fn1, fn] = [fn, fn1 + fn];                                             // general case
    2727        } // for
    2828}
     
    3030int next( Fibonacci & fib ) with( fib ) {
    3131        resume( fib );                                                                          // restart last suspend
    32         return ret;
     32        return fn1;
    3333}
    3434
     
    4242// Local Variables: //
    4343// tab-width: 4 //
    44 // compile-command: "cfa fibonacci_1.c" //
     44// compile-command: "cfa fibonacci_1.cfa" //
    4545// End: //
  • tests/coroutine/fmtLines.cfa

    r6a9d4b4 r933f32f  
    1010// Created On       : Sun Sep 17 21:56:15 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Dec 22 18:27:00 2018
    13 // Update Count     : 57
     12// Last Modified On : Fri Mar 22 13:41:16 2019
     13// Update Count     : 58
    1414//
    1515
     
    6363// Local Variables: //
    6464// tab-width: 4 //
    65 // compile-command: "cfa fmtLines.c" //
     65// compile-command: "cfa fmtLines.cfa" //
    6666// End: //
  • tests/coroutine/pingpong.cfa

    r6a9d4b4 r933f32f  
    1010// Created On       : Wed Sep 20 11:55:23 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Dec 11 21:58:06 2018
    13 // Update Count     : 29
     12// Last Modified On : Tue Mar 26 17:54:14 2019
     13// Update Count     : 35
    1414//
    1515
     
    2020        const char * name;
    2121        /* const */ unsigned int N;
    22         PingPong * part;
     22        PingPong & part;
    2323};
    2424
    2525void ?{}( PingPong & this, const char * name, unsigned int N, PingPong & part ) {
    26         (this.__cor){name};
    27         this.name = name;
    28         this.N = N;
    29         this.part = &part;
     26        this.[name, N] = [name, N];  &this.part = &part;
    3027}
    3128void ?{}( PingPong & this, const char * name, unsigned int N ) {
    32         this{ name, N, *(PingPong *)0 };
     29        this{ name, N, *0p };                                                           // call first constructor
    3330}
    3431void cycle( PingPong & pingpong ) {
     
    3633}
    3734void partner( PingPong & this, PingPong & part ) {
    38         this.part = &part;
     35        &this.part = &part;
    3936        resume( this );
    4037}
    41 void main( PingPong & pingpong ) {                                              // ping's starter ::main, pong's starter ping
    42         for ( pingpong.N ) {                                                            // N ping-pongs
    43                 sout | pingpong.name;
    44                 cycle( *pingpong.part );
     38void main( PingPong & pingpong ) with(pingpong) {               // ping's starter ::main, pong's starter ping
     39        for ( N ) {                                                                                     // N ping-pongs
     40                sout | name;
     41                cycle( part );
    4542        } // for
    4643}
     
    5350// Local Variables: //
    5451// tab-width: 4 //
    55 // compile-command: "cfa pingpong.c" //
     52// compile-command: "cfa pingpong.cfa" //
    5653// End: //
  • tests/coroutine/prodcons.cfa

    r6a9d4b4 r933f32f  
    1010// Created On       : Mon Sep 18 12:23:39 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Dec 12 23:04:49 2018
    13 // Update Count     : 53
     12// Last Modified On : Fri Mar 22 13:41:10 2019
     13// Update Count     : 54
    1414//
    1515
     
    9191// Local Variables: //
    9292// tab-width: 4 //
    93 // compile-command: "cfa prodcons.c" //
     93// compile-command: "cfa prodcons.cfa" //
    9494// End: //
  • tests/coroutine/runningTotal.cfa

    r6a9d4b4 r933f32f  
    1010// Created On       : Wed Dec  6 08:05:27 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Dec 11 21:59:00 2018
    13 // Update Count     : 4
     12// Last Modified On : Fri Mar 22 13:40:49 2019
     13// Update Count     : 5
    1414//
    1515
     
    4848// Local Variables: //
    4949// tab-width: 4 //
    50 // compile-command: "cfa runningTotal.c" //
     50// compile-command: "cfa runningTotal.cfa" //
    5151// End: //
  • tests/declarationSpecifier.cfa

    r6a9d4b4 r933f32f  
    1010// Created On       : Wed Aug 17 08:21:04 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Nov  6 17:52:59 2018
    13 // Update Count     : 3
     12// Last Modified On : Tue Apr 30 18:20:36 2019
     13// Update Count     : 4
    1414//
    1515
     
    8989
    9090//Dummy main
    91 int main(int argc, char const *argv[])
    92 {
    93         return 0;
    94 }
     91int main( int argc, char const * argv[] ) {}
    9592
    9693// Local Variables: //
  • tests/forall.cfa

    r6a9d4b4 r933f32f  
    1010// Created On       : Wed May  9 08:48:15 2018
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Nov  6 17:53:43 2018
    13 // Update Count     : 31
     12// Last Modified On : Tue Mar 19 08:29:38 2019
     13// Update Count     : 32
    1414//
    1515
     
    5353        right = temp;
    5454}
    55 
    56 void ?{}( int & c, zero_t ) { c = 0; }                                  // not in prelude
    5755
    5856trait sumable( otype T ) {
  • tests/function-operator.cfa

    r6a9d4b4 r933f32f  
    1010// Created On       : Fri Aug 25 15:21:11 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Dec  4 21:37:09 2018
    13 // Update Count     : 9
     12// Last Modified On : Thu Apr 11 18:27:45 2019
     13// Update Count     : 10
    1414//
    1515
     
    6262
    6363// test ?()(T, ...) -- ?() with function call-by-reference
    64 forall(otype Generator, otype GenRet | { GenRet ?()(Generator &); }, dtype Iter, otype T| Iterator(Iter, T) | Assignable(T, GenRet))
     64forall(otype Generator, otype GenRet | { GenRet ?()(Generator &); }, dtype Iter, otype T | Iterator(Iter, T) | Assignable(T, GenRet))
    6565void generate(Iter first, Iter last, Generator & gen) {
    6666        int i = 0;
  • tests/io1.cfa

    r6a9d4b4 r933f32f  
    1010// Created On       : Wed Mar  2 16:56:02 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Dec 21 16:02:55 2018
    13 // Update Count     : 114
     12// Last Modified On : Mon Mar  4 21:42:47 2019
     13// Update Count     : 115
    1414//
    1515
     
    1919        int x = 3, y = 5, z = 7;
    2020        sout | x * 3 | y + 1 | z << 2 | x == y | (x | y) | (x || y) | (x > z ? 1 : 2);
    21         sout | 1 | 2 | 3;
    22         sout | '1' | '2' | '3';
    23         sout | 1 | "" | 2 | "" | 3;
     21        sout | 0 | 1 | 2 | 3;
     22        sout | '0' | '1' | '2' | '3';
     23        sout | 0 | "" | 1 | "" | 2 | "" | 3;
    2424        sout | nl;
    2525
  • tests/io2.cfa

    r6a9d4b4 r933f32f  
    1010// Created On       : Wed Mar  2 16:56:02 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Dec 21 08:20:14 2018
    13 // Update Count     : 112
     12// Last Modified On : Thu Apr 18 08:03:30 2019
     13// Update Count     : 113
    1414//
    1515
     
    9797        sout | 1 | sepOff | 2 | 3;                                                      // locally turn off implicit separator
    9898        sout | sepOn | sepOn | 1 | 2 | 3 | sepOn | sepOff | sepOn | '\n' | nonl; // no separator at start/end of line
    99         sout | 1 | 2 | 3 | "\n\n" | sepOn | nonl;                                       // no separator at start of next line
     99        sout | 1 | 2 | 3 | "\n\n" | sepOn | nonl;                       // no separator at start of next line
    100100        sout | 1 | 2 | 3;
    101101        sout | nl;
  • tests/literals.cfa

    r6a9d4b4 r933f32f  
    1010// Created On       : Sat Sep  9 16:34:38 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Dec  4 21:44:01 2018
    13 // Update Count     : 139
    14 //
    15 
     12// Last Modified On : Tue Feb 12 08:07:39 2019
     13// Update Count     : 224
     14//
     15
     16#include <features.h>                                                                   // __GNUC_PREREQ
    1617#ifdef __CFA__
    17 #include <stdint.h>
    1818#include <fstream.hfa>
    1919
     
    151151        -0X0123456789.0123456789P-09;  -0X0123456789.0123456789P-09f;  -0X0123456789.0123456789P-09l;  -0X0123456789.0123456789P-09F;  -0X0123456789.0123456789P-09L;
    152152
     153#if defined(__GNUC__) && __GNUC_PREREQ(7,0)                             // gcc version >= 7
     154// floating with length, gcc f16/f128x unsupported and no prelude code for any _FloatXXx, so they work by conversion to long double
     155
     156        /*  0123456789.f16; */   0123456789.f32;   0123456789.f32x;   0123456789.f64;   0123456789.f64x;   0123456789.W;   0123456789.f128;   0123456789.q;  /*  0123456789.f128x; */
     157        /* +0123456789.f16; */  +0123456789.f32;  +0123456789.f32x;  +0123456789.f64;  +0123456789.f64x;  +0123456789.w;  +0123456789.f128;  +0123456789.Q;  /* +0123456789.f128x; */
     158        /* -0123456789.f16; */  -0123456789.f32;  -0123456789.f32x;  -0123456789.f64;  -0123456789.f64x;  -0123456789.W;  -0123456789.f128;  -0123456789.q;  /* -0123456789.f128x; */
     159
     160        /*  0123456789.e09F16; */    0123456789.e09F32;    0123456789.e09F32x;    0123456789.e09F64;    0123456789.e09F64x;    0123456789.e09W;    0123456789.e09F128;    0123456789.e09q;   /*  .0123456789e09q; */
     161        /* +0123456789.e+09F16; */  +0123456789.e+09F32;  +0123456789.e+09F32x;  +0123456789.e+09F64;  +0123456789.e+09F64x;  +0123456789.e+09w;  +0123456789.e+09F128;  +0123456789.e+09Q;  /* +.0123456789E+09Q; */
     162        /* -0123456789.e-09F16; */  -0123456789.e-09F32;  -0123456789.e-09F32x;  -0123456789.e-09F64;  -0123456789.e-09F64x;  -0123456789.e-09W;  -0123456789.e-09F128;  -0123456789.e-09q;  /* -.0123456789E-09q; */
     163
     164        /*  .0123456789e09F16; */    .0123456789e09F32;    .0123456789e09F32x;    .0123456789e09F64;    .0123456789e09F64x;    .0123456789e09W;    .0123456789e09F128;    .0123456789e09q;   /*  .0123456789e09q; */
     165        /* +.0123456789e+09F16; */  +.0123456789e+09F32;  +.0123456789e+09F32x;  +.0123456789e+09F64;  +.0123456789e+09F64x;  +.0123456789e+09w;  +.0123456789e+09F128;  +.0123456789e+09Q;  /* +.0123456789E+09Q; */
     166        /* -.0123456789e-09F16; */  -.0123456789e-09F32;  -.0123456789e-09F32x;  -.0123456789e-09F64;  -.0123456789e-09F64x;  -.0123456789e-09W;  -.0123456789e-09F128;  -.0123456789e-09q;  /* -.0123456789E-09q; */
     167
     168        /*  0123456789.0123456789F16; */   0123456789.0123456789F32;   0123456789.0123456789F32x;   0123456789.0123456789F64;   0123456789.0123456789F64x;   0123456789.0123456789W;   0123456789.0123456789F128;   0123456789.0123456789q;  /*  0123456789.0123456789q; */
     169        /* +0123456789.0123456789F16; */  +0123456789.0123456789F32;  +0123456789.0123456789F32x;  +0123456789.0123456789F64;  +0123456789.0123456789F64x;  +0123456789.0123456789w;  +0123456789.0123456789F128;  +0123456789.0123456789Q;  /* +0123456789.0123456789Q; */
     170        /* -0123456789.0123456789F16; */  -0123456789.0123456789F32;  -0123456789.0123456789F32x;  -0123456789.0123456789F64;  -0123456789.0123456789F64x;  -0123456789.0123456789W;  -0123456789.0123456789F128;  -0123456789.0123456789q;  /* -0123456789.0123456789q; */
     171
     172        /*  0123456789.0123456789E09F16; */    0123456789.0123456789E09F32;    0123456789.0123456789E09F32x;    0123456789.0123456789E09F64;    0123456789.0123456789E09F64x;    0123456789.0123456789E09W;    0123456789.0123456789E09F128;    0123456789.0123456789E09q;   /*  0123456789.0123456789E09q; */
     173        /* +0123456789.0123456789E+09F16; */  +0123456789.0123456789E+09F32;  +0123456789.0123456789E+09F32x;  +0123456789.0123456789E+09F64;  +0123456789.0123456789E+09F64x;  +0123456789.0123456789E+09w;  +0123456789.0123456789E+09F128;  +0123456789.0123456789E+09Q;  /* +0123456789.0123456789E+09Q; */
     174        /* -0123456789.0123456789E-09F16; */  -0123456789.0123456789E-09F32;  -0123456789.0123456789E-09F32x;  -0123456789.0123456789E-09F64;  -0123456789.0123456789E-09F64x;  -0123456789.0123456789E-09W;  -0123456789.0123456789E-09F128;  -0123456789.0123456789E-09q;  /* -0123456789.0123456789E-09q; */
     175
     176        /*  0x123456789.p09f16; */    0x123456789.p09f32;    0x123456789.p09f32x;    0x123456789.p09f64;    0x123456789.p09f64x;    0x123456789.p09W;    0x123456789.p09f128;    0x123456789.p09q;   /*  0x123456789.p09f128x; */
     177        /* +0x123456789.P+09f16; */  +0x123456789.P+09f32;  +0x123456789.P+09f32x;  +0x123456789.P+09f64;  +0x123456789.P+09f64x;  +0x123456789.P+09w;  +0x123456789.P+09f128;  +0x123456789.P+09Q;  /* +0x123456789.P+09f128x; */
     178        /* -0x123456789.P-09f16; */  -0x123456789.P-09f32;  -0x123456789.P-09f32x;  -0x123456789.P-09f64;  -0x123456789.P-09f64x;  -0x123456789.P-09W;  -0x123456789.P-09f128;  -0x123456789.P-09q;  /* -0x123456789.P-09f128x; */
     179
     180        /*  0x123456789.p09F16; */    0x123456789.p09F32;    0x123456789.p09F32x;    0x123456789.p09F64;    0x123456789.p09F64x;    0x123456789.p09W;    0x123456789.p09F128;    0x123456789.p09q;   /*  .0123456789p09q; */
     181        /* +0x123456789.p+09F16; */  +0x123456789.p+09F32;  +0x123456789.p+09F32x;  +0x123456789.p+09F64;  +0x123456789.p+09F64x;  +0x123456789.p+09w;  +0x123456789.p+09F128;  +0x123456789.p+09Q;  /* +.0123456789p+09Q; */
     182        /* -0x123456789.p-09F16; */  -0x123456789.p-09F32;  -0x123456789.p-09F32x;  -0x123456789.p-09F64;  -0x123456789.p-09F64x;  -0x123456789.p-09W;  -0x123456789.p-09F128;  -0x123456789.p-09q;  /* -.0123456789P-09q; */
     183
     184        /*  0X.0123456789p09F16; */    0X.0123456789p09F32;    0X.0123456789p09F32x;    0X.0123456789p09F64;    0X.0123456789p09F64x;    0X.0123456789p09W;    0X.0123456789p09F128;    0X.0123456789p09q;   /*  0X.0123456789p09q; */
     185        /* +0X.0123456789p+09F16; */  +0X.0123456789p+09F32;  +0X.0123456789p+09F32x;  +0X.0123456789p+09F64;  +0X.0123456789p+09F64x;  +0X.0123456789p+09w;  +0X.0123456789p+09F128;  +0X.0123456789p+09Q;  /* +0X.0123456789p+09Q; */
     186        /* -0X.0123456789p-09F16; */  -0X.0123456789p-09F32;  -0X.0123456789p-09F32x;  -0X.0123456789p-09F64;  -0X.0123456789p-09F64x;  -0X.0123456789p-09W;  -0X.0123456789p-09F128;  -0X.0123456789p-09q;  /* -0X.0123456789P-09q; */
     187
     188        /*  0x123456789.0123456789P09F16; */    0x123456789.0123456789P09F32;    0x123456789.0123456789P09F32x;    0x123456789.0123456789P09F64;    0x123456789.0123456789P09F64x;    0x123456789.0123456789P09W;    0x123456789.0123456789P09F128;    0x123456789.0123456789P09q;   /*  0x123456789.0123456789P09q; */
     189        /* +0x123456789.0123456789P+09F16; */  +0x123456789.0123456789P+09F32;  +0x123456789.0123456789P+09F32x;  +0x123456789.0123456789P+09F64;  +0x123456789.0123456789P+09F64x;  +0x123456789.0123456789P+09w;  +0x123456789.0123456789P+09F128;  +0x123456789.0123456789P+09Q;  /* +0x123456789.0123456789P+09Q; */
     190        /* -0x123456789.0123456789p-09F16; */  -0x123456789.0123456789p-09F32;  -0x123456789.0123456789p-09F32x;  -0x123456789.0123456789p-09F64;  -0x123456789.0123456789p-09F64x;  -0x123456789.0123456789p-09W;  -0x123456789.0123456789p-09F128;  -0x123456789.0123456789p-09q;  /* -0x123456789.0123456789p-09q; */
     191
     192        /*  0x123456789.0123456789P09F16; */    0x123456789.0123456789P09F32;    0x123456789.0123456789P09F32x;    0x123456789.0123456789P09F64;    0x123456789.0123456789P09F64x;    0x123456789.0123456789P09W;    0x123456789.0123456789P09F128;    0x123456789.0123456789P09q;   /*  0x123456789.0123456789P09q; */
     193        /* +0x123456789.0123456789p+09F16; */  +0x123456789.0123456789p+09F32;  +0x123456789.0123456789p+09F32x;  +0x123456789.0123456789p+09F64;  +0x123456789.0123456789p+09F64x;  +0x123456789.0123456789p+09w;  +0x123456789.0123456789p+09F128;  +0x123456789.0123456789p+09Q;  /* +0x123456789.0123456789p+09Q; */
     194        /* -0x123456789.0123456789P-09F16; */  -0x123456789.0123456789P-09F32;  -0x123456789.0123456789P-09F32x;  -0x123456789.0123456789P-09F64;  -0x123456789.0123456789P-09F64x;  -0x123456789.0123456789P-09W;  -0x123456789.0123456789P-09F128;  -0x123456789.0123456789P-09q;  /* -0x123456789.0123456789P-09q; */
     195#endif // __GNUC_PREREQ(7,0)
     196
    153197#ifdef __CFA__
    154198// fixed-size length
     
    167211        // octal
    168212         01234567_l8;   01234567_l16;   01234567_l32;   01234567_l64;   01234567_l8u;   01234567_ul16;   01234567_l32u;   01234567_ul64;
    169         +01234567_l8;  +01234567_l16;  +01234567_l32;  +01234567_l64;  +01234567_l8u;  +01234567_ul16;  +01234567_l32u;  +01234567_ul64;
     213        +01234567_l8;  +01234567_l16;  +01234567_l32;  +01234567_l64;  +01234567_ul8;  +01234567_ul16;  +01234567_l32u;  +01234567_ul64;
    170214        -01234567_l8;  -01234567_l16;  -01234567_l32;  -01234567_l64;  -01234567_l8u;  -01234567_ul16;  -01234567_l32u;  -01234567_ul64;
    171215
     
    203247        +0X0123456789ABCDEF_l8;  +0X0123456789ABCDEF_l16;  +0X0123456789ABCDEFl32;  +0X0123456789ABCDEFl64;  +0X0123456789ABCDEF_ul8;  +0X0123456789ABCDEF_l16u;  +0X0123456789ABCDEFul32;  +0X0123456789ABCDEFl64u;
    204248        -0X0123456789ABCDEF_l8;  -0X0123456789ABCDEF_l16;  -0X0123456789ABCDEFl32;  -0X0123456789ABCDEFl64;  -0X0123456789ABCDEF_ul8;  -0X0123456789ABCDEF_l16u;  -0X0123456789ABCDEFul32;  -0X0123456789ABCDEFl64u;
    205 
    206         // floating
    207          0123456789.l32;   0123456789.l64;   0123456789.l80;   0123456789.l128;
    208         +0123456789.l32;  +0123456789.l64;  +0123456789.l80;  +0123456789.l128;
    209         -0123456789.l32;  -0123456789.l64;  -0123456789.l80;  -0123456789.l128;
    210 
    211          0123456789.e09L32;    0123456789.e09L64;    0123456789.e09L80;    0123456789.e09L128;
    212         +0123456789.e+09L32;  +0123456789.e+09L64;  +0123456789.e+09L80;  +0123456789.e+09L128;
    213         -0123456789.e-09L32;  -0123456789.e-09L64;  -0123456789.e-09L80;  -0123456789.e-09L128;
    214 
    215          .0123456789e09L32;    .0123456789e09L64;    .0123456789e09L80;    .0123456789e09L128;
    216         +.0123456789E+09L32;  +.0123456789E+09L64;  +.0123456789E+09L80;  +.0123456789E+09L128;
    217         -.0123456789E-09L32;  -.0123456789E-09L64;  -.0123456789E-09L80;  -.0123456789E-09L128;
    218 
    219          0123456789.0123456789L32;       0123456789.0123456789L64;       0123456789.0123456789L80;       0123456789.0123456789L128;
    220         +0123456789.0123456789E09L32;   +0123456789.0123456789E09L64;   +0123456789.0123456789E09L80;   +0123456789.0123456789E09L128;
    221         -0123456789.0123456789E+09L32;  -0123456789.0123456789E+09L64;  -0123456789.0123456789E+09L80;  -0123456789.0123456789E+09L128;
    222          0123456789.0123456789E-09L32;   0123456789.0123456789E-09L64;   0123456789.0123456789E-09L80;   0123456789.0123456789E-09L128;
    223 
    224          0x0123456789.p09l32;   0x0123456789.p09l64;   0x0123456789.p09l80;   0x0123456789.p09l128;
    225         +0x0123456789.p09l32;  +0x0123456789.p09l64;  +0x0123456789.p09l80;  +0x0123456789.p09l128;
    226         -0x0123456789.p09l32;  -0x0123456789.p09l64;  -0x0123456789.p09l80;  -0x0123456789.p09l128;
    227 
    228          0x0123456789.p+09l32;   0x0123456789.p+09L64;   0x0123456789.p+09L80;   0x0123456789.p+09L128;
    229         +0x0123456789.p-09l32;  +0x0123456789.p-09L64;  +0x0123456789.p-09L80;  +0x0123456789.p-09L128;
    230         -0x.0123456789p09l32;   -0x.0123456789p09L64;   -0x.0123456789p09L80;   -0x.0123456789p09L128;
    231249
    232250// char, short, int suffix overloading
  • tests/loopctrl.cfa

    r6a9d4b4 r933f32f  
    1010// Created On       : Wed Aug  8 18:32:59 2018
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Dec 23 23:00:29 2018
    13 // Update Count     : 79
     12// Last Modified On : Sat Apr 13 11:03:09 2019
     13// Update Count     : 104
    1414//
    1515
     
    5454        for ( i; 5.5 -~ 0.5 ) { sout | i; }                                     sout | nl;
    5555        for ( ui; 2u ~= 10u ~ 2u ) { sout | ui; }                       sout | nl;
    56         for ( ui; 10u -~= 2u ~ 2u ) { sout | ui; }                      sout | nl | nl | nl;
     56        for ( ui; 10u -~= 2u ~ 2u ) { sout | ui; }                      sout | nl | nl;
    5757
     58        // @ means do nothing
     59        for ( i; 1 ~ @ ) {
     60          if ( i > 10 ) break;
     61                sout | i;
     62        }                                                                                                       sout | nl;
     63        for ( i; 10 -~ @ ) {
     64          if ( i < 0 ) break;
     65                sout | i;
     66        }                                                                                                       sout | nl;
     67        for ( i; 2 ~ @ ~ 2 ) {
     68          if ( i > 10 ) break;
     69                sout | i;
     70        }                                                                                                       sout | nl;
     71        for ( i; 2.1 ~ @ ~ @ ) {
     72          if ( i > 10.5 ) break;
     73                sout | i;
     74                i += 1.7;
     75        }                                                                                                       sout | nl;
     76        for ( i; 10 -~ @ ~ 2 ) {
     77          if ( i < 0 ) break;
     78                sout | i;
     79        }                                                                                                       sout | nl;
     80        for ( i; 12.1 ~ @ ~ @ ) {
     81          if ( i < 2.5 ) break;
     82                sout | i;
     83                i -= 1.7;
     84        }                                                                                                       sout | nl | nl;
     85       
    5886        enum { N = 10 };
    5987        for ( N ) { sout | "N"; }                                                       sout | nl;
    6088        for ( i; N ) { sout | i; }                                                      sout | nl;
    61         for ( i; N -~ 0 ) { sout | i; }                                         sout | nl | nl | nl;
     89        for ( i; N -~ 0 ) { sout | i; }                                         sout | nl | nl;
    6290
    6391        const int start = 3, comp = 10, inc = 2;
    6492        for ( i; start ~ comp ~ inc + 1 ) { sout | i; }         sout | nl | nl;
    6593
    66         sout | nl;
    6794        for ( S s = (S){0}; s < (S){10,10}; s += (S){1} ) { sout | s; } sout | nl;
    6895        for ( s; (S){10,10} ) { sout | s; } sout | nl;
     
    76103        for ( s; (S){10,10} -~ (S){0} ~ (S){1} ) { sout | s; } sout | nl;
    77104        for ( s; (S){10,10} -~= (S){0} ) { sout | s; }           sout | nl;
    78         for ( s; (S){10,10} -~= (S){0} ~ (S){1} ) { sout | s; } sout | nl;
     105        for ( s; (S){10,10} -~= (S){0} ~ (S){1} ) { sout | s; } sout | nl | nl;
     106
     107        for ( i; 10 : j; -5 ~ @ ) { sout | i | j; } sout | nl;
     108        for ( i; 10 : j; -5 -~ @ ) { sout | i | j; } sout | nl;
     109        for ( i; 10 : j; -5 ~ @ ~ 2 ) { sout | i | j; } sout | nl;
     110        for ( i; 10 : j; -5 -~ @ ~ 2 ) { sout | i | j; } sout | nl | nl;
     111
     112        for ( j; -5 ~ @ : i; 10 ) { sout | i | j; } sout | nl;
     113        for ( j; -5 -~ @ : i; 10 ) { sout | i | j; } sout | nl;
     114        for ( j; -5 ~ @ ~ 2 : i; 10 ) { sout | i | j; } sout | nl;
     115        for ( j; -5 -~ @ ~ 2 : i; 10 ) { sout | i | j; } sout | nl | nl;
     116
     117        for ( j; -5 -~ @ ~ 2 : i; 10 : k; 1.5 ~ @ ) { sout | i | j | k; } sout | nl;
     118        for ( j; -5 -~ @ ~ 2 : k; 1.5 ~ @ : i; 10 ) { sout | i | j | k; } sout | nl;
     119        for ( k; 1.5 ~ @ : j; -5 -~ @ ~ 2 : i; 10 ) { sout | i | j | k; } sout | nl;
    79120}
    80121
  • tests/math1.cfa

    r6a9d4b4 r933f32f  
    1010// Created On       : Fri Apr 22 14:59:21 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Dec 12 16:28:49 2018
    13 // Update Count     : 89
     12// Last Modified On : Mon Mar 25 22:56:47 2019
     13// Update Count     : 109
    1414//
    1515
     
    4949        unsigned int e = 2;
    5050    b \= e;
    51     sout | "\\" | b | b \ e;
    52     sout | "\\" | 'a' \ 3u | 2 \ 8u | 4 \ 3u | -4 \ 3u | nonl;
     51    sout | b | "\\" | e | "= " | b \ e;
     52    sout | 'a' \ 3 | 2 \ 8 | 4 \ 3 | -4 \ 3 | 4 \ -3 | -4 \ -3;
     53        sout | 4.0 \ -3 | -4.0 \ -3 | 4.0 \ 2.1 | (1.0f+2.0fi) \ (3.0f+2.0fi);
    5354        sout | 4 \ -3 | -4 \ -3 | 4.0 \ 2.1 | (1.0f+2.0fi) \ (3.0f+2.0fi);
     55
     56        struct S { int i; };
     57        double ?*?( double d, S s ) { return d * s.i; }
     58        double ?/?( double d, S s ) { return d / s.i; }
     59        S ?\?( S s, unsigned long y ) { return (S){ s.i \ y }; }
     60        ofstream & ?|?( ofstream & os, S s ) { return os | s.i; }
     61        void ?|?( ofstream & os, S s ) { (ofstream &)(os | s); nl( os ); }
     62        S s = { 4 };
     63        S x = s \ 2;
     64        sout | x;
     65        sout | s.i | s \ 2u;
    5466} // main
    5567
  • tests/numericConstants.cfa

    r6a9d4b4 r933f32f  
    1010// Created On       : Wed May 24 22:10:36 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Nov  6 17:59:53 2018
    13 // Update Count     : 3
     12// Last Modified On : Tue Feb  5 08:58:16 2019
     13// Update Count     : 5
    1414//
    1515
     
    6767// Local Variables: //
    6868// tab-width: 4 //
    69 // compile-command: "cfa minmax.cfa" //
     69// compile-command: "cfa numericConstants.cfa" //
    7070// End: //
  • tests/pybin/settings.py

    r6a9d4b4 r933f32f  
    1 from __future__ import print_function
    2 
    31import os
     2import subprocess
    43import sys
    5 import tools
     4from . import tools
    65
    76try :
     
    3938        def __init__(self, arch):
    4039                try:
    41                         canonical_host = Architecture.makeCanonical( config.HOSTARCH )
     40                        canonical_host = Architecture.make_canonical( config.HOSTARCH )
    4241                except KeyError:
    4342                        print("Unkown host architecture %s" % config.HOSTARCH, file=sys.stderr)
     
    4645                if arch:
    4746                        try:
    48                                 arch = Architecture.makeCanonical( arch )
     47                                arch = Architecture.make_canonical( arch )
    4948                        except KeyError:
    5049                                print("Unkown architecture %s" % arch, file=sys.stderr)
     
    7776
    7877        @classmethod
    79         def makeCanonical(_, arch):
     78        def make_canonical(_, arch):
    8079                return Architecture.KnownArchitectures[arch]
    8180
     
    8483        def __init__(self, value):
    8584                self.string = "debug" if value else "no debug"
    86                 self.flags  = """DEBUG_FLAGS="%s" """ % ("-debug -O0" if value else "-nodebug -O2")
     85                self.flags  = """DEBUG_FLAGS=%s""" % ("-debug -O0" if value else "-nodebug -O2")
    8786
    8887class Install:
    8988        def __init__(self, value):
    9089                self.string = "installed" if value else "in-tree"
    91                 self.flags  = """INSTALL_FLAGS="%s" """ % ("" if value else "-in-tree")
     90                self.flags  = """INSTALL_FLAGS=%s""" % ("" if value else "-in-tree")
    9291
    9392class Timeouts:
     
    112111        global install
    113112        global timeout
     113        global output_width
    114114
    115         dry_run    = options.dry_run
    116         generating = options.regenerate_expected
    117         make       = 'make'
    118         debug        = Debug(options.debug)
    119         install    = Install(options.install)
    120         arch       = Architecture(options.arch)
    121         timeout    = Timeouts(options.timeout, options.global_timeout)
     115        dry_run      = options.dry_run
     116        generating   = options.regenerate_expected
     117        make         = ['make']
     118        debug        = Debug(options.debug)
     119        install      = Install(options.install)
     120        arch         = Architecture(options.arch)
     121        timeout      = Timeouts(options.timeout, options.global_timeout)
     122        output_width = 24
    122123
    123124
    124 def updateMakeCmd(force, jobs):
     125def update_make_cmd(force, jobs):
    125126        global make
    126127
    127         make = "make" if not force else ("make -j%i" % jobs)
     128        make = ['make'] if not force else ['make', "-j%i" % jobs]
    128129
    129130def validate():
    130131        errf = os.path.join(BUILDDIR, ".validate.err")
    131         make_ret, _ = tools.make( ".validate", error_file = errf, redirects  = "2> /dev/null 1> /dev/null", )
     132        make_ret, out = tools.make( ".validate", error_file = errf, output=subprocess.DEVNULL, error=subprocess.DEVNULL )
    132133        if make_ret != 0:
    133134                with open (errf, "r") as myfile:
     
    139140
    140141        tools.rm(errf)
     142
     143def prep_output(tests):
     144        global output_width
     145        output_width = max(map(lambda t: len(t.target()), tests))
  • tests/pybin/test_run.py

    r6a9d4b4 r933f32f  
    44
    55import pybin.settings
    6 import datetime
    7 
    8 from string import Template
    9 
    10 class DeltaTemplate(Template):
    11     delimiter = "%"
    12 
    13 def strfdelta(tdelta, fmt):
    14     d["H"], rem = divmod(tdelta.seconds, 3600)
    15     d["M"], d["S"] = divmod(rem, 60)
    16     t = DeltaTemplate(fmt)
    17     return t.substitute(**d)
    186
    197# Test class that defines what a test is
  • tests/pybin/tools.py

    r6a9d4b4 r933f32f  
    1 from __future__ import print_function
    2 
    31import __main__
    42import argparse
     3import contextlib
    54import fileinput
    65import multiprocessing
     
    109import signal
    1110import stat
     11import subprocess
    1212import sys
     13import tempfile
    1314import time
     15import types
    1416
    1517from pybin import settings
    16 from subprocess import Popen, PIPE, STDOUT
    1718
    1819################################################################################
     
    2122
    2223# helper functions to run terminal commands
    23 def sh(cmd, print2stdout = True, input = None):
    24         # add input redirection if needed
    25         if input and os.path.isfile(input):
    26                 cmd += " < %s" % input
     24def sh(*cmd, timeout = False, output = None, input = None, error = subprocess.STDOUT):
     25        cmd = list(cmd)
    2726
    2827        # if this is a dry_run, only print the commands that would be ran
    2928        if settings.dry_run :
    30                 print("cmd: %s" % cmd)
     29                cmd = "{} cmd: {}".format(os.getcwd(), ' '.join(cmd))
     30                if output and not isinstance(output, int):
     31                        cmd += " > "
     32                        cmd += output
     33
     34                if error and not isinstance(error, int):
     35                        cmd += " 2> "
     36                        cmd += error
     37
     38                if input and not isinstance(input, int) and os.path.isfile(input):
     39                        cmd += " < "
     40                        cmd += input
     41
     42                print(cmd)
    3143                return 0, None
    3244
    33         # otherwise create a pipe and run the desired command
    34         else :
    35                 proc = Popen(cmd, stdout=None if print2stdout else PIPE, stderr=STDOUT, shell=True)
    36                 out, err = proc.communicate()
    37                 return proc.returncode, out
     45        with contextlib.ExitStack() as onexit:
     46                # add input redirection if needed
     47                input = openfd(input, 'r', onexit, True)
     48
     49                # add output redirection if needed
     50                output = openfd(output, 'w', onexit, False)
     51
     52                # add error redirection if needed
     53                error = openfd(error, 'w', onexit, False)
     54
     55                # run the desired command
     56                try:
     57                        proc = subprocess.run(
     58                                cmd,
     59                                stdin =input,
     60                                stdout=output,
     61                                stderr=error,
     62                                timeout=settings.timeout.single if timeout else None
     63                        )
     64                        return proc.returncode, proc.stdout.decode("utf-8") if proc.stdout else None
     65                except subprocess.TimeoutExpired:
     66                        return 124, str(None)
    3867
    3968def is_ascii(fname):
     
    4574                return False
    4675
    47         code, out = sh("file %s" % fname, print2stdout = False)
     76        code, out = sh("file %s" % fname, output=subprocess.PIPE)
    4877        if code != 0:
    4978                return False
     
    5685        return match.group(1).startswith("ASCII text")
    5786
     87def is_exe(fname):
     88        return os.path.isfile(fname) and os.access(fname, os.X_OK)
     89
     90def openfd(file, mode, exitstack, checkfile):
     91        if not file:
     92                return file
     93
     94        if isinstance(file, int):
     95                return file
     96
     97        if checkfile and not os.path.isfile(file):
     98                return None
     99
     100        file = open(file, mode)
     101        exitstack.push(file)
     102        return file
     103
    58104# Remove 1 or more files silently
    59105def rm( files ):
    60         if isinstance( files, basestring ):
    61                 sh("rm -f %s > /dev/null 2>&1" % files )
    62         else:
    63                 for file in files:
    64                         sh("rm -f %s > /dev/null 2>&1" % file )
     106        if isinstance(files, str ): files = [ files ]
     107        for file in files:
     108                sh( 'rm', '-f', file, output=subprocess.DEVNULL, error=subprocess.DEVNULL )
    65109
    66110# Create 1 or more directory
    67111def mkdir( files ):
    68         if isinstance( files, basestring ):
    69                 sh("mkdir -p %s" % os.path.dirname(files) )
    70         else:
    71                 for file in files:
    72                         sh("mkdir -p %s" % os.path.dirname(file) )
     112        if isinstance(files, str ): files = [ files ]
     113        for file in files:
     114                p = os.path.normpath( file )
     115                d = os.path.dirname ( p )
     116                sh( 'mkdir', '-p', d, output=subprocess.DEVNULL, error=subprocess.DEVNULL )
    73117
    74118
     
    80124# diff two files
    81125def diff( lhs, rhs ):
    82         # diff the output of the files
    83         diff_cmd = ("diff --text "
    84 #                               "--ignore-all-space "
    85 #                               "--ignore-blank-lines "
    86                                 "--old-group-format='\t\tmissing lines :\n"
    87                                 "%%<' \\\n"
    88                                 "--new-group-format='\t\tnew lines :\n"
    89                                 "%%>' \\\n"
    90                                 "--unchanged-group-format='%%=' \\"
    91                                 "--changed-group-format='\t\texpected :\n"
    92                                 "%%<"
    93                                 "\t\tgot :\n"
    94                                 "%%>\n' \\\n"
    95                                 "--new-line-format='\t\t%%dn\t%%L' \\\n"
    96                                 "--old-line-format='\t\t%%dn\t%%L' \\\n"
    97                                 "--unchanged-line-format='' \\\n"
    98                                 "%s %s")
    99 
    100126        # fetch return code and error from the diff command
    101         return sh(diff_cmd % (lhs, rhs), False)
     127        return sh(
     128                '''diff''',
     129                '''--text''',
     130                '''--old-group-format=\t\tmissing lines :\n%<''',
     131                '''--new-line-format=\t\t%dn\t%L''',
     132                '''--new-group-format=\t\tnew lines : \n%>''',
     133                '''--old-line-format=\t\t%dn\t%L''',
     134                '''--unchanged-group-format=%=''',
     135                '''--changed-group-format=\t\texpected :\n%<\t\tgot :\n%>''',
     136                '''--unchanged-line-format=''',
     137                lhs,
     138                rhs,
     139                output=subprocess.PIPE
     140        )
    102141
    103142# call make
    104 def make(target, flags = '', redirects = '', error_file = None, silent = False):
    105         test_param = """test="%s" """ % (error_file) if error_file else ''
    106         cmd = ' '.join([
    107                 settings.make,
    108                 '-s' if silent else '',
     143def make(target, *, flags = '', output = None, error = None, error_file = None, silent = False):
     144        test_param = """test="%s" """ % (error_file) if error_file else None
     145        cmd = [
     146                *settings.make,
     147                '-s' if silent else None,
    109148                test_param,
    110149                settings.arch.flags,
     
    112151                settings.install.flags,
    113152                flags,
    114                 target,
    115                 redirects
    116         ])
    117         return sh(cmd)
     153                target
     154        ]
     155        cmd = [s for s in cmd if s]
     156        return sh(*cmd, output=output, error=error)
    118157
    119158def which(program):
    120     import os
    121     def is_exe(fpath):
    122         return os.path.isfile(fpath) and os.access(fpath, os.X_OK)
    123 
    124159    fpath, fname = os.path.split(program)
    125160    if fpath:
     
    134169    return None
    135170
    136 def run(exe, output, input):
    137         ret, _ = sh("timeout %d %s > %s 2>&1" % (settings.timeout.single, exe, output), input = input)
    138         return ret
     171@contextlib.contextmanager
     172def tempdir():
     173        cwd = os.getcwd()
     174        with tempfile.TemporaryDirectory() as temp:
     175                os.chdir(temp)
     176                try:
     177                        yield temp
     178                finally:
     179                        os.chdir(cwd)
    139180
    140181################################################################################
     
    143184# move a file
    144185def mv(source, dest):
    145         ret, _ = sh("mv %s %s" % (source, dest))
     186        ret, _ = sh("mv", source, dest)
    146187        return ret
    147188
    148189# cat one file into the other
    149190def cat(source, dest):
    150         ret, _ = sh("cat %s > %s" % (source, dest))
     191        ret, _ = sh("cat", source, output=dest)
    151192        return ret
    152193
     
    163204
    164205# helper function to check if a files contains only a specific string
    165 def fileContainsOnly(file, text) :
     206def file_contains_only(file, text) :
    166207        with open(file) as f:
    167208                ff = f.read().strip()
    168209                result = ff == text.strip()
    169210
    170                 return result;
    171 
    172 # check whether or not a file is executable
    173 def fileIsExecutable(file) :
    174         try :
    175                 fileinfo = os.stat(file)
    176                 return bool(fileinfo.st_mode & stat.S_IXUSR)
    177         except Exception as inst:
    178                 print(type(inst))    # the exception instance
    179                 print(inst.args)     # arguments stored in .args
    180                 print(inst)
    181                 return False
     211                return result
    182212
    183213# transform path to canonical form
    184 def canonicalPath(path):
     214def canonical_path(path):
    185215        abspath = os.path.abspath(__main__.__file__)
    186216        dname = os.path.dirname(abspath)
     
    188218
    189219# compare path even if form is different
    190 def pathCmp(lhs, rhs):
    191         return canonicalPath( lhs ) == canonicalPath( rhs )
     220def path_cmp(lhs, rhs):
     221        return canonical_path( lhs ) == canonical_path( rhs )
    192222
    193223# walk all files in a path
    194 def pathWalk( op ):
    195         def step(_, dirname, names):
     224def path_walk( op ):
     225        dname = settings.SRCDIR
     226        for dirname, _, names in os.walk(dname):
    196227                for name in names:
    197228                        path = os.path.join(dirname, name)
    198229                        op( path )
    199230
    200         # Start the walk
    201         dname = settings.SRCDIR
    202         os.path.walk(dname, step, '')
    203 
    204231################################################################################
    205232#               system
    206233################################################################################
    207234# count number of jobs to create
    208 def jobCount( options, tests ):
     235def job_count( options, tests ):
    209236        # check if the user already passed in a number of jobs for multi-threading
    210237        if not options.jobs:
     
    228255        return min( options.jobs, len(tests) ), force
    229256
    230 # setup a proper processor pool with correct signal handling
    231 def setupPool(jobs):
    232         original_sigint_handler = signal.signal(signal.SIGINT, signal.SIG_IGN)
    233         pool = multiprocessing.Pool(jobs)
    234         signal.signal(signal.SIGINT, original_sigint_handler)
    235 
    236         return pool
    237 
    238 # handle signals in scope
    239 class SignalHandling():
    240         def __enter__(self):
    241                 # enable signal handling
    242                 signal.signal(signal.SIGINT, signal.SIG_DFL)
    243 
    244         def __exit__(self, type, value, traceback):
    245                 # disable signal handling
    246                 signal.signal(signal.SIGINT, signal.SIG_IGN)
    247 
    248 
    249257# enable core dumps for all the test children
    250258resource.setrlimit(resource.RLIMIT_CORE, (resource.RLIM_INFINITY, resource.RLIM_INFINITY))
     
    261269                return False
    262270        raise argparse.ArgumentTypeError(msg)
    263         return False
    264271
    265272def fancy_print(text):
    266273        column = which('column')
    267274        if column:
    268                 cmd = "%s 2> /dev/null" % column
    269                 proc = Popen(cmd, stdin=PIPE, stderr=None, shell=True)
    270                 proc.communicate(input=text + "\n")
     275                subprocess.run(column, input=bytes(text + "\n", "UTF-8"))
    271276        else:
    272277                print(text)
    273278
    274279
    275 def coreInfo(path):
     280def core_info(path):
     281        if not os.path.isfile(path):
     282                return 1, "ERR Executable path is wrong"
     283
    276284        cmd   = os.path.join(settings.SRCDIR, "pybin/print-core.gdb")
    277285        if not os.path.isfile(cmd):
    278286                return 1, "ERR Printing format for core dumps not found"
    279287
    280         dname = os.path.dirname(path)
    281         core  = os.path.join(dname, "core" )
    282         if not os.path.isfile(path):
    283                 return 1, "ERR Executable path is wrong"
     288        core  = os.path.join(os.getcwd(), "core" )
    284289
    285290        if not os.path.isfile(core):
    286291                return 1, "ERR No core dump"
    287292
    288         return sh("gdb -n %s %s -batch -x %s" % (path, core, cmd), print2stdout=False)
     293        return sh('gdb', '-n', path, core, '-batch', '-x', cmd, output=subprocess.PIPE)
    289294
    290295class Timed:
  • tests/raii/.expect/ctor-autogen-ERR1.txt

    r6a9d4b4 r933f32f  
    1 raii/ctor-autogen.cfa:102:1 error: Unique best alternative includes deleted identifier in Cast of:
     1raii/ctor-autogen.cfa:102:1 error: Unique best alternative includes deleted identifier in Generated Cast of:
    22  Application of
    33    Deleted Expression
     
    2727
    2828            ... to arguments
    29               Cast of:
     29              Generated Cast of:
    3030                Member Expression, with field:
    3131                  x: signed int
    3232                ... from aggregate:
    33                   Cast of:
     33                  Generated Cast of:
    3434                    Variable Expression: m: reference to instance of struct Managed with body 1
    3535                  ... to:
     
    3737              ... to:
    3838                reference to signed int
    39               Cast of:
     39              Generated Cast of:
    4040                constant expression (0 0: zero_t)
    4141              ... to:
     
    4848
    4949  ... to arguments
    50     Cast of:
     50    Generated Cast of:
    5151      Variable Expression: x: instance of struct Managed with body 1
    5252    ... to:
  • tests/raii/init_once.cfa

    r6a9d4b4 r933f32f  
    1010// Created On       : Tue Jun 14 15:43:35 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sat Jul  9 11:30:29 2016
    13 // Update Count     : 3
     12// Last Modified On : Fri Mar 22 13:41:26 2019
     13// Update Count     : 4
    1414//
    1515
     
    192192// Local Variables: //
    193193// tab-width: 4 //
    194 // compile-command: "cfa init_once.c" //
     194// compile-command: "cfa init_once.cfa" //
    195195// End: //
  • tests/rational.cfa

    r6a9d4b4 r933f32f  
    1010// Created On       : Mon Mar 28 08:43:12 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Dec  4 21:46:42 2018
    13 // Update Count     : 69
     12// Last Modified On : Wed Mar 27 07:37:17 2019
     13// Update Count     : 80
    1414//
    1515
     
    1919#include <fstream.hfa>
    2020
    21 // UNNECESSARY, FIX ME
    22 void ?{}( int & this ) { this = 0; }
    23 void ?{}( int & this, zero_t ) { this = 0; }
    24 void ?{}( int & this, one_t ) { this = 1; }
    2521double convert( int i ) { return (double)i; }
    2622int convert( double d ) { return (int)d; }
     
    5854        sout | a * b;
    5955        sout | a / b;
     56//      sout | a \ 2 | b \ 2; // FIX ME
     57//      sout | a \ -2 | b \ -2;
    6058
    6159        sout | "conversion";
  • tests/sum.cfa

    r6a9d4b4 r933f32f  
    1111// Created On       : Wed May 27 17:56:53 2015
    1212// Last Modified By : Peter A. Buhr
    13 // Last Modified On : Sun Dec 23 23:00:38 2018
    14 // Update Count     : 287
     13// Last Modified On : Sun May 19 11:21:02 2019
     14// Update Count     : 330
    1515//
    1616
    1717#include <fstream.hfa>
    1818#include <stdlib.hfa>
    19 
    20 void ?{}( int & c, zero_t ) { c = 0; }                                  // not in prelude
    2119
    2220trait sumable( otype T ) {
     
    3129T sum( size_t size, T a[] ) {
    3230        T total = 0;                                                                            // initialize by 0 constructor
    33         for ( size_t i = 0; i < size; i += 1 )
     31        for ( i; size )
    3432                total += a[i];                                                                  // select appropriate +
    3533        return total;
    3634} // sum
    3735
    38 // Not in prelude.
    39 unsigned char ?+?( unsigned char t1, unsigned char t2 ) { return (int)t1 + t2; } // cast forces integer addition, otherwise recursion
    40 unsigned char ?+=?( unsigned char & t1, unsigned char t2 ) { t1 = t1 + t2; return t1; }
    41 unsigned char ++?( unsigned char & t ) { t += 1; return t; }
    42 unsigned char ?++( unsigned char & t ) { unsigned char temp = t; t += 1; return temp; }
    43 
    44 // Not in prelude.
    45 void ?{}( unsigned char & c, zero_t ) { c = 0; }
    46 void ?{}( float & f, zero_t ) { f = 0.0; }
    47 void ?{}( double & d, zero_t ) { d = 0.0; }
    48 
    4936int main( void ) {
    5037        const int low = 5, High = 15, size = High - low;
    5138
    52         unsigned char s = 0, a[size], v = (char)low;
    53         for ( int i = 0; i < size; i += 1, v += 1 ) {
     39        signed char s = 0, a[size], v = (char)low;
     40        for ( int i = 0; i < size; i += 1, v += 1hh ) {
    5441                s += v;
    5542                a[i] = v;
    5643        } // for
    5744        sout | "sum from" | low | "to" | High | "is"
    58                  | sum( size, (unsigned char *)a ) | ", check" | (int)s;
     45                 | sum( size, (signed char *)a ) | ", check" | (signed char)s;
     46
     47        unsigned char s = 0, a[size], v = low;
     48        for ( int i = 0; i < size; i += 1, v += 1hhu ) {
     49                s += (unsigned char)v;
     50                a[i] = (unsigned char)v;
     51        } // for
     52        sout | "sum from" | low | "to" | High | "is"
     53                 | sum( size, (unsigned char *)a ) | ", check" | (unsigned char)s;
     54
     55        short int s = 0, a[size], v = low;
     56        for ( int i = 0; i < size; i += 1, v += 1h ) {
     57                s += (short int)v;
     58                a[i] = (short int)v;
     59        } // for
     60        sout | "sum from" | low | "to" | High | "is"
     61                 | sum( size, (short int *)a ) | ", check" | (short int)s;
    5962
    6063        int s = 0, a[size], v = low;
  • tests/test.py

    r6a9d4b4 r933f32f  
    1 #!/usr/bin/python
    2 from __future__ import print_function
     1#!/usr/bin/python3
    32
    43from pybin.tools import *
     
    98import re
    109import sys
     10import tempfile
    1111import time
    1212
     
    1515################################################################################
    1616
    17 def findTests():
     17def find_tests():
    1818        expected = []
    1919
    20         def matchTest(path):
     20        def match_test(path):
    2121                match = re.search("^%s\/([\w\/\-_]*).expect\/([\w\-_]+)(\.[\w\-_]+)?\.txt$" % settings.SRCDIR, path)
    2222                if match :
     
    2828                                expected.append(test)
    2929
    30         pathWalk( matchTest )
     30        path_walk( match_test )
    3131
    3232        return expected
    3333
    3434# reads the directory ./.expect and indentifies the tests
    35 def listTests( includes, excludes ):
     35def list_tests( includes, excludes ):
    3636        # tests directly in the .expect folder will always be processed
    37         test_list = findTests()
     37        test_list = find_tests()
    3838
    3939        # if we have a limited number of includes, filter by them
     
    5252
    5353# from the found tests, filter all the valid tests/desired tests
    54 def validTests( options ):
     54def valid_tests( options ):
    5555        tests = []
    5656
     
    5959        if options.regenerate_expected :
    6060                for testname in options.tests :
    61                         testname = canonicalPath( testname )
     61                        testname = canonical_path( testname )
    6262                        if Test.valid_name(testname):
    63                                 found = [test for test in allTests if canonicalPath( test.target() ) == testname]
     63                                found = [test for test in all_tests if canonical_path( test.target() ) == testname]
    6464                                tests.append( found[0] if len(found) == 1 else Test.from_target(testname) )
    6565                        else :
     
    6969                # otherwise we only need to validate that all tests are present in the complete list
    7070                for testname in options.tests:
    71                         test = [t for t in allTests if pathCmp( t.target(), testname )]
     71                        test = [t for t in all_tests if path_cmp( t.target(), testname )]
    7272
    7373                        if test :
     
    7979
    8080# parses the option
    81 def getOptions():
     81def parse_args():
    8282        # create a parser with the arguments for the tests script
    8383        parser = argparse.ArgumentParser(description='Script which runs cforall tests')
     
    102102                print('ERROR: invalid arguments', file=sys.stderr)
    103103                parser.print_help(sys.stderr)
    104                 sys.exit(1)
     104                sys.exit(1)
    105105
    106106        # script must have at least some tests to run or be listing
     
    112112        # check that exactly one of the booleans is set to true
    113113        if not sum( (listing, all_tests, some_tests, some_dirs) ) > 0 :
    114                 print('ERROR: must have option \'--all\', \'--list\', \'--include\', \'-I\' or non-empty test list', file=sys.stderr)
     114                print('''ERROR: must have option '--all', '--list', '--include', '-I' or non-empty test list''', file=sys.stderr)
    115115                parser.print_help()
    116116                sys.exit(1)
     
    124124        return val == 0 or settings.dry_run
    125125
    126 def isExe(file):
    127         return settings.dry_run or fileIsExecutable(file)
    128 
    129 def noRule(file, target):
    130         return not settings.dry_run and fileContainsOnly(file, "make: *** No rule to make target `%s'.  Stop." % target)
     126def no_rule(file, target):
     127        return not settings.dry_run and file_contains_only(file, "make: *** No rule to make target `%s'.  Stop." % target)
    131128
    132129# logic to run a single test and return the result (No handling of printing or other test framework logic)
     
    145142        # build, skipping to next test on error
    146143        with Timed() as comp_dur:
    147                 make_ret, _ = make( test.target(),      redirects  = ("2> %s 1> /dev/null" % out_file), error_file = err_file )
    148 
    149         # if the make command succeds continue otherwise skip to diff
     144                make_ret, _ = make( test.target(), output=subprocess.DEVNULL, error=out_file, error_file = err_file )
     145
    150146        run_dur = None
    151         if success(make_ret):
    152                 with Timed() as run_dur:
    153                         if isExe(exe_file):
    154                                 # run test
    155                                 retcode = run(exe_file, out_file, in_file)
     147        # run everything in a temp directory to make sure core file are handled properly
     148        with tempdir():
     149                # if the make command succeds continue otherwise skip to diff
     150                if success(make_ret):
     151                        with Timed() as run_dur:
     152                                if settings.dry_run or is_exe(exe_file):
     153                                        # run test
     154                                        retcode, _ = sh(exe_file, output=out_file, input=in_file, timeout=True)
     155                                else :
     156                                        # simply cat the result into the output
     157                                        retcode = cat(exe_file, out_file)
     158                else:
     159                        retcode = mv(err_file, out_file)
     160
     161                if success(retcode):
     162                        if settings.generating :
     163                                # if we are ounly generating the output we still need to check that the test actually exists
     164                                if no_rule(out_file, test.target()) :
     165                                        retcode = 1
     166                                        error = "\t\tNo make target for test %s!" % test.target()
     167                                        rm(out_file)
     168                                else:
     169                                        error = None
    156170                        else :
    157                                 # simply cat the result into the output
    158                                 retcode = cat(exe_file, out_file)
    159         else:
    160                 retcode = mv(err_file, out_file)
    161 
    162         if success(retcode):
    163                 if settings.generating :
    164                         # if we are ounly generating the output we still need to check that the test actually exists
    165                         if noRule(out_file, test.target()) :
    166                                 retcode = 1
    167                                 error = "\t\tNo make target for test %s!" % test.target()
    168                                 rm(out_file)
    169                         else:
    170                                 error = None
    171                 else :
    172                         # fetch return code and error from the diff command
    173                         retcode, error = diff(cmp_file, out_file)
    174 
    175         else:
    176                 with open (out_file, "r") as myfile:
    177                         error = myfile.read()
    178 
    179                 ret, info = coreInfo(exe_file)
    180                 error = error + info
     171                                # fetch return code and error from the diff command
     172                                retcode, error = diff(cmp_file, out_file)
     173
     174                else:
     175                        with open (out_file, "r") as myfile:
     176                                error = myfile.read()
     177
     178                        ret, info = core_info(exe_file)
     179                        error = error + info if error else info
    181180
    182181
     
    189188# run a single test and handle the errors, outputs, printing, exception handling, etc.
    190189def run_test_worker(t) :
    191 
    192         with SignalHandling():
     190        try :
    193191                # print formated name
    194                 name_txt = "%24s  " % t.name
     192                name_txt = '{0:{width}}  '.format(t.target(), width=settings.output_width)
    195193
    196194                retcode, error, duration = run_single_test(t)
     
    200198
    201199                #print result with error if needed
    202                 text = name_txt + result_txt
     200                text = '\t' + name_txt + result_txt
    203201                out = sys.stdout
    204202                if error :
    205                         text = text + "\n" + error
     203                        text = text + '\n' + error
    206204                        out = sys.stderr
    207205
     
    210208                sys.stderr.flush()
    211209
    212         return retcode != TestResult.SUCCESS
     210                return retcode != TestResult.SUCCESS
     211        except KeyboardInterrupt:
     212                False
    213213
    214214# run the given list of tests with the given parameters
    215215def run_tests(tests, jobs) :
    216216        # clean the sandbox from previous commands
    217         make('clean', redirects = '> /dev/null 2>&1')
     217        make('clean', output=subprocess.DEVNULL, error=subprocess.DEVNULL)
    218218
    219219        # create the executor for our jobs and handle the signal properly
    220         pool = setupPool(jobs)
     220        pool = multiprocessing.Pool(jobs)
    221221
    222222        # for each test to run
     
    233233
    234234        # clean the workspace
    235         make('clean', redirects = '> /dev/null 2>&1')
     235        make('clean', output=subprocess.DEVNULL, error=subprocess.DEVNULL)
    236236
    237237        for failed in results:
     
    248248
    249249        # parse the command line arguments
    250         options = getOptions()
     250        options = parse_args()
    251251
    252252        # init global settings
     
    254254
    255255        # fetch the liest of all valid tests
    256         allTests = listTests( options.include, options.exclude )
     256        all_tests = list_tests( options.include, options.exclude )
    257257
    258258
    259259        # if user wants all tests than no other treatement of the test list is required
    260260        if options.all or options.list or options.list_comp or options.include :
    261                 tests = allTests
     261                tests = all_tests
    262262
    263263        #otherwise we need to validate that the test list that was entered is valid
    264264        else :
    265                 tests = validTests( options )
     265                tests = valid_tests( options )
    266266
    267267        # make sure we have at least some test to run
     
    281281        elif options.list :
    282282                print("Listing for %s:%s"% (settings.arch.string, settings.debug.string))
    283                 fancy_print("\n".join(map(lambda t: "%s" % (t.toString()), tests)))
     283                fancy_print("\n".join(map(lambda t: t.toString(), tests)))
    284284
    285285        else :
    286286                # check the build configuration works
     287                settings.prep_output(tests)
    287288                settings.validate()
    288289
    289                 options.jobs, forceJobs = jobCount( options, tests )
    290                 settings.updateMakeCmd(forceJobs, options.jobs)
    291 
    292                 print('%s (%s:%s) on %i cores' % (
    293                         'Regenerate tests' if settings.generating else 'Running',
     290                options.jobs, forceJobs = job_count( options, tests )
     291                settings.update_make_cmd(forceJobs, options.jobs)
     292
     293                print('%s %i tests on %i cores (%s:%s)' % (
     294                        'Regenerating' if settings.generating else 'Running',
     295                        len(tests),
     296                        options.jobs,
    294297                        settings.arch.string,
    295                         settings.debug.string,
    296                         options.jobs
     298                        settings.debug.string
    297299                ))
    298300
  • tests/warnings/.expect/self-assignment.txt

    r6a9d4b4 r933f32f  
    1 warnings/self-assignment.cfa:29:1 warning: self assignment of expression: Cast of:
     1warnings/self-assignment.cfa:29:1 warning: self assignment of expression: Generated Cast of:
    22  Variable Expression: j: signed int
    33... to:
    44  reference to signed int
    5 warnings/self-assignment.cfa:30:1 warning: self assignment of expression: Cast of:
     5warnings/self-assignment.cfa:30:1 warning: self assignment of expression: Generated Cast of:
    66  Variable Expression: s: instance of struct S with body 1
    77... to:
    88  reference to instance of struct S with body 1
    9 warnings/self-assignment.cfa:31:1 warning: self assignment of expression: Cast of:
     9warnings/self-assignment.cfa:31:1 warning: self assignment of expression: Generated Cast of:
    1010  Member Expression, with field:
    1111    i: signed int
     
    1414... to:
    1515  reference to signed int
    16 warnings/self-assignment.cfa:32:1 warning: self assignment of expression: Cast of:
     16warnings/self-assignment.cfa:32:1 warning: self assignment of expression: Generated Cast of:
    1717  Member Expression, with field:
    1818    i: signed int
  • tests/warnings/self-assignment.cfa

    r6a9d4b4 r933f32f  
    99// Author           : Rob Schluntz
    1010// Created On       : Thu Mar 1 13:53:57 2018
    11 // Last Modified By : Rob Schluntz
    12 // Last Modified On : Thu Mar 1 13:53:57 2018
    13 // Update Count     : 2
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Wed Feb 20 07:56:17 2019
     13// Update Count     : 3
    1414//
    1515
    1616struct S {
    17   int i;
     17        int i;
    1818};
    1919
    2020struct T {
    21   S s;
     21        S s;
    2222};
    2323
    2424int main() {
    25   int j = 0;
    26   S s = { 0 };
    27   T t = { { 0 } };
     25        int j = 0;
     26        S s = { 0 };
     27        T t = { { 0 } };
    2828
    29   j = j;
    30   s = s;
    31   s.i = s.i;
    32   t.s.i = t.s.i;
     29        j = j;
     30        s = s;
     31        s.i = s.i;
     32        t.s.i = t.s.i;
    3333}
    3434
Note: See TracChangeset for help on using the changeset viewer.