- Timestamp:
- May 24, 2019, 10:19:41 AM (6 years ago)
- 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. - Location:
- tests
- Files:
-
- 9 added
- 6 deleted
- 67 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/.expect/KRfunctions.x64.txt
r6a9d4b4 r933f32f 62 62 __attribute__ ((unused)) signed int _X10_retval_f5i_1; 63 63 } 64 signed int (*_X2f6FFi_i__iPiPi__1(signed int _X1ai_1, signed int *_X1bPi_1, signed int *_X1cPi_1))( signed int __anonymous_object0){64 signed int (*_X2f6FFi_i__iPiPi__1(signed int _X1ai_1, signed int *_X1bPi_1, signed int *_X1cPi_1))(__attribute__ ((unused)) signed int __anonymous_object0){ 65 65 __attribute__ ((unused)) signed int (*_X10_retval_f6Fi_i__1)(signed int __anonymous_object1); 66 66 } … … 104 104 signed int _X1bi_2; 105 105 { 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))); 113 108 } 114 109 -
tests/.expect/KRfunctions.x86.txt
r6a9d4b4 r933f32f 62 62 __attribute__ ((unused)) signed int _X10_retval_f5i_1; 63 63 } 64 signed int (*_X2f6FFi_i__iPiPi__1(signed int _X1ai_1, signed int *_X1bPi_1, signed int *_X1cPi_1))( signed int __anonymous_object0){64 signed int (*_X2f6FFi_i__iPiPi__1(signed int _X1ai_1, signed int *_X1bPi_1, signed int *_X1cPi_1))(__attribute__ ((unused)) signed int __anonymous_object0){ 65 65 __attribute__ ((unused)) signed int (*_X10_retval_f6Fi_i__1)(signed int __anonymous_object1); 66 66 } … … 104 104 signed int _X1bi_2; 105 105 { 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))); 113 108 } 114 109 -
tests/.expect/abs.txt
r6a9d4b4 r933f32f 3 3 signed long int -65 abs 65 4 4 signed long long int -65 abs 65 5 float -65 abs 656 double -65 abs 657 long double -65 abs 658 float _Complex -65 -2i abs 65.03089 double _Complex -65 -2i abs 65.030761951556410 long double _Complex -65 -2i abs 65.03076195155643425 float -65. abs 65. 6 double -65. abs 65. 7 long double -65. abs 65. 8 float _Complex -65.-2.i abs 65.0308 9 double _Complex -65.-2.i abs 65.0307619515564 10 long double _Complex -65.-2.i abs 65.0307619515564342 -
tests/.expect/ato.txt
r6a9d4b4 r933f32f 22 22 -123.456789012345679 -123.45678901234567890123456789 23 23 -123.456-123.456i -123.456-123.456i 24 0 +0i 2 324 0.+0.i 2 3 25 25 -123.456789012346+123.456789012346i -123.4567890123456+123.4567890123456i 26 26 123.456789012345679-123.456789012345679i 123.45678901234567890123456789-123.45678901234567890123456789i -
tests/.expect/attributes.x64.txt
r6a9d4b4 r933f32f 640 640 } 641 641 __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){ 643 643 __attribute__ ((unused)) signed int (*_X10_retval_f4Fi_i__1)(signed int __anonymous_object3); 644 644 } -
tests/.expect/attributes.x86.txt
r6a9d4b4 r933f32f 640 640 } 641 641 __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){ 643 643 __attribute__ ((unused)) signed int (*_X10_retval_f4Fi_i__1)(signed int __anonymous_object3); 644 644 } -
tests/.expect/castError.txt
r6a9d4b4 r933f32f 1 castError.cfa: 7:1 error: Cannot choose between 3 alternatives for expression2 Cast of:1 castError.cfa:21:1 error: Cannot choose between 3 alternatives for expression 2 Explicit Cast of: 3 3 Name: f 4 4 ... to: 5 5 char Alternatives are: 6 Cost ( 1, 0, 0, 0, 0, 0 ):Cast of:6 Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of: 7 7 Variable Expression: f: function 8 8 accepting unspecified arguments … … 16 16 Environment: 17 17 18 Cost ( 1, 0, 0, 0, 0, 0 ):Cast of:18 Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of: 19 19 Variable Expression: f: double 20 20 ... to: … … 25 25 Environment: 26 26 27 Cost ( 1, 0, 0, 0, 0, 0 ):Cast of:27 Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of: 28 28 Variable Expression: f: signed int 29 29 ... to: … … 35 35 36 36 37 castError.cfa:26:1 error: Cannot choose between 2 alternatives for expression 38 Generated Cast of: 39 Comma Expression: 40 constant expression (3 3: signed int) 41 Name: v 42 ... to: nothing Alternatives are: 43 Cost ( 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 53 Cost ( 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 1 completeTypeError.cfa:34:1 error: Cannot choose between 2 alternatives for expression 2 Generated Cast of: 3 Applying untyped: 4 Name: *? 5 ...to: 6 Name: x 5 7 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: 9 Cost ( 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 32 Cost ( 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 10 55 11 56 completeTypeError.cfa:35:1 error: No reasonable alternatives for expression Applying untyped: … … 24 69 Name: v 25 70 26 completeTypeError.cfa:5 8:1 error: No reasonable alternatives for expression Applying untyped:71 completeTypeError.cfa:59:1 error: No reasonable alternatives for expression Applying untyped: 27 72 Name: baz 28 73 ...to: 29 74 Name: y 30 75 31 completeTypeError.cfa: 59:1 error: No reasonable alternatives for expression Applying untyped:76 completeTypeError.cfa:60:1 error: No reasonable alternatives for expression Applying untyped: 32 77 Name: quux 33 78 ...to: 34 79 Name: y 35 80 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: 81 completeTypeError.cfa:72:1 error: No alternatives with satisfiable assertions for Applying untyped: 42 82 Name: baz 43 83 ...to: 44 84 Name: z 45 85 46 Alternatives with failing assertions are:47 Cost ( 0, 1, 0, 1, -5, 0 ): Application of48 Variable Expression: baz: forall49 T: sized object type50 ... with assertions51 ?=?: pointer to function52 ... with parameters53 reference to instance of type T (not function type)54 instance of type T (not function type)55 ... returning56 _retval__operator_assign: instance of type T (not function type)57 ... with attributes:58 Attribute with name: unused86 Unsatisfiable alternative: 87 Cost ( 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 59 99 60 100 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 62 119 ... with parameters 63 referenceto instance of type T (not function type)120 pointer to instance of type T (not function type) 64 121 ... returning nothing 65 122 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) 71 125 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 76 140 77 141 78 function79 ... with parameters80 pointer to instance of type T (not function type)81 ... returning nothing82 83 ... to arguments84 Variable Expression: z: pointer to instance of type T (not function type)85 86 (types:87 void88 )89 Environment:( _73_0_T ) -> instance of type T (not function type) (no widening)90 91 92 -
tests/.expect/complex.txt
r6a9d4b4 r933f32f 1 1 x:3+2i y:4+5i z:7+7i 2 x:3 +2i y:4+5i z:7+7i2 x:3.+2.i y:4.+5.i z:7.+7.i 3 3 x:2.1+1.3i y:3.2+4.5i z:5.3+5.8i 4 4 x:2.1+1.3i y:3.2+4.5i z:5.3+5.8i -
tests/.expect/declarationSpecifier.x64.txt
r6a9d4b4 r933f32f 1122 1122 __attribute__ ((unused)) signed int _X12_retval_maini_1; 1123 1123 { 1124 ((void)(_X12_retval_maini_1=((signed int )0)) /* ?{} */);1125 }1126 1127 return _X12_retval_maini_1;1128 {1129 1124 ((void)(_X12_retval_maini_1=0) /* ?{} */); 1130 1125 } … … 1137 1132 __attribute__ ((unused)) signed int _X12_retval_maini_1; 1138 1133 { 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)) /* ?{} */); 1143 1136 } 1144 1137 -
tests/.expect/declarationSpecifier.x86.txt
r6a9d4b4 r933f32f 1122 1122 __attribute__ ((unused)) signed int _X12_retval_maini_1; 1123 1123 { 1124 ((void)(_X12_retval_maini_1=((signed int )0)) /* ?{} */);1125 }1126 1127 return _X12_retval_maini_1;1128 {1129 1124 ((void)(_X12_retval_maini_1=0) /* ?{} */); 1130 1125 } … … 1137 1132 __attribute__ ((unused)) signed int _X12_retval_maini_1; 1138 1133 { 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)) /* ?{} */); 1143 1136 } 1144 1137 -
tests/.expect/extension.x64.txt
r6a9d4b4 r933f32f 457 457 458 458 { 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)); 463 461 } 464 462 -
tests/.expect/extension.x86.txt
r6a9d4b4 r933f32f 457 457 458 458 { 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)); 463 461 } 464 462 -
tests/.expect/functions.x64.txt
r6a9d4b4 r933f32f 1 1 void _X1hFv___1(void){ 2 2 } 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)){3 signed 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)){ 4 4 __attribute__ ((unused)) signed int _X9_retval_fi_1; 5 5 { … … 99 99 __attribute__ ((unused)) signed int _X9_retval_fi_1; 100 100 } 101 signed int _X1fFi_i__1( signed int __anonymous_object7){101 signed int _X1fFi_i__1(__attribute__ ((unused)) signed int __anonymous_object7){ 102 102 __attribute__ ((unused)) signed int _X9_retval_fi_1; 103 103 } … … 130 130 __attribute__ ((unused)) struct _conc__tuple2_0 _X9_retval_fT2ii_1 = { }; 131 131 } 132 struct _conc__tuple2_0 _X1fFT2ii_ii__1( signed int __anonymous_object9, signed int _X1xi_1){132 struct _conc__tuple2_0 _X1fFT2ii_ii__1(__attribute__ ((unused)) signed int __anonymous_object9, signed int _X1xi_1){ 133 133 __attribute__ ((unused)) struct _conc__tuple2_0 _X9_retval_fT2ii_1 = { }; 134 134 } … … 167 167 __attribute__ ((unused)) struct _conc__tuple3_1 _X9_retval_fT3iii_1 = { }; 168 168 } 169 struct _conc__tuple3_1 _X1fFT3iii_iii__1( signed int __anonymous_object12, signed int _X1xi_1,signed int __anonymous_object13){169 struct _conc__tuple3_1 _X1fFT3iii_iii__1(__attribute__ ((unused)) signed int __anonymous_object12, signed int _X1xi_1, __attribute__ ((unused)) signed int __anonymous_object13){ 170 170 __attribute__ ((unused)) struct _conc__tuple3_1 _X9_retval_fT3iii_1 = { }; 171 171 } … … 180 180 __attribute__ ((unused)) struct _conc__tuple3_2 _X9_retval_fT3iiPi_1 = { }; 181 181 } 182 struct _conc__tuple3_2 _X1fFT3iiPi_iiPi__1( signed int __anonymous_object15, signed int _X1xi_1, signed int *_X1yPi_1){182 struct _conc__tuple3_2 _X1fFT3iiPi_iiPi__1(__attribute__ ((unused)) signed int __anonymous_object15, signed int _X1xi_1, signed int *_X1yPi_1){ 183 183 __attribute__ ((unused)) struct _conc__tuple3_2 _X9_retval_fT3iiPi_1 = { }; 184 184 } … … 190 190 const double _X3fooFd___1(void); 191 191 const double _X3fooFd_i__1(signed int __anonymous_object19); 192 const double _X3fooFd_d__1( double __anonymous_object20){192 const double _X3fooFd_d__1(__attribute__ ((unused)) double __anonymous_object20){ 193 193 __attribute__ ((unused)) const double _X11_retval_fooKd_1; 194 194 { … … 242 242 243 243 } 244 struct S _X3rtnFS1S_i__1( signed int __anonymous_object21){244 struct S _X3rtnFS1S_i__1(__attribute__ ((unused)) signed int __anonymous_object21){ 245 245 __attribute__ ((unused)) struct S _X11_retval_rtnS1S_1; 246 246 } 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)){247 signed 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)){ 248 248 __attribute__ ((unused)) signed int _X9_retval_fi_1; 249 249 signed int (*(*_X2pcPA0A0PA0A0i_2)[][((unsigned long int )10)])[][((unsigned long int )3)]; … … 271 271 } 272 272 signed 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)]){273 signed 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)]){ 274 274 __attribute__ ((unused)) signed int _X9_retval_fi_1; 275 275 } -
tests/.expect/functions.x86.txt
r6a9d4b4 r933f32f 1 1 void _X1hFv___1(void){ 2 2 } 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)){3 signed 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)){ 4 4 __attribute__ ((unused)) signed int _X9_retval_fi_1; 5 5 { … … 99 99 __attribute__ ((unused)) signed int _X9_retval_fi_1; 100 100 } 101 signed int _X1fFi_i__1( signed int __anonymous_object7){101 signed int _X1fFi_i__1(__attribute__ ((unused)) signed int __anonymous_object7){ 102 102 __attribute__ ((unused)) signed int _X9_retval_fi_1; 103 103 } … … 130 130 __attribute__ ((unused)) struct _conc__tuple2_0 _X9_retval_fT2ii_1 = { }; 131 131 } 132 struct _conc__tuple2_0 _X1fFT2ii_ii__1( signed int __anonymous_object9, signed int _X1xi_1){132 struct _conc__tuple2_0 _X1fFT2ii_ii__1(__attribute__ ((unused)) signed int __anonymous_object9, signed int _X1xi_1){ 133 133 __attribute__ ((unused)) struct _conc__tuple2_0 _X9_retval_fT2ii_1 = { }; 134 134 } … … 167 167 __attribute__ ((unused)) struct _conc__tuple3_1 _X9_retval_fT3iii_1 = { }; 168 168 } 169 struct _conc__tuple3_1 _X1fFT3iii_iii__1( signed int __anonymous_object12, signed int _X1xi_1,signed int __anonymous_object13){169 struct _conc__tuple3_1 _X1fFT3iii_iii__1(__attribute__ ((unused)) signed int __anonymous_object12, signed int _X1xi_1, __attribute__ ((unused)) signed int __anonymous_object13){ 170 170 __attribute__ ((unused)) struct _conc__tuple3_1 _X9_retval_fT3iii_1 = { }; 171 171 } … … 180 180 __attribute__ ((unused)) struct _conc__tuple3_2 _X9_retval_fT3iiPi_1 = { }; 181 181 } 182 struct _conc__tuple3_2 _X1fFT3iiPi_iiPi__1( signed int __anonymous_object15, signed int _X1xi_1, signed int *_X1yPi_1){182 struct _conc__tuple3_2 _X1fFT3iiPi_iiPi__1(__attribute__ ((unused)) signed int __anonymous_object15, signed int _X1xi_1, signed int *_X1yPi_1){ 183 183 __attribute__ ((unused)) struct _conc__tuple3_2 _X9_retval_fT3iiPi_1 = { }; 184 184 } … … 190 190 const double _X3fooFd___1(void); 191 191 const double _X3fooFd_i__1(signed int __anonymous_object19); 192 const double _X3fooFd_d__1( double __anonymous_object20){192 const double _X3fooFd_d__1(__attribute__ ((unused)) double __anonymous_object20){ 193 193 __attribute__ ((unused)) const double _X11_retval_fooKd_1; 194 194 { … … 242 242 243 243 } 244 struct S _X3rtnFS1S_i__1( signed int __anonymous_object21){244 struct S _X3rtnFS1S_i__1(__attribute__ ((unused)) signed int __anonymous_object21){ 245 245 __attribute__ ((unused)) struct S _X11_retval_rtnS1S_1; 246 246 } 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)){247 signed 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)){ 248 248 __attribute__ ((unused)) signed int _X9_retval_fi_1; 249 249 signed int (*(*_X2pcPA0A0PA0A0i_2)[][((unsigned int )10)])[][((unsigned int )3)]; … … 271 271 } 272 272 signed 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)]){273 signed 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)]){ 274 274 __attribute__ ((unused)) signed int _X9_retval_fi_1; 275 275 } -
tests/.expect/gccExtensions.x64.txt
r6a9d4b4 r933f32f 292 292 signed int _X2m3A0A0i_2[((unsigned long int )10)][((unsigned long int )10)]; 293 293 { 294 ((void)(_X12_retval_maini_1= ((signed int )0)) /* ?{} */);294 ((void)(_X12_retval_maini_1=0) /* ?{} */); 295 295 } 296 296 … … 307 307 __attribute__ ((unused)) signed int _X12_retval_maini_1; 308 308 { 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)) /* ?{} */); 313 311 } 314 312 -
tests/.expect/gccExtensions.x86.txt
r6a9d4b4 r933f32f 292 292 signed int _X2m3A0A0i_2[((unsigned int )10)][((unsigned int )10)]; 293 293 { 294 ((void)(_X12_retval_maini_1= ((signed int )0)) /* ?{} */);294 ((void)(_X12_retval_maini_1=0) /* ?{} */); 295 295 } 296 296 … … 307 307 __attribute__ ((unused)) signed int _X12_retval_maini_1; 308 308 { 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)) /* ?{} */); 313 311 } 314 312 -
tests/.expect/identity.txt
r6a9d4b4 r933f32f 9 9 double 4.1 10 10 long double 4.1 11 float _Complex -4.1-2 i12 double _Complex -4.1-2 i13 long double _Complex -4.1-2 i11 float _Complex -4.1-2.i 12 double _Complex -4.1-2.i 13 long double _Complex -4.1-2.i -
tests/.expect/io1.txt
r6a9d4b4 r933f32f 1 1 9 6 28 0 7 1 2 2 1 2 33 1234 1232 0 1 2 3 3 0123 4 0123 5 5 6 6 opening delimiters -
tests/.expect/loopctrl.txt
r6a9d4b4 r933f32f 19 19 10 8 6 4 2 20 20 21 1 2 3 4 5 6 7 8 9 10 22 10 9 8 7 6 5 4 3 2 1 0 23 2 4 6 8 10 24 2.1 3.8 5.5 7.2 8.9 25 10 8 6 4 2 0 26 12.1 10.4 8.7 7. 5.3 3.6 21 27 22 28 N N N N N N N N N N … … 24 30 10 9 8 7 6 5 4 3 2 1 25 31 26 27 32 3 6 9 28 29 33 30 34 (0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9) … … 40 44 (10 10)(9 9)(8 8)(7 7)(6 6)(5 5)(4 4)(3 3)(2 2)(1 1)(0 0) 41 45 (10 10)(9 9)(8 8)(7 7)(6 6)(5 5)(4 4)(3 3)(2 2)(1 1)(0 0) 46 47 0 -5 1 -4 2 -3 3 -2 4 -1 5 0 6 1 7 2 8 3 9 4 48 0 -5 1 -6 2 -7 3 -8 4 -9 5 -10 6 -11 7 -12 8 -13 9 -14 49 0 -5 1 -3 2 -1 3 1 4 3 5 5 6 7 7 9 8 11 9 13 50 0 -5 1 -7 2 -9 3 -11 4 -13 5 -15 6 -17 7 -19 8 -21 9 -23 51 52 0 -5 1 -4 2 -3 3 -2 4 -1 5 0 6 1 7 2 8 3 9 4 53 0 -5 1 -6 2 -7 3 -8 4 -9 5 -10 6 -11 7 -12 8 -13 9 -14 54 0 -5 1 -3 2 -1 3 1 4 3 5 5 6 7 7 9 8 11 9 13 55 0 -5 1 -7 2 -9 3 -11 4 -13 5 -15 6 -17 7 -19 8 -21 9 -23 56 57 0 -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 58 0 -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 59 0 -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 12 remainder:-1 -1 -11 fmod:1. 1. 1. 1. 1. 1. 2 remainder:-1. -1. -1. 3 3 remquo:7 0.0999999 7 0.1 7 0.0999999999999999999 4 div:7 , 0.2 7, 0.2 7, 0.25 fma:-2 -2 -26 fdim:2 2 24 div:7., 0.2 7., 0.2 7., 0.2 5 fma:-2. -2. -2. 6 fdim:2. 2. 2. 7 7 nan:nan nan nan 8 8 exp:2.71828 2.71828182845905 2.71828182845904524 1.46869+2.28736i 1.46869393991589+2.28735528717884i 1.46869393991588516+2.28735528717884239i 9 exp2:2 2 29 exp2:2. 2. 2. 10 10 expm1: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 11 pow:1. 1. 1. 0.273957+0.583701i 0.273957253830121+0.583700758758615i -0.638110484918098871+0.705394566961838155i 12 16 \ 2 = 256 13 912673 256 64 -64 0 0 14 0.015625 -0.015625 18.3791736799526 0.264715-1.1922i 15 0 0 18.3791736799526 0.264715-1.1922i 16 16 17 4 16 -
tests/.expect/math2.txt
r6a9d4b4 r933f32f 1 log:0 0 00.346574+0.785398i 0.346573590279973+0.785398163397448i 0.346573590279972655+0.78539816339744831i2 log2:3 3 33 log10:2 2 21 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. 4 4 log1p:0.693147 0.693147180559945 0.693147180559945309 5 5 ilogb:0 0 0 6 logb:3 3 37 sqrt:1 1 11.09868+0.45509i 1.09868411346781+0.455089860562227i 1.09868411346780997+0.455089860562227341i8 cbrt:3 3 36 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. 9 9 hypot:1.41421 1.4142135623731 1.41421356237309505 10 10 sin:0.841471 0.841470984807897 0.841470984807896507 1.29846+0.634964i 1.29845758141598+0.634963914784736i 1.29845758141597729+0.634963914784736108i … … 12 12 tan:1.55741 1.5574077246549 1.55740772465490223 0.271753+1.08392i 0.271752585319512+1.08392332733869i 0.271752585319511717+1.08392332733869454i 13 13 asin:1.5708 1.5707963267949 1.57079632679489662 0.666239+1.06128i 0.666239432492515+1.06127506190504i 0.666239432492515255+1.06127506190503565i 14 acos:0 0 00.904557-1.06128i 0.904556894302381-1.06127506190504i 0.904556894302381364-1.06127506190503565i14 acos:0. 0. 0. 0.904557-1.06128i 0.904556894302381-1.06127506190504i 0.904556894302381364-1.06127506190503565i 15 15 atan:0.785398 0.785398163397448 0.78539816339744831 1.01722+0.402359i 1.01722196789785+0.402359478108525i 1.01722196789785137+0.402359478108525094i 16 16 atan2:0.785398 0.785398163397448 0.78539816339744831 atan:0.785398 0.785398163397448 0.78539816339744831 -
tests/.expect/math3.txt
r6a9d4b4 r933f32f 2 2 cosh:1.54308 1.54308063481524 1.54308063481524378 0.83373+0.988898i 0.833730025131149+0.988897705762865i 0.833730025131149049+0.988897705762865096i 3 3 tanh:0.761594 0.761594155955765 0.761594155955764888 1.08392+0.271753i 1.08392332733869+0.271752585319512i 1.08392332733869454+0.271752585319511717i 4 acosh:0 0 01.06128+0.904557i 1.06127506190504+0.904556894302381i 1.06127506190503565+0.904556894302381364i4 acosh:0. 0. 0. 1.06128+0.904557i 1.06127506190504+0.904556894302381i 1.06127506190503565+0.904556894302381364i 5 5 asinh:0.881374 0.881373587019543 0.881373587019543025 1.06128+0.666239i 1.06127506190504+0.666239432492515i 1.06127506190503565+0.666239432492515255i 6 6 atanh:inf inf inf 0.402359+1.01722i 0.402359478108525+1.01722196789785i 0.402359478108525094+1.01722196789785137i … … 9 9 lgamma:1.79176 1.79175946922805 1.791759469228055 10 10 lgamma:1.79176 1 1.79175946922805 1 1.791759469228055 1 11 tgamma:6 6 611 tgamma:6. 6. 6. -
tests/.expect/math4.txt
r6a9d4b4 r933f32f 1 floor:1 1 12 ceil:2 2 23 trunc:3 3 34 rint:2 2 21 floor:1. 1. 1. 2 ceil:2. 2. 2. 3 trunc:3. 3. 3. 4 rint:2. 2. 2. 5 5 rint:2 2 2 6 6 rint:2 2 2 7 7 lrint:2 2 2 8 8 llrint:2 2 2 9 nearbyint:4 4 410 round:2 2 29 nearbyint:4. 4. 4. 10 round:2. 2. 2. 11 11 round:2 2 2 12 12 round:2 2 2 13 13 lround:2 2 2 14 14 llround:2 2 2 15 copysign:-1 -1 -115 copysign:-1. -1. -1. 16 16 frexp:0.5 3 0.5 3 0.5 3 17 ldexp:8 8 818 modf:2 0.3 2 0.3 20.319 modf:2 , 0.3 2, 0.3 2, 0.320 nextafter:2 2 221 nexttoward:2 2 222 scalbn:16 16 1623 scalbln:16 16 1617 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. -
tests/.expect/minmax.txt
r6a9d4b4 r933f32f 6 6 signed long long int 4 3 min 3 7 7 unsigned long long int 4 3 min 3 8 float 4 3.1 min 3.19 double 4 3.1 min 3.110 long double 4 3.1 min 3.18 float 4. 3.1 min 3.1 9 double 4. 3.1 min 3.1 10 long double 4. 3.1 min 3.1 11 11 12 12 char z a max z … … 17 17 signed long long int 4 3 max 4 18 18 unsigned long long int 4 3 max 4 19 float 4 3.1 max 420 double 4 3.1 max 421 long double 4 3.1 max 419 float 4. 3.1 max 4. 20 double 4. 3.1 max 4. 21 long double 4. 3.1 max 4. -
tests/.expect/references.txt
r6a9d4b4 r933f32f 35 35 3 36 36 3 37 3 9 { 1 , 7}, [1, 2, 3]37 3 9 { 1., 7. }, [1, 2, 3] 38 38 Destructing a Y 39 39 Destructing a Y -
tests/.expect/sum.txt
r6a9d4b4 r933f32f 1 sum from 5 to 15 is 95, check 95 2 sum from 5 to 15 is 95, check 95 1 3 sum from 5 to 15 is 95, check 95 2 4 sum from 5 to 15 is 95, check 95 -
tests/Makefile.am
r6a9d4b4 r933f32f 23 23 installed=no 24 24 25 INSTALL_FLAGS=-in-tree 26 DEBUG_FLAGS=-debug -O0 27 25 28 quick_test=avl_test operators numericConstants expression enum array typeof cast raii/dtor-early-exit raii/init_once attributes 26 29 … … 28 31 timeouts= 29 32 30 TEST_PY = python ${builddir}/test.py33 TEST_PY = python3 ${builddir}/test.py 31 34 32 35 # applies to both programs … … 36 39 -Wno-unused-function \ 37 40 -quiet @CFA_FLAGS@ \ 38 -DIN_DIR="${ srcdir}/.in/"41 -DIN_DIR="${abs_srcdir}/.in/" 39 42 40 43 AM_CFLAGS += ${DEBUG_FLAGS} ${INSTALL_FLAGS} ${ARCH_FLAGS} 41 44 CC = @CFACC@ 42 45 43 PRETTY_PATH= cd ${srcdir} &&46 PRETTY_PATH=mkdir -p $(dir $(abspath ${@})) && cd ${srcdir} && 44 47 45 48 .PHONY: list .validate … … 48 51 49 52 avl_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 program51 _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 52 55 53 56 #---------------------------------------------------------------------------------------------------------------- … … 74 77 @echo "int main() { return 0; }" > ${@} 75 78 79 .dummy_hackxx.cpp: 80 @echo "int bar() { return 0; }" > ${@} 81 76 82 concurrency : 77 83 @+${TEST_PY} --debug=${debug} --install=${installed} -Iconcurrent … … 79 85 #---------------------------------------------------------------------------------------------------------------- 80 86 87 # Use for all tests, make sure the path are correct and all flags are added 88 CFACOMPILETEST=$(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 91 CFATEST_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 94 CFATEST_STDERR=$(CFACOMPILETEST) 2> $(abspath ${@}) 95 96 #---------------------------------------------------------------------------------------------------------------- 97 81 98 # implicit rule so not all test require a rule 82 99 % : %.cfa $(CFACC) 83 $( PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})100 $(CFATEST_STDOUT) 84 101 85 declarationSpecifier: declarationSpecifier.cfa $(CFACC) 86 $(PRETTY_PATH) $(C FACOMPILE) -CFA -XCFA -p$(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})102 % : %.cpp 103 $(PRETTY_PATH) $(CXXCOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@}) 87 104 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 109 declarationSpecifier_FLAGS= -CFA -XCFA -p 110 gccExtensions_FLAGS= -CFA -XCFA -p 111 extension_FLAGS= -CFA -XCFA -p 112 attributes_FLAGS= -CFA -XCFA -p 113 functions_FLAGS= -CFA -XCFA -p 114 KRfunctions_FLAGS= -CFA -XCFA -p 115 gmp_FLAGS= -lgmp 90 116 91 extension : extension.cfa $(CFACC) 92 $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@}) 117 #------------------------------------------------------------------------------ 118 # Expected failures 119 completeTypeError_FLAGS= -DERR1 93 120 94 attributes : attributes.cfa $(CFACC) 95 $(PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@}) 121 #------------------------------------------------------------------------------ 122 # CUSTOM TARGET 123 #------------------------------------------------------------------------------ 124 typedefRedef-ERR1: typedefRedef.cfa $(CFACC) 125 $(CFATEST_STDOUT) -DERR1 96 126 97 functions: functions.cfa $(CFACC)98 $( PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})127 alloc-ERROR: alloc.cfa $(CFACC) 128 $(CFATEST_STDOUT) -DERR1 99 129 100 KRfunctions : KRfunctions.cfa $(CFACC)101 $( PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})130 nested-types-ERR1: nested-types.cfa $(CFACC) 131 $(CFATEST_STDOUT) -DERR1 102 132 103 sched-ext-parse : sched-ext-parse.c$(CFACC)104 $( PRETTY_PATH) $(CFACOMPILE) -CFA -XCFA -p $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@})133 nested-types-ERR2: nested-types.cfa $(CFACC) 134 $(CFATEST_STDOUT) -DERR2 105 135 106 gmp : gmp.cfa $(CFACC) 107 $(PRETTY_PATH) $(CFACOMPILE) -lgmp $(shell realpath --relative-to=${srcdir} ${<}) -o $(abspath ${@}) 136 raii/dtor-early-exit-ERR1: raii/dtor-early-exit.cfa $(CFACC) 137 $(CFATEST_STDOUT) -DERR1 138 139 raii/dtor-early-exit-ERR2: raii/dtor-early-exit.cfa $(CFACC) 140 $(CFATEST_STDOUT) -DERR2 141 142 raii/memberCtors-ERR1: raii/memberCtors.cfa $(CFACC) 143 $(CFATEST_STDOUT) -DERR1 144 145 raii/ctor-autogen-ERR1: raii/ctor-autogen.cfa $(CFACC) 146 $(CFATEST_STDOUT) -DERR1 108 147 109 148 #builtins 110 149 builtins/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 146 151 147 152 # Warnings 148 153 warnings/self-assignment: warnings/self-assignment.cfa $(CFACC) 149 $( PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) 2> $(abspath ${@}) -fsyntax-only154 $(CFATEST_STDERR) -fsyntax-only -
tests/Makefile.in
r6a9d4b4 r933f32f 107 107 CONFIG_CLEAN_FILES = config.py 108 108 CONFIG_CLEAN_VPATH_FILES = test.py 109 am__dummy_hack_OBJECTS = .dummy_hack.$(OBJEXT) 109 am__dummy_hack_OBJECTS = .dummy_hack.$(OBJEXT) .dummy_hackxx.$(OBJEXT) 110 110 _dummy_hack_OBJECTS = $(am__dummy_hack_OBJECTS) 111 111 _dummy_hack_LDADD = $(LDADD) … … 155 155 am__v_CCLD_0 = @echo " CCLD " $@; 156 156 am__v_CCLD_1 = 157 CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ 158 $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) 159 LTCXXCOMPILE = $(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) 163 AM_V_CXX = $(am__v_CXX_@AM_V@) 164 am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) 165 am__v_CXX_0 = @echo " CXX " $@; 166 am__v_CXX_1 = 167 CXXLD = $(CXX) 168 CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ 169 $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ 170 $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ 171 AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) 172 am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) 173 am__v_CXXLD_0 = @echo " CXXLD " $@; 174 am__v_CXXLD_1 = 157 175 SOURCES = $(_dummy_hack_SOURCES) $(avl_test_SOURCES) 158 176 DIST_SOURCES = $(_dummy_hack_SOURCES) $(avl_test_SOURCES) … … 186 204 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 187 205 ACLOCAL = @ACLOCAL@ 188 ALLOCA = @ALLOCA@189 206 AMTAR = @AMTAR@ 190 207 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ … … 358 375 debug = yes 359 376 installed = no 377 INSTALL_FLAGS = -in-tree 378 DEBUG_FLAGS = -debug -O0 360 379 quick_test = avl_test operators numericConstants expression enum array typeof cast raii/dtor-early-exit raii/init_once attributes 361 380 concurrent = 362 381 timeouts = 363 TEST_PY = python ${builddir}/test.py382 TEST_PY = python3 ${builddir}/test.py 364 383 365 384 # applies to both programs 366 385 AM_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} 388 PRETTY_PATH = mkdir -p $(dir $(abspath ${@})) && cd ${srcdir} && 370 389 avl_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 396 CFACOMPILETEST = $(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 399 CFATEST_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 402 CFATEST_STDERR = $(CFACOMPILETEST) 2> $(abspath ${@}) 403 404 #------------------------------------------------------------------------------ 405 # TARGET WITH STANDARD RULE BUT CUSTOM FLAGS 406 #------------------------------------------------------------------------------ 407 # Expected failures 408 declarationSpecifier_FLAGS = -CFA -XCFA -p 409 gccExtensions_FLAGS = -CFA -XCFA -p 410 extension_FLAGS = -CFA -XCFA -p 411 attributes_FLAGS = -CFA -XCFA -p 412 functions_FLAGS = -CFA -XCFA -p 413 KRfunctions_FLAGS = -CFA -XCFA -p 414 gmp_FLAGS = -lgmp 415 416 #------------------------------------------------------------------------------ 417 # Expected failures 418 completeTypeError_FLAGS = -DERR1 373 419 all: all-am 374 420 375 421 .SUFFIXES: 376 .SUFFIXES: .c .cfa . dummy_hack.lo .o .obj .validate422 .SUFFIXES: .c .cfa .cpp .dummy_hack .dummy_hackxx .lo .o .obj .validate 377 423 $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/src/cfa.make $(am__configure_deps) 378 424 @for dep in $?; do \ … … 410 456 .dummy_hack$(EXEEXT): $(_dummy_hack_OBJECTS) $(_dummy_hack_DEPENDENCIES) $(EXTRA__dummy_hack_DEPENDENCIES) 411 457 @rm -f .dummy_hack$(EXEEXT) 412 $(AM_V_C CLD)$(LINK) $(_dummy_hack_OBJECTS) $(_dummy_hack_LDADD) $(LIBS)458 $(AM_V_CXXLD)$(CXXLINK) $(_dummy_hack_OBJECTS) $(_dummy_hack_LDADD) $(LIBS) 413 459 avltree/$(am__dirstamp): 414 460 @$(MKDIR_P) avltree … … 444 490 445 491 @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@ 446 493 447 494 .c.o: … … 468 515 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 469 516 @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 $@ $< 470 541 471 542 mostlyclean-libtool: … … 718 789 @echo "int main() { return 0; }" > ${@} 719 790 791 .dummy_hackxx.cpp: 792 @echo "int bar() { return 0; }" > ${@} 793 720 794 concurrency : 721 795 @+${TEST_PY} --debug=${debug} --install=${installed} -Iconcurrent … … 725 799 # implicit rule so not all test require a rule 726 800 % : %.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 #------------------------------------------------------------------------------ 809 typedefRedef-ERR1: typedefRedef.cfa $(CFACC) 810 $(CFATEST_STDOUT) -DERR1 811 812 alloc-ERROR: alloc.cfa $(CFACC) 813 $(CFATEST_STDOUT) -DERR1 814 815 nested-types-ERR1: nested-types.cfa $(CFACC) 816 $(CFATEST_STDOUT) -DERR1 817 818 nested-types-ERR2: nested-types.cfa $(CFACC) 819 $(CFATEST_STDOUT) -DERR2 820 821 raii/dtor-early-exit-ERR1: raii/dtor-early-exit.cfa $(CFACC) 822 $(CFATEST_STDOUT) -DERR1 823 824 raii/dtor-early-exit-ERR2: raii/dtor-early-exit.cfa $(CFACC) 825 $(CFATEST_STDOUT) -DERR2 826 827 raii/memberCtors-ERR1: raii/memberCtors.cfa $(CFACC) 828 $(CFATEST_STDOUT) -DERR1 829 830 raii/ctor-autogen-ERR1: raii/ctor-autogen.cfa $(CFACC) 831 $(CFATEST_STDOUT) -DERR1 752 832 753 833 #builtins 754 834 builtins/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 790 836 791 837 # Warnings 792 838 warnings/self-assignment: warnings/self-assignment.cfa $(CFACC) 793 $( PRETTY_PATH) $(CFACOMPILE) $(shell realpath --relative-to=${srcdir} ${<}) 2> $(abspath ${@}) -fsyntax-only839 $(CFATEST_STDERR) -fsyntax-only 794 840 795 841 # 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 2 17 int a1[]; 3 18 //int a2[*]; … … 34 49 } 35 50 36 //Dummy main 37 int main(int argc, char const *argv[]) 38 { 39 return 0; 40 } 51 int main() {} 52 53 // Local Variables: // 54 // tab-width: 4 // 55 // compile-command: "cfa array.cfa" // 56 // End: // -
tests/builtins/sync.cfa
r6a9d4b4 r933f32f 11 11 volatile __int128 * vp16 = 0; __int128 * rp16 = 0; __int128 v16 = 0; 12 12 #endif 13 struct type * volatile * vpp = 0; struct type ** rpp = 0; struct type * vp = 0; 13 14 14 15 { char ret; ret = __sync_fetch_and_add(vp1, v1); } … … 180 181 { _Bool ret; ret = __sync_bool_compare_and_swap_16(vp16, v16,v16); } 181 182 #endif 183 { _Bool ret; ret = __sync_bool_compare_and_swap(vpp, vp, vp); } 182 184 183 185 { char ret; ret = __sync_val_compare_and_swap(vp1, v1, v1); } … … 193 195 { __int128 ret; ret = __sync_val_compare_and_swap_16(vp16, v16,v16); } 194 196 #endif 197 { struct type * ret; ret = __sync_val_compare_and_swap(vpp, vp, vp); } 198 195 199 196 200 { char ret; ret = __sync_lock_test_and_set(vp1, v1); } … … 230 234 { __atomic_clear(vp1, v1); } 231 235 232 { char ret; ret = __atomic_exchange_n(vp1, &v1, __ATOMIC_SEQ_CST); }236 { char ret; ret = __atomic_exchange_n(vp1, v1, __ATOMIC_SEQ_CST); } 233 237 { char ret; ret = __atomic_exchange_1(vp1, v1, __ATOMIC_SEQ_CST); } 234 238 { 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); } 236 240 { short ret; ret = __atomic_exchange_2(vp2, v2, __ATOMIC_SEQ_CST); } 237 241 { 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); } 239 243 { int ret; ret = __atomic_exchange_4(vp4, v4, __ATOMIC_SEQ_CST); } 240 244 { 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); } 242 246 { long long int ret; ret = __atomic_exchange_8(vp8, v8, __ATOMIC_SEQ_CST); } 243 247 { long long int ret; __atomic_exchange(vp8, &v8, &ret, __ATOMIC_SEQ_CST); } 244 248 #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); } 246 250 { __int128 ret; ret = __atomic_exchange_16(vp16, v16, __ATOMIC_SEQ_CST); } 247 251 { __int128 ret; __atomic_exchange(vp16, &v16, &ret, __ATOMIC_SEQ_CST); } 248 252 #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); } 249 255 250 256 { char ret; ret = __atomic_load_n(vp1, __ATOMIC_SEQ_CST); } … … 265 271 { __int128 ret; __atomic_load(vp16, &ret, __ATOMIC_SEQ_CST); } 266 272 #endif 273 { struct type * ret; ret = __atomic_load_n(vpp, __ATOMIC_SEQ_CST); } 274 { struct type * ret; __atomic_load(vpp, &ret, __ATOMIC_SEQ_CST); } 267 275 268 276 { _Bool ret; ret = __atomic_compare_exchange_n(vp1, rp1, v1, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); } … … 283 291 { _Bool ret; ret = __atomic_compare_exchange(vp16, rp16, &v16, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); } 284 292 #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); } 285 295 286 296 { __atomic_store_n(vp1, v1, __ATOMIC_SEQ_CST); } … … 301 311 { __atomic_store(vp16, &v16, __ATOMIC_SEQ_CST); } 302 312 #endif 313 { __atomic_store_n(vpp, vp, __ATOMIC_SEQ_CST); } 314 { __atomic_store(vpp, &vp, __ATOMIC_SEQ_CST); } 303 315 304 316 { 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 2 16 int f; 3 17 … … 7 21 (char)f; 8 22 (int(*)())f; 23 24 unsigned char v; 25 short int v; 26 3, v; // implicit void cast 9 27 } 10 28 11 //Dummy main 12 int main(int argc, char const *argv[]) 13 { 14 return 0; 15 } 29 int main() {} 30 31 // Local Variables: // 32 // tab-width: 4 // 33 // compile-command: "cfa castError.cfa" // 34 // End: // -
tests/completeTypeError.cfa
r6a9d4b4 r933f32f 5 5 forall(dtype T | sized(T)) void quux(T *); 6 6 7 struct A; 8 struct B {}; 7 struct A; // incomplete 8 struct B {}; // complete 9 9 10 10 int main() { 11 int * i;12 void * v;11 int * i; 12 void * v; 13 13 14 14 A * x; … … 19 19 // okay 20 20 *i; 21 * x; // picks B21 *y; 22 22 *z; 23 23 foo(i); … … 32 32 // bad 33 33 *v; 34 * y;34 *x; // ambiguous 35 35 foo(v); 36 36 baz(v); … … 52 52 void qux(T * y) { 53 53 // okay 54 *y; 54 55 bar(y); 55 56 qux(y); … … 58 59 baz(y); 59 60 quux(y); 60 *y;61 61 } 62 62 -
tests/concurrent/examples/boundedBufferEXT.cfa
r6a9d4b4 r933f32f 1 1 // 2 // Cforall Version 1.0.0 Copyright (C) 2018 University of Waterloo 3 // 2 4 // The contents of this file are covered under the licence agreement in the 3 5 // file "LICENCE" distributed with Cforall. … … 8 10 // Created On : Wed Apr 18 22:52:12 2018 9 11 // Last Modified By : Peter A. Buhr 10 // Last Modified On : Tue Dec 11 21:55:02 201811 // Update Count : 912 // Last Modified On : Fri Mar 22 13:41:33 2019 13 // Update Count : 12 12 14 // 13 15 14 #include <stdlib.hfa> 16 #include <stdlib.hfa> // random 15 17 #include <fstream.hfa> 16 18 #include <kernel.hfa> … … 120 122 // Local Variables: // 121 123 // tab-width: 4 // 122 // compile-command: "cfa boundedBufferEXT.c " //124 // compile-command: "cfa boundedBufferEXT.cfa" // 123 125 // End: // -
tests/concurrent/examples/boundedBufferINT.cfa
r6a9d4b4 r933f32f 1 1 // 2 // Cforall Version 1.0.0 Copyright (C) 2017 University of Waterloo 3 // 2 4 // The contents of this file are covered under the licence agreement in the 3 5 // file "LICENCE" distributed with Cforall. … … 8 10 // Created On : Mon Oct 30 12:45:13 2017 9 11 // Last Modified By : Peter A. Buhr 10 // Last Modified On : Tue Dec 11 21:55:45 201811 // Update Count : 8 412 // Last Modified On : Fri Mar 22 13:41:52 2019 13 // Update Count : 88 12 14 // 13 15 14 #include <stdlib.hfa> 16 #include <stdlib.hfa> // random 15 17 #include <fstream.hfa> 16 18 #include <kernel.hfa> … … 121 123 // Local Variables: // 122 124 // tab-width: 4 // 123 // compile-command: "cfa boundedBufferINT.c " //125 // compile-command: "cfa boundedBufferINT.cfa" // 124 126 // End: // -
tests/concurrent/examples/datingService.cfa
r6a9d4b4 r933f32f 1 1 // 2 // Cforall Version 1.0.0 Copyright (C) 2017 University of Waterloo 3 // 2 4 // The contents of this file are covered under the licence agreement in the 3 5 // file "LICENCE" distributed with Cforall. … … 8 10 // Created On : Mon Oct 30 12:56:20 2017 9 11 // Last Modified By : Peter A. Buhr 10 // Last Modified On : Tue Dec 11 21:55:34 201811 // Update Count : 2812 // Last Modified On : Fri Mar 22 13:41:39 2019 13 // Update Count : 31 12 14 // 13 15 14 #include <stdlib.hfa> 16 #include <stdlib.hfa> // random 15 17 #include <fstream.hfa> 16 18 #include <kernel.hfa> … … 110 112 // Local Variables: // 111 113 // tab-width: 4 // 112 // compile-command: "cfa datingService.c " //114 // compile-command: "cfa datingService.cfa" // 113 115 // End: // -
tests/concurrent/examples/matrixSum.cfa
r6a9d4b4 r933f32f 1 // -*- Mode: C -*-2 1 // 3 2 // Cforall Version 1.0.0 Copyright (C) 2017 University of Waterloo … … 11 10 // Created On : Mon Oct 9 08:29:28 2017 12 11 // Last Modified By : Peter A. Buhr 13 // Last Modified On : Tue Dec 11 21:54:55 201814 // Update Count : 1 512 // Last Modified On : Wed Feb 20 08:37:53 2019 13 // Update Count : 16 15 14 // 16 15 -
tests/concurrent/examples/quickSort.cfa
r6a9d4b4 r933f32f 1 // 2 // Cforall Version 1.0.0 Copyright (C) 2017 University of Waterloo 1 3 // 2 4 // The contents of this file are covered under the licence agreement in the … … 9 11 // Created On : Wed Dec 6 12:15:52 2017 10 12 // Last Modified By : Peter A. Buhr 11 // Last Modified On : Sat Dec 22 08:44:27 201812 // Update Count : 1 6813 // Last Modified On : Fri Mar 22 13:42:01 2019 14 // Update Count : 170 13 15 // 14 16 … … 178 180 // Local Variables: // 179 181 // tab-width: 4 // 180 // compile-command: "cfa quickSort.c " //182 // compile-command: "cfa quickSort.cfa" // 181 183 // End: // -
tests/concurrent/waitfor/parse2.cfa
r6a9d4b4 r933f32f 10 10 // Created On : Wed Aug 30 17:53:29 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Aug 30 17:55:17 201713 // Update Count : 212 // Last Modified On : Fri Mar 22 13:42:11 2019 13 // Update Count : 3 14 14 // 15 15 … … 246 246 // Local Variables: // 247 247 // tab-width: 4 // 248 // compile-command: "cfa waitfor.c " //248 // compile-command: "cfa waitfor.cfa" // 249 249 // End: // -
tests/config.py.in
r6a9d4b4 r933f32f 1 #!/usr/bin/env python 1 #!/usr/bin/env python3 2 2 # encoding: utf-8 3 3 """ -
tests/coroutine/.expect/fmtLines.txt
r6a9d4b4 r933f32f 16 16 difi ed B y : Pete r A. 17 17 Buh r// Last Mod ifie 18 d On : T ue D ec 1 1 2319 : 31: 12 2 018/ / Up date20 Cou nt : 3 2/ /#in18 d On : F ri M ar 2 2 13 19 :41: 03 2 019/ / Up date 20 Cou nt : 33/ /#in 21 21 clud e <f stre am.h fa># 22 22 incl ude <cor outi ne.h … … 76 76 th: 4 // // c ompi le-c 77 77 omma nd: "cfa fmt Line 78 s.c " /// / En d: //78 s.cf a" / /// End: // -
tests/coroutine/.in/fmtLines.txt
r6a9d4b4 r933f32f 10 10 // Created On : Sun Sep 17 21:56:15 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Dec 11 23:31:12 201813 // Update Count : 3 212 // Last Modified On : Fri Mar 22 13:41:03 2019 13 // Update Count : 33 14 14 // 15 15 … … 64 64 // Local Variables: // 65 65 // tab-width: 4 // 66 // compile-command: "cfa fmtLines.c " //66 // compile-command: "cfa fmtLines.cfa" // 67 67 // End: // -
tests/coroutine/fibonacci.cfa
r6a9d4b4 r933f32f 10 10 // Created On : Thu Jun 8 07:29:37 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Dec 11 21:57:33 201813 // Update Count : 2 512 // Last Modified On : Fri Mar 22 13:40:35 2019 13 // Update Count : 26 14 14 // 15 15 … … 45 45 // Local Variables: // 46 46 // tab-width: 4 // 47 // compile-command: "cfa fibonacci.c " //47 // compile-command: "cfa fibonacci.cfa" // 48 48 // End: // -
tests/coroutine/fibonacci_1.cfa
r6a9d4b4 r933f32f 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 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) 8 8 // 9 9 // Author : Peter A. Buhr 10 10 // Created On : Thu Apr 26 23:20:08 2018 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T ue Dec 11 21:57:54 201813 // Update Count : 1412 // Last Modified On : Thu Mar 21 08:10:45 2019 13 // Update Count : 25 14 14 // 15 15 … … 17 17 #include <coroutine.hfa> 18 18 19 coroutine Fibonacci { int ret; }; // used for communication19 coroutine Fibonacci { int fn1; }; // used for communication 20 20 21 21 void 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 23 24 for () { 24 ret = fn2;25 fn = fn1 + fn2; fn2 = fn1; fn1 = fn; // general case26 25 suspend(); // restart last resume 26 [fn1, fn] = [fn, fn1 + fn]; // general case 27 27 } // for 28 28 } … … 30 30 int next( Fibonacci & fib ) with( fib ) { 31 31 resume( fib ); // restart last suspend 32 return ret;32 return fn1; 33 33 } 34 34 … … 42 42 // Local Variables: // 43 43 // tab-width: 4 // 44 // compile-command: "cfa fibonacci_1.c " //44 // compile-command: "cfa fibonacci_1.cfa" // 45 45 // End: // -
tests/coroutine/fmtLines.cfa
r6a9d4b4 r933f32f 10 10 // Created On : Sun Sep 17 21:56:15 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Dec 22 18:27:00 201813 // Update Count : 5 712 // Last Modified On : Fri Mar 22 13:41:16 2019 13 // Update Count : 58 14 14 // 15 15 … … 63 63 // Local Variables: // 64 64 // tab-width: 4 // 65 // compile-command: "cfa fmtLines.c " //65 // compile-command: "cfa fmtLines.cfa" // 66 66 // End: // -
tests/coroutine/pingpong.cfa
r6a9d4b4 r933f32f 10 10 // Created On : Wed Sep 20 11:55:23 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Dec 11 21:58:06 201813 // Update Count : 2912 // Last Modified On : Tue Mar 26 17:54:14 2019 13 // Update Count : 35 14 14 // 15 15 … … 20 20 const char * name; 21 21 /* const */ unsigned int N; 22 PingPong *part;22 PingPong & part; 23 23 }; 24 24 25 25 void ?{}( 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 = ∂ 26 this.[name, N] = [name, N]; &this.part = ∂ 30 27 } 31 28 void ?{}( PingPong & this, const char * name, unsigned int N ) { 32 this{ name, N, * (PingPong *)0 };29 this{ name, N, *0p }; // call first constructor 33 30 } 34 31 void cycle( PingPong & pingpong ) { … … 36 33 } 37 34 void partner( PingPong & this, PingPong & part ) { 38 this.part = ∂35 &this.part = ∂ 39 36 resume( this ); 40 37 } 41 void main( PingPong & pingpong ) {// ping's starter ::main, pong's starter ping42 for ( pingpong.N ) {// N ping-pongs43 sout | pingpong.name;44 cycle( *pingpong.part );38 void 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 ); 45 42 } // for 46 43 } … … 53 50 // Local Variables: // 54 51 // tab-width: 4 // 55 // compile-command: "cfa pingpong.c " //52 // compile-command: "cfa pingpong.cfa" // 56 53 // End: // -
tests/coroutine/prodcons.cfa
r6a9d4b4 r933f32f 10 10 // Created On : Mon Sep 18 12:23:39 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Dec 12 23:04:49 201813 // Update Count : 5 312 // Last Modified On : Fri Mar 22 13:41:10 2019 13 // Update Count : 54 14 14 // 15 15 … … 91 91 // Local Variables: // 92 92 // tab-width: 4 // 93 // compile-command: "cfa prodcons.c " //93 // compile-command: "cfa prodcons.cfa" // 94 94 // End: // -
tests/coroutine/runningTotal.cfa
r6a9d4b4 r933f32f 10 10 // Created On : Wed Dec 6 08:05:27 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Dec 11 21:59:00 201813 // Update Count : 412 // Last Modified On : Fri Mar 22 13:40:49 2019 13 // Update Count : 5 14 14 // 15 15 … … 48 48 // Local Variables: // 49 49 // tab-width: 4 // 50 // compile-command: "cfa runningTotal.c " //50 // compile-command: "cfa runningTotal.cfa" // 51 51 // End: // -
tests/declarationSpecifier.cfa
r6a9d4b4 r933f32f 10 10 // Created On : Wed Aug 17 08:21:04 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Nov 6 17:52:59 201813 // Update Count : 312 // Last Modified On : Tue Apr 30 18:20:36 2019 13 // Update Count : 4 14 14 // 15 15 … … 89 89 90 90 //Dummy main 91 int main(int argc, char const *argv[]) 92 { 93 return 0; 94 } 91 int main( int argc, char const * argv[] ) {} 95 92 96 93 // Local Variables: // -
tests/forall.cfa
r6a9d4b4 r933f32f 10 10 // Created On : Wed May 9 08:48:15 2018 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Nov 6 17:53:43 201813 // Update Count : 3 112 // Last Modified On : Tue Mar 19 08:29:38 2019 13 // Update Count : 32 14 14 // 15 15 … … 53 53 right = temp; 54 54 } 55 56 void ?{}( int & c, zero_t ) { c = 0; } // not in prelude57 55 58 56 trait sumable( otype T ) { -
tests/function-operator.cfa
r6a9d4b4 r933f32f 10 10 // Created On : Fri Aug 25 15:21:11 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T ue Dec 4 21:37:09 201813 // Update Count : 912 // Last Modified On : Thu Apr 11 18:27:45 2019 13 // Update Count : 10 14 14 // 15 15 … … 62 62 63 63 // 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))64 forall(otype Generator, otype GenRet | { GenRet ?()(Generator &); }, dtype Iter, otype T | Iterator(Iter, T) | Assignable(T, GenRet)) 65 65 void generate(Iter first, Iter last, Generator & gen) { 66 66 int i = 0; -
tests/io1.cfa
r6a9d4b4 r933f32f 10 10 // Created On : Wed Mar 2 16:56:02 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Dec 21 16:02:55 201813 // Update Count : 11 412 // Last Modified On : Mon Mar 4 21:42:47 2019 13 // Update Count : 115 14 14 // 15 15 … … 19 19 int x = 3, y = 5, z = 7; 20 20 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; 24 24 sout | nl; 25 25 -
tests/io2.cfa
r6a9d4b4 r933f32f 10 10 // Created On : Wed Mar 2 16:56:02 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Dec 21 08:20:14 201813 // Update Count : 11 212 // Last Modified On : Thu Apr 18 08:03:30 2019 13 // Update Count : 113 14 14 // 15 15 … … 97 97 sout | 1 | sepOff | 2 | 3; // locally turn off implicit separator 98 98 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; 99 sout | 1 | 2 | 3 | "\n\n" | sepOn | nonl; // no separator at start of next line 100 100 sout | 1 | 2 | 3; 101 101 sout | nl; -
tests/literals.cfa
r6a9d4b4 r933f32f 10 10 // Created On : Sat Sep 9 16:34:38 2017 11 11 // 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 16 17 #ifdef __CFA__ 17 #include <stdint.h>18 18 #include <fstream.hfa> 19 19 … … 151 151 -0X0123456789.0123456789P-09; -0X0123456789.0123456789P-09f; -0X0123456789.0123456789P-09l; -0X0123456789.0123456789P-09F; -0X0123456789.0123456789P-09L; 152 152 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 153 197 #ifdef __CFA__ 154 198 // fixed-size length … … 167 211 // octal 168 212 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; 170 214 -01234567_l8; -01234567_l16; -01234567_l32; -01234567_l64; -01234567_l8u; -01234567_ul16; -01234567_l32u; -01234567_ul64; 171 215 … … 203 247 +0X0123456789ABCDEF_l8; +0X0123456789ABCDEF_l16; +0X0123456789ABCDEFl32; +0X0123456789ABCDEFl64; +0X0123456789ABCDEF_ul8; +0X0123456789ABCDEF_l16u; +0X0123456789ABCDEFul32; +0X0123456789ABCDEFl64u; 204 248 -0X0123456789ABCDEF_l8; -0X0123456789ABCDEF_l16; -0X0123456789ABCDEFl32; -0X0123456789ABCDEFl64; -0X0123456789ABCDEF_ul8; -0X0123456789ABCDEF_l16u; -0X0123456789ABCDEFul32; -0X0123456789ABCDEFl64u; 205 206 // floating207 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;231 249 232 250 // char, short, int suffix overloading -
tests/loopctrl.cfa
r6a9d4b4 r933f32f 10 10 // Created On : Wed Aug 8 18:32:59 2018 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : S un Dec 23 23:00:29 201813 // Update Count : 7912 // Last Modified On : Sat Apr 13 11:03:09 2019 13 // Update Count : 104 14 14 // 15 15 … … 54 54 for ( i; 5.5 -~ 0.5 ) { sout | i; } sout | nl; 55 55 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; 57 57 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 58 86 enum { N = 10 }; 59 87 for ( N ) { sout | "N"; } sout | nl; 60 88 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; 62 90 63 91 const int start = 3, comp = 10, inc = 2; 64 92 for ( i; start ~ comp ~ inc + 1 ) { sout | i; } sout | nl | nl; 65 93 66 sout | nl;67 94 for ( S s = (S){0}; s < (S){10,10}; s += (S){1} ) { sout | s; } sout | nl; 68 95 for ( s; (S){10,10} ) { sout | s; } sout | nl; … … 76 103 for ( s; (S){10,10} -~ (S){0} ~ (S){1} ) { sout | s; } sout | nl; 77 104 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; 79 120 } 80 121 -
tests/math1.cfa
r6a9d4b4 r933f32f 10 10 // Created On : Fri Apr 22 14:59:21 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Dec 12 16:28:49 201813 // Update Count : 8912 // Last Modified On : Mon Mar 25 22:56:47 2019 13 // Update Count : 109 14 14 // 15 15 … … 49 49 unsigned int e = 2; 50 50 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); 53 54 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; 54 66 } // main 55 67 -
tests/numericConstants.cfa
r6a9d4b4 r933f32f 10 10 // Created On : Wed May 24 22:10:36 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Nov 6 17:59:53 201813 // Update Count : 312 // Last Modified On : Tue Feb 5 08:58:16 2019 13 // Update Count : 5 14 14 // 15 15 … … 67 67 // Local Variables: // 68 68 // tab-width: 4 // 69 // compile-command: "cfa minmax.cfa" //69 // compile-command: "cfa numericConstants.cfa" // 70 70 // End: // -
tests/pybin/settings.py
r6a9d4b4 r933f32f 1 from __future__ import print_function2 3 1 import os 2 import subprocess 4 3 import sys 5 import tools4 from . import tools 6 5 7 6 try : … … 39 38 def __init__(self, arch): 40 39 try: 41 canonical_host = Architecture.make Canonical( config.HOSTARCH )40 canonical_host = Architecture.make_canonical( config.HOSTARCH ) 42 41 except KeyError: 43 42 print("Unkown host architecture %s" % config.HOSTARCH, file=sys.stderr) … … 46 45 if arch: 47 46 try: 48 arch = Architecture.make Canonical( arch )47 arch = Architecture.make_canonical( arch ) 49 48 except KeyError: 50 49 print("Unkown architecture %s" % arch, file=sys.stderr) … … 77 76 78 77 @classmethod 79 def make Canonical(_, arch):78 def make_canonical(_, arch): 80 79 return Architecture.KnownArchitectures[arch] 81 80 … … 84 83 def __init__(self, value): 85 84 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") 87 86 88 87 class Install: 89 88 def __init__(self, value): 90 89 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") 92 91 93 92 class Timeouts: … … 112 111 global install 113 112 global timeout 113 global output_width 114 114 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 122 123 123 124 124 def update MakeCmd(force, jobs):125 def update_make_cmd(force, jobs): 125 126 global make 126 127 127 make = "make" if not force else ("make -j%i" % jobs)128 make = ['make'] if not force else ['make', "-j%i" % jobs] 128 129 129 130 def validate(): 130 131 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 ) 132 133 if make_ret != 0: 133 134 with open (errf, "r") as myfile: … … 139 140 140 141 tools.rm(errf) 142 143 def 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 4 4 5 5 import pybin.settings 6 import datetime7 8 from string import Template9 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)18 6 19 7 # Test class that defines what a test is -
tests/pybin/tools.py
r6a9d4b4 r933f32f 1 from __future__ import print_function2 3 1 import __main__ 4 2 import argparse 3 import contextlib 5 4 import fileinput 6 5 import multiprocessing … … 10 9 import signal 11 10 import stat 11 import subprocess 12 12 import sys 13 import tempfile 13 14 import time 15 import types 14 16 15 17 from pybin import settings 16 from subprocess import Popen, PIPE, STDOUT17 18 18 19 ################################################################################ … … 21 22 22 23 # 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 24 def sh(*cmd, timeout = False, output = None, input = None, error = subprocess.STDOUT): 25 cmd = list(cmd) 27 26 28 27 # if this is a dry_run, only print the commands that would be ran 29 28 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) 31 43 return 0, None 32 44 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) 38 67 39 68 def is_ascii(fname): … … 45 74 return False 46 75 47 code, out = sh("file %s" % fname, print2stdout = False)76 code, out = sh("file %s" % fname, output=subprocess.PIPE) 48 77 if code != 0: 49 78 return False … … 56 85 return match.group(1).startswith("ASCII text") 57 86 87 def is_exe(fname): 88 return os.path.isfile(fname) and os.access(fname, os.X_OK) 89 90 def 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 58 104 # Remove 1 or more files silently 59 105 def 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 ) 65 109 66 110 # Create 1 or more directory 67 111 def 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 ) 73 117 74 118 … … 80 124 # diff two files 81 125 def diff( lhs, rhs ): 82 # diff the output of the files83 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 100 126 # 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 ) 102 141 103 142 # 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 '',143 def 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, 109 148 test_param, 110 149 settings.arch.flags, … … 112 151 settings.install.flags, 113 152 flags, 114 target ,115 redirects116 ])117 return sh( cmd)153 target 154 ] 155 cmd = [s for s in cmd if s] 156 return sh(*cmd, output=output, error=error) 118 157 119 158 def which(program): 120 import os121 def is_exe(fpath):122 return os.path.isfile(fpath) and os.access(fpath, os.X_OK)123 124 159 fpath, fname = os.path.split(program) 125 160 if fpath: … … 134 169 return None 135 170 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 172 def 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) 139 180 140 181 ################################################################################ … … 143 184 # move a file 144 185 def mv(source, dest): 145 ret, _ = sh("mv %s %s" % (source, dest))186 ret, _ = sh("mv", source, dest) 146 187 return ret 147 188 148 189 # cat one file into the other 149 190 def cat(source, dest): 150 ret, _ = sh("cat %s > %s" % (source, dest))191 ret, _ = sh("cat", source, output=dest) 151 192 return ret 152 193 … … 163 204 164 205 # helper function to check if a files contains only a specific string 165 def file ContainsOnly(file, text) :206 def file_contains_only(file, text) : 166 207 with open(file) as f: 167 208 ff = f.read().strip() 168 209 result = ff == text.strip() 169 210 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 182 212 183 213 # transform path to canonical form 184 def canonical Path(path):214 def canonical_path(path): 185 215 abspath = os.path.abspath(__main__.__file__) 186 216 dname = os.path.dirname(abspath) … … 188 218 189 219 # compare path even if form is different 190 def path Cmp(lhs, rhs):191 return canonical Path( lhs ) == canonicalPath( rhs )220 def path_cmp(lhs, rhs): 221 return canonical_path( lhs ) == canonical_path( rhs ) 192 222 193 223 # walk all files in a path 194 def pathWalk( op ): 195 def step(_, dirname, names): 224 def path_walk( op ): 225 dname = settings.SRCDIR 226 for dirname, _, names in os.walk(dname): 196 227 for name in names: 197 228 path = os.path.join(dirname, name) 198 229 op( path ) 199 230 200 # Start the walk201 dname = settings.SRCDIR202 os.path.walk(dname, step, '')203 204 231 ################################################################################ 205 232 # system 206 233 ################################################################################ 207 234 # count number of jobs to create 208 def job Count( options, tests ):235 def job_count( options, tests ): 209 236 # check if the user already passed in a number of jobs for multi-threading 210 237 if not options.jobs: … … 228 255 return min( options.jobs, len(tests) ), force 229 256 230 # setup a proper processor pool with correct signal handling231 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 pool237 238 # handle signals in scope239 class SignalHandling():240 def __enter__(self):241 # enable signal handling242 signal.signal(signal.SIGINT, signal.SIG_DFL)243 244 def __exit__(self, type, value, traceback):245 # disable signal handling246 signal.signal(signal.SIGINT, signal.SIG_IGN)247 248 249 257 # enable core dumps for all the test children 250 258 resource.setrlimit(resource.RLIMIT_CORE, (resource.RLIM_INFINITY, resource.RLIM_INFINITY)) … … 261 269 return False 262 270 raise argparse.ArgumentTypeError(msg) 263 return False264 271 265 272 def fancy_print(text): 266 273 column = which('column') 267 274 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")) 271 276 else: 272 277 print(text) 273 278 274 279 275 def coreInfo(path): 280 def core_info(path): 281 if not os.path.isfile(path): 282 return 1, "ERR Executable path is wrong" 283 276 284 cmd = os.path.join(settings.SRCDIR, "pybin/print-core.gdb") 277 285 if not os.path.isfile(cmd): 278 286 return 1, "ERR Printing format for core dumps not found" 279 287 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" ) 284 289 285 290 if not os.path.isfile(core): 286 291 return 1, "ERR No core dump" 287 292 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) 289 294 290 295 class 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:1 raii/ctor-autogen.cfa:102:1 error: Unique best alternative includes deleted identifier in Generated Cast of: 2 2 Application of 3 3 Deleted Expression … … 27 27 28 28 ... to arguments 29 Cast of:29 Generated Cast of: 30 30 Member Expression, with field: 31 31 x: signed int 32 32 ... from aggregate: 33 Cast of:33 Generated Cast of: 34 34 Variable Expression: m: reference to instance of struct Managed with body 1 35 35 ... to: … … 37 37 ... to: 38 38 reference to signed int 39 Cast of:39 Generated Cast of: 40 40 constant expression (0 0: zero_t) 41 41 ... to: … … 48 48 49 49 ... to arguments 50 Cast of:50 Generated Cast of: 51 51 Variable Expression: x: instance of struct Managed with body 1 52 52 ... to: -
tests/raii/init_once.cfa
r6a9d4b4 r933f32f 10 10 // Created On : Tue Jun 14 15:43:35 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sat Jul 9 11:30:29 201613 // Update Count : 312 // Last Modified On : Fri Mar 22 13:41:26 2019 13 // Update Count : 4 14 14 // 15 15 … … 192 192 // Local Variables: // 193 193 // tab-width: 4 // 194 // compile-command: "cfa init_once.c " //194 // compile-command: "cfa init_once.cfa" // 195 195 // End: // -
tests/rational.cfa
r6a9d4b4 r933f32f 10 10 // Created On : Mon Mar 28 08:43:12 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Tue Dec 4 21:46:42 201813 // Update Count : 6912 // Last Modified On : Wed Mar 27 07:37:17 2019 13 // Update Count : 80 14 14 // 15 15 … … 19 19 #include <fstream.hfa> 20 20 21 // UNNECESSARY, FIX ME22 void ?{}( int & this ) { this = 0; }23 void ?{}( int & this, zero_t ) { this = 0; }24 void ?{}( int & this, one_t ) { this = 1; }25 21 double convert( int i ) { return (double)i; } 26 22 int convert( double d ) { return (int)d; } … … 58 54 sout | a * b; 59 55 sout | a / b; 56 // sout | a \ 2 | b \ 2; // FIX ME 57 // sout | a \ -2 | b \ -2; 60 58 61 59 sout | "conversion"; -
tests/sum.cfa
r6a9d4b4 r933f32f 11 11 // Created On : Wed May 27 17:56:53 2015 12 12 // Last Modified By : Peter A. Buhr 13 // Last Modified On : Sun Dec 23 23:00:38 201814 // Update Count : 28713 // Last Modified On : Sun May 19 11:21:02 2019 14 // Update Count : 330 15 15 // 16 16 17 17 #include <fstream.hfa> 18 18 #include <stdlib.hfa> 19 20 void ?{}( int & c, zero_t ) { c = 0; } // not in prelude21 19 22 20 trait sumable( otype T ) { … … 31 29 T sum( size_t size, T a[] ) { 32 30 T total = 0; // initialize by 0 constructor 33 for ( size_t i = 0; i < size; i += 1)31 for ( i; size ) 34 32 total += a[i]; // select appropriate + 35 33 return total; 36 34 } // sum 37 35 38 // Not in prelude.39 unsigned char ?+?( unsigned char t1, unsigned char t2 ) { return (int)t1 + t2; } // cast forces integer addition, otherwise recursion40 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 49 36 int main( void ) { 50 37 const int low = 5, High = 15, size = High - low; 51 38 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 ) { 54 41 s += v; 55 42 a[i] = v; 56 43 } // for 57 44 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; 59 62 60 63 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 3 2 4 3 from pybin.tools import * … … 9 8 import re 10 9 import sys 10 import tempfile 11 11 import time 12 12 … … 15 15 ################################################################################ 16 16 17 def find Tests():17 def find_tests(): 18 18 expected = [] 19 19 20 def match Test(path):20 def match_test(path): 21 21 match = re.search("^%s\/([\w\/\-_]*).expect\/([\w\-_]+)(\.[\w\-_]+)?\.txt$" % settings.SRCDIR, path) 22 22 if match : … … 28 28 expected.append(test) 29 29 30 path Walk( matchTest )30 path_walk( match_test ) 31 31 32 32 return expected 33 33 34 34 # reads the directory ./.expect and indentifies the tests 35 def list Tests( includes, excludes ):35 def list_tests( includes, excludes ): 36 36 # tests directly in the .expect folder will always be processed 37 test_list = find Tests()37 test_list = find_tests() 38 38 39 39 # if we have a limited number of includes, filter by them … … 52 52 53 53 # from the found tests, filter all the valid tests/desired tests 54 def valid Tests( options ):54 def valid_tests( options ): 55 55 tests = [] 56 56 … … 59 59 if options.regenerate_expected : 60 60 for testname in options.tests : 61 testname = canonical Path( testname )61 testname = canonical_path( testname ) 62 62 if Test.valid_name(testname): 63 found = [test for test in all Tests if canonicalPath( test.target() ) == testname]63 found = [test for test in all_tests if canonical_path( test.target() ) == testname] 64 64 tests.append( found[0] if len(found) == 1 else Test.from_target(testname) ) 65 65 else : … … 69 69 # otherwise we only need to validate that all tests are present in the complete list 70 70 for testname in options.tests: 71 test = [t for t in all Tests if pathCmp( t.target(), testname )]71 test = [t for t in all_tests if path_cmp( t.target(), testname )] 72 72 73 73 if test : … … 79 79 80 80 # parses the option 81 def getOptions():81 def parse_args(): 82 82 # create a parser with the arguments for the tests script 83 83 parser = argparse.ArgumentParser(description='Script which runs cforall tests') … … 102 102 print('ERROR: invalid arguments', file=sys.stderr) 103 103 parser.print_help(sys.stderr) 104 104 sys.exit(1) 105 105 106 106 # script must have at least some tests to run or be listing … … 112 112 # check that exactly one of the booleans is set to true 113 113 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) 115 115 parser.print_help() 116 116 sys.exit(1) … … 124 124 return val == 0 or settings.dry_run 125 125 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) 126 def no_rule(file, target): 127 return not settings.dry_run and file_contains_only(file, "make: *** No rule to make target `%s'. Stop." % target) 131 128 132 129 # logic to run a single test and return the result (No handling of printing or other test framework logic) … … 145 142 # build, skipping to next test on error 146 143 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 150 146 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 156 170 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 181 180 182 181 … … 189 188 # run a single test and handle the errors, outputs, printing, exception handling, etc. 190 189 def run_test_worker(t) : 191 192 with SignalHandling(): 190 try : 193 191 # print formated name 194 name_txt = "%24s " % t.name192 name_txt = '{0:{width}} '.format(t.target(), width=settings.output_width) 195 193 196 194 retcode, error, duration = run_single_test(t) … … 200 198 201 199 #print result with error if needed 202 text = name_txt + result_txt200 text = '\t' + name_txt + result_txt 203 201 out = sys.stdout 204 202 if error : 205 text = text + "\n"+ error203 text = text + '\n' + error 206 204 out = sys.stderr 207 205 … … 210 208 sys.stderr.flush() 211 209 212 return retcode != TestResult.SUCCESS 210 return retcode != TestResult.SUCCESS 211 except KeyboardInterrupt: 212 False 213 213 214 214 # run the given list of tests with the given parameters 215 215 def run_tests(tests, jobs) : 216 216 # clean the sandbox from previous commands 217 make('clean', redirects = '> /dev/null 2>&1')217 make('clean', output=subprocess.DEVNULL, error=subprocess.DEVNULL) 218 218 219 219 # create the executor for our jobs and handle the signal properly 220 pool = setupPool(jobs)220 pool = multiprocessing.Pool(jobs) 221 221 222 222 # for each test to run … … 233 233 234 234 # clean the workspace 235 make('clean', redirects = '> /dev/null 2>&1')235 make('clean', output=subprocess.DEVNULL, error=subprocess.DEVNULL) 236 236 237 237 for failed in results: … … 248 248 249 249 # parse the command line arguments 250 options = getOptions()250 options = parse_args() 251 251 252 252 # init global settings … … 254 254 255 255 # fetch the liest of all valid tests 256 all Tests = listTests( options.include, options.exclude )256 all_tests = list_tests( options.include, options.exclude ) 257 257 258 258 259 259 # if user wants all tests than no other treatement of the test list is required 260 260 if options.all or options.list or options.list_comp or options.include : 261 tests = all Tests261 tests = all_tests 262 262 263 263 #otherwise we need to validate that the test list that was entered is valid 264 264 else : 265 tests = valid Tests( options )265 tests = valid_tests( options ) 266 266 267 267 # make sure we have at least some test to run … … 281 281 elif options.list : 282 282 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))) 284 284 285 285 else : 286 286 # check the build configuration works 287 settings.prep_output(tests) 287 288 settings.validate() 288 289 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, 294 297 settings.arch.string, 295 settings.debug.string, 296 options.jobs 298 settings.debug.string 297 299 )) 298 300 -
tests/warnings/.expect/self-assignment.txt
r6a9d4b4 r933f32f 1 warnings/self-assignment.cfa:29:1 warning: self assignment of expression: Cast of:1 warnings/self-assignment.cfa:29:1 warning: self assignment of expression: Generated Cast of: 2 2 Variable Expression: j: signed int 3 3 ... to: 4 4 reference to signed int 5 warnings/self-assignment.cfa:30:1 warning: self assignment of expression: Cast of:5 warnings/self-assignment.cfa:30:1 warning: self assignment of expression: Generated Cast of: 6 6 Variable Expression: s: instance of struct S with body 1 7 7 ... to: 8 8 reference to instance of struct S with body 1 9 warnings/self-assignment.cfa:31:1 warning: self assignment of expression: Cast of:9 warnings/self-assignment.cfa:31:1 warning: self assignment of expression: Generated Cast of: 10 10 Member Expression, with field: 11 11 i: signed int … … 14 14 ... to: 15 15 reference to signed int 16 warnings/self-assignment.cfa:32:1 warning: self assignment of expression: Cast of:16 warnings/self-assignment.cfa:32:1 warning: self assignment of expression: Generated Cast of: 17 17 Member Expression, with field: 18 18 i: signed int -
tests/warnings/self-assignment.cfa
r6a9d4b4 r933f32f 9 9 // Author : Rob Schluntz 10 10 // Created On : Thu Mar 1 13:53:57 2018 11 // Last Modified By : Rob Schluntz12 // Last Modified On : Thu Mar 1 13:53:57 201813 // Update Count : 211 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Feb 20 07:56:17 2019 13 // Update Count : 3 14 14 // 15 15 16 16 struct S { 17 17 int i; 18 18 }; 19 19 20 20 struct T { 21 21 S s; 22 22 }; 23 23 24 24 int main() { 25 26 27 25 int j = 0; 26 S s = { 0 }; 27 T t = { { 0 } }; 28 28 29 30 31 32 29 j = j; 30 s = s; 31 s.i = s.i; 32 t.s.i = t.s.i; 33 33 } 34 34
Note:
See TracChangeset
for help on using the changeset viewer.