Changes in / [0db817e:d2e2865]
- Location:
- src
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Concurrency/Waitfor.cc
r0db817e rd2e2865 190 190 191 191 Statement * makeAccStatement( DeclarationWithType * object, unsigned long index, const std::string & member, Expression * value, const SymTab::Indexer & indexer ) { 192 std::unique_ptr< Expression > expr(makeOpAssign(192 Expression * expr = makeOpAssign( 193 193 makeOpMember( 194 194 makeOpIndex( … … 199 199 ), 200 200 value 201 ) ); 202 203 return new ExprStmt( noLabels, ResolvExpr::findVoidExpression( expr.get(), indexer ) ); 201 ); 202 203 ResolvExpr::findVoidExpression( expr, indexer ); 204 205 return new ExprStmt( noLabels, expr ); 204 206 } 205 207 … … 313 315 stmt->push_back( new DeclStmt( noLabels, acceptables) ); 314 316 315 UntypedExpr* set = new UntypedExpr(317 Expression * set = new UntypedExpr( 316 318 new NameExpr( "__builtin_memset" ), 317 319 { … … 322 324 ); 323 325 324 Expression * resolved_set = ResolvExpr::findVoidExpression( set, indexer ); 325 delete set; 326 327 stmt->push_back( new ExprStmt( noLabels, resolved_set ) ); 326 ResolvExpr::findVoidExpression( set, indexer ); 327 328 stmt->push_back( new ExprStmt( noLabels, set ) ); 328 329 329 330 return acceptables; … … 346 347 347 348 Statement * GenerateWaitForPass::makeSetter( ObjectDecl * flag ) { 348 Expression * untyped= new UntypedExpr(349 Expression * expr = new UntypedExpr( 349 350 new NameExpr( "?=?" ), 350 351 { … … 354 355 ); 355 356 356 Expression * expr = ResolvExpr::findVoidExpression( untyped, indexer ); 357 delete untyped; 357 ResolvExpr::findVoidExpression( expr, indexer ); 358 358 359 359 return new ExprStmt( noLabels, expr ); … … 379 379 new ListInit( 380 380 map_range < std::list<Initializer*> > ( clause.target.arguments, [this](Expression * expr ){ 381 Expression * untyped= new CastExpr(381 Expression * init = new CastExpr( 382 382 new UntypedExpr( 383 383 new NameExpr( "get_monitor" ), … … 393 393 ); 394 394 395 Expression * init = ResolvExpr::findSingleExpression( untyped, indexer ); 396 delete untyped; 395 ResolvExpr::findSingleExpression( init, indexer ); 397 396 return new SingleInit( init ); 398 397 }) -
src/InitTweak/FixInit.cc
r0db817e rd2e2865 367 367 ImplicitCtorDtorStmt * stmt = genCtorDtor( fname, var, cpArg ); 368 368 ExprStmt * exprStmt = strict_dynamic_cast< ExprStmt * >( stmt->get_callStmt() ); 369 Expression * untyped = exprStmt->get_expr(); 369 Expression * resolved = exprStmt->expr; 370 exprStmt->expr = nullptr; // take ownership of expr 370 371 371 372 // resolve copy constructor 372 373 // should only be one alternative for copy ctor and dtor expressions, since all arguments are fixed 373 374 // (VariableExpr and already resolved expression) 374 CP_CTOR_PRINT( std::cerr << "ResolvingCtorDtor " << untyped << std::endl; )375 Expression * resolved = ResolvExpr::findVoidExpression( untyped, indexer );375 CP_CTOR_PRINT( std::cerr << "ResolvingCtorDtor " << resolved << std::endl; ) 376 ResolvExpr::findVoidExpression( resolved, indexer ); 376 377 assert( resolved ); 377 378 if ( resolved->get_env() ) { … … 381 382 resolved->set_env( nullptr ); 382 383 } // if 383 384 384 delete stmt; 385 385 return resolved; … … 1112 1112 } 1113 1113 1114 DeclarationWithType * MutatingResolver::mutate( ObjectDecl * objectDecl ) {1114 DeclarationWithType * MutatingResolver::mutate( ObjectDecl * objectDecl ) { 1115 1115 // add object to the indexer assumes that there will be no name collisions 1116 1116 // in generated code. If this changes, add mutate methods for entities with … … 1120 1120 } 1121 1121 1122 Expression* MutatingResolver::mutate( UntypedExpr *untypedExpr ) { 1123 return strict_dynamic_cast< ApplicationExpr * >( ResolvExpr::findVoidExpression( untypedExpr, indexer ) ); 1122 Expression * MutatingResolver::mutate( UntypedExpr * untypedExpr ) { 1123 Expression * newExpr = untypedExpr; 1124 ResolvExpr::findVoidExpression( newExpr, indexer ); 1125 return newExpr; 1124 1126 } 1125 1127 … … 1146 1148 1147 1149 // resolve assignment and dispose of new env 1148 Expression * resolvedAssign = ResolvExpr::findVoidExpression( assign, indexer ); 1149 delete resolvedAssign->env; 1150 resolvedAssign->env = nullptr; 1151 delete assign; 1150 ResolvExpr::findVoidExpression( assign, indexer ); 1151 delete assign->env; 1152 assign->env = nullptr; 1152 1153 1153 1154 // for constructor expr: … … 1158 1159 // T & tmp; 1159 1160 // &tmp = &x, ?{}(tmp), tmp 1160 CommaExpr * commaExpr = new CommaExpr( resolvedAssign, new CommaExpr( callExpr, new VariableExpr( tmp ) ) );1161 CommaExpr * commaExpr = new CommaExpr( assign, new CommaExpr( callExpr, new VariableExpr( tmp ) ) ); 1161 1162 commaExpr->set_env( env ); 1162 1163 return commaExpr; -
src/MakeLibCfa.cc
r0db817e rd2e2865 119 119 newDecls.push_back( funcDecl ); 120 120 121 Statement * stmt = nullptr; 121 122 switch ( opInfo.type ) { 122 123 case CodeGen::OT_INDEX: … … 128 129 case CodeGen::OT_POSTFIXASSIGN: 129 130 case CodeGen::OT_INFIXASSIGN: 131 // return the recursive call 132 stmt = new ReturnStmt( noLabels, newExpr ); 133 break; 130 134 case CodeGen::OT_CTOR: 131 135 case CodeGen::OT_DTOR: 132 // returnthe recursive call133 funcDecl->get_statements()->get_kids().push_back( new ReturnStmt( std::list< Label >(), newExpr ));136 // execute the recursive call 137 stmt = new ExprStmt( noLabels, newExpr ); 134 138 break; 135 139 case CodeGen::OT_CONSTANT: … … 138 142 assert( false ); 139 143 } // switch 144 funcDecl->get_statements()->push_back( stmt ); 140 145 } 141 146 } // namespace -
src/ResolvExpr/AlternativeFinder.cc
r0db817e rd2e2865 1268 1268 // O(N^2) checks of d-types with e-types 1269 1269 for ( InitAlternative & initAlt : initExpr->get_initAlts() ) { 1270 Type * toType = resolveTypeof( initAlt.type , indexer );1270 Type * toType = resolveTypeof( initAlt.type->clone(), indexer ); 1271 1271 SymTab::validateType( toType, &indexer ); 1272 1272 adjustExprType( toType, env, indexer ); -
src/ResolvExpr/Resolver.cc
r0db817e rd2e2865 109 109 110 110 namespace { 111 void finishExpr( Expression *expr, const TypeEnvironment &env ) {112 expr-> set_env( new TypeSubstitution );111 void finishExpr( Expression *expr, const TypeEnvironment &env, TypeSubstitution * oldenv = nullptr ) { 112 expr->env = oldenv ? oldenv->clone() : new TypeSubstitution; 113 113 env.makeSubstitution( *expr->get_env() ); 114 114 } 115 115 } // namespace 116 116 117 Expression *findVoidExpression( Expression *untyped, const SymTab::Indexer &indexer ) {117 void findVoidExpression( Expression *& untyped, const SymTab::Indexer &indexer ) { 118 118 global_renamer.reset(); 119 119 TypeEnvironment env; 120 120 Expression *newExpr = resolveInVoidContext( untyped, indexer, env ); 121 finishExpr( newExpr, env ); 122 return newExpr; 123 } 124 125 Expression * findSingleExpression( Expression *untyped, const SymTab::Indexer &indexer ) { 121 finishExpr( newExpr, env, untyped->env ); 122 delete untyped; 123 untyped = newExpr; 124 } 125 126 void findSingleExpression( Expression *&untyped, const SymTab::Indexer &indexer ) { 127 if ( ! untyped ) return; 126 128 TypeEnvironment env; 127 129 AlternativeFinder finder( indexer, env ); … … 129 131 #if 0 130 132 if ( finder.get_alternatives().size() != 1 ) { 131 std::c out<< "untyped expr is ";132 untyped->print( std::c out);133 std::c out<< std::endl << "alternatives are:";134 for ( std::list< Alternative >::const_iterator i = finder.get_alternatives().begin(); i != finder.get_alternatives().end(); ++i) {135 i->print( std::cout);133 std::cerr << "untyped expr is "; 134 untyped->print( std::cerr ); 135 std::cerr << std::endl << "alternatives are:"; 136 for ( const Alternative & alt : finder.get_alternatives() ) { 137 alt.print( std::cerr ); 136 138 } // for 137 139 } // if … … 140 142 Alternative &choice = finder.get_alternatives().front(); 141 143 Expression *newExpr = choice.expr->clone(); 142 finishExpr( newExpr, choice.env ); 143 return newExpr; 144 finishExpr( newExpr, choice.env, untyped->env ); 145 delete untyped; 146 untyped = newExpr; 147 } 148 149 void findSingleExpression( Expression *& untyped, Type * type, const SymTab::Indexer & indexer ) { 150 assert( untyped && type ); 151 untyped = new CastExpr( untyped, type ); 152 findSingleExpression( untyped, indexer ); 153 if ( CastExpr * castExpr = dynamic_cast< CastExpr * >( untyped ) ) { 154 if ( ResolvExpr::typesCompatible( castExpr->arg->result, castExpr->result, indexer ) ) { 155 // cast is to the same type as its argument, so it's unnecessary -- remove it 156 untyped = castExpr->arg; 157 castExpr->arg = nullptr; 158 delete castExpr; 159 } 160 } 144 161 } 145 162 … … 157 174 } 158 175 159 Expression *findIntegralExpression( Expression *untyped, const SymTab::Indexer &indexer ) {176 void findIntegralExpression( Expression *& untyped, const SymTab::Indexer &indexer ) { 160 177 TypeEnvironment env; 161 178 AlternativeFinder finder( indexer, env ); … … 186 203 throw SemanticError( "No interpretations for case control expression", untyped ); 187 204 } // if 188 finishExpr( newExpr, *newEnv ); 189 return newExpr; 205 finishExpr( newExpr, *newEnv, untyped->env ); 206 delete untyped; 207 untyped = newExpr; 190 208 } 191 209 … … 212 230 void Resolver::handlePtrType( PtrType * type ) { 213 231 if ( type->get_dimension() ) { 214 CastExpr *castExpr = new CastExpr( type->get_dimension(), SymTab::SizeType->clone() ); 215 Expression *newExpr = findSingleExpression( castExpr, indexer ); 216 delete type->get_dimension(); 217 type->set_dimension( newExpr ); 232 findSingleExpression( type->dimension, SymTab::SizeType->clone(), indexer ); 218 233 } 219 234 } … … 268 283 void Resolver::previsit( ExprStmt *exprStmt ) { 269 284 visit_children = false; 270 assertf( exprStmt->get_expr(), "ExprStmt has null Expression in resolver" ); 271 Expression *newExpr = findVoidExpression( exprStmt->get_expr(), indexer ); 272 delete exprStmt->get_expr(); 273 exprStmt->set_expr( newExpr ); 285 assertf( exprStmt->expr, "ExprStmt has null Expression in resolver" ); 286 findVoidExpression( exprStmt->expr, indexer ); 274 287 } 275 288 276 289 void Resolver::previsit( AsmExpr *asmExpr ) { 277 290 visit_children = false; 278 Expression *newExpr = findVoidExpression( asmExpr->get_operand(), indexer ); 279 delete asmExpr->get_operand(); 280 asmExpr->set_operand( newExpr ); 291 findVoidExpression( asmExpr->operand, indexer ); 281 292 if ( asmExpr->get_inout() ) { 282 newExpr = findVoidExpression( asmExpr->get_inout(), indexer ); 283 delete asmExpr->get_inout(); 284 asmExpr->set_inout( newExpr ); 293 findVoidExpression( asmExpr->inout, indexer ); 285 294 } // if 286 295 } … … 293 302 294 303 void Resolver::previsit( IfStmt *ifStmt ) { 295 Expression *newExpr = findSingleExpression( ifStmt->get_condition(), indexer ); 296 delete ifStmt->get_condition(); 297 ifStmt->set_condition( newExpr ); 304 findSingleExpression( ifStmt->condition, indexer ); 298 305 } 299 306 300 307 void Resolver::previsit( WhileStmt *whileStmt ) { 301 Expression *newExpr = findSingleExpression( whileStmt->get_condition(), indexer ); 302 delete whileStmt->get_condition(); 303 whileStmt->set_condition( newExpr ); 308 findSingleExpression( whileStmt->condition, indexer ); 304 309 } 305 310 306 311 void Resolver::previsit( ForStmt *forStmt ) { 307 if ( forStmt->get_condition() ) { 308 Expression * newExpr = findSingleExpression( forStmt->get_condition(), indexer ); 309 delete forStmt->get_condition(); 310 forStmt->set_condition( newExpr ); 312 if ( forStmt->condition ) { 313 findSingleExpression( forStmt->condition, indexer ); 311 314 } // if 312 315 313 if ( forStmt->get_increment() ) { 314 Expression * newExpr = findVoidExpression( forStmt->get_increment(), indexer ); 315 delete forStmt->get_increment(); 316 forStmt->set_increment( newExpr ); 316 if ( forStmt->increment ) { 317 findVoidExpression( forStmt->increment, indexer ); 317 318 } // if 318 319 } … … 320 321 void Resolver::previsit( SwitchStmt *switchStmt ) { 321 322 GuardValue( currentObject ); 322 Expression *newExpr; 323 newExpr = findIntegralExpression( switchStmt->get_condition(), indexer ); 324 delete switchStmt->get_condition(); 325 switchStmt->set_condition( newExpr ); 326 327 currentObject = CurrentObject( newExpr->get_result() ); 323 findIntegralExpression( switchStmt->condition, indexer ); 324 325 currentObject = CurrentObject( switchStmt->condition->result ); 328 326 } 329 327 … … 332 330 std::list< InitAlternative > initAlts = currentObject.getOptions(); 333 331 assertf( initAlts.size() == 1, "SwitchStmt did not correctly resolve an integral expression." ); 334 CastExpr * castExpr = new CastExpr( caseStmt->get_condition(), initAlts.front().type->clone() ); 335 Expression * newExpr = findSingleExpression( castExpr, indexer ); 336 castExpr = strict_dynamic_cast< CastExpr * >( newExpr ); 337 caseStmt->set_condition( castExpr->get_arg() ); 338 castExpr->set_arg( nullptr ); 332 // must remove cast from case statement because RangeExpr cannot be cast. 333 Expression * newExpr = new CastExpr( caseStmt->condition, initAlts.front().type->clone() ); 334 findSingleExpression( newExpr, indexer ); 335 CastExpr * castExpr = strict_dynamic_cast< CastExpr * >( newExpr ); 336 caseStmt->condition = castExpr->arg; 337 castExpr->arg = nullptr; 339 338 delete castExpr; 340 339 } … … 345 344 // must resolve the argument for a computed goto 346 345 if ( branchStmt->get_type() == BranchStmt::Goto ) { // check for computed goto statement 347 if ( Expression * arg = branchStmt->get_computedTarget() ) { 348 VoidType v = Type::Qualifiers(); // cast to void * for the alternative finder 349 PointerType pt( Type::Qualifiers(), v.clone() ); 350 CastExpr * castExpr = new CastExpr( arg, pt.clone() ); 351 Expression * newExpr = findSingleExpression( castExpr, indexer ); // find best expression 352 branchStmt->set_target( newExpr ); 346 if ( branchStmt->computedTarget ) { 347 // computed goto argument is void * 348 findSingleExpression( branchStmt->computedTarget, new PointerType( Type::Qualifiers(), new VoidType( Type::Qualifiers() ) ), indexer ); 353 349 } // if 354 350 } // if … … 357 353 void Resolver::previsit( ReturnStmt *returnStmt ) { 358 354 visit_children = false; 359 if ( returnStmt->get_expr() ) { 360 CastExpr *castExpr = new CastExpr( returnStmt->get_expr(), functionReturn->clone() ); 361 Expression *newExpr = findSingleExpression( castExpr, indexer ); 362 delete castExpr; 363 returnStmt->set_expr( newExpr ); 355 if ( returnStmt->expr ) { 356 findSingleExpression( returnStmt->expr, functionReturn->clone(), indexer ); 364 357 } // if 365 358 } … … 372 365 indexer.lookupStruct( "__cfaehm__base_exception_t" ); 373 366 assert( exception_decl ); 374 Expression * wrapped = new CastExpr( 375 throwStmt->get_expr(), 376 new PointerType( 377 noQualifiers, 378 new StructInstType( 379 noQualifiers, 380 exception_decl 381 ) 382 ) 383 ); 384 Expression * newExpr = findSingleExpression( wrapped, indexer ); 385 throwStmt->set_expr( newExpr ); 367 Type * exceptType = new PointerType( noQualifiers, new StructInstType( noQualifiers, exception_decl ) ); 368 findSingleExpression( throwStmt->expr, exceptType, indexer ); 386 369 } 387 370 } 388 371 389 372 void Resolver::previsit( CatchStmt *catchStmt ) { 390 if ( catchStmt->get_cond() ) { 391 Expression * wrapped = new CastExpr( 392 catchStmt->get_cond(), 393 new BasicType( noQualifiers, BasicType::Bool ) 394 ); 395 catchStmt->set_cond( findSingleExpression( wrapped, indexer ) ); 396 } 397 } 398 399 inline void resolveAsIf( Expression *& expr, SymTab::Indexer & indexer ) { 400 if( !expr ) return; 401 Expression * newExpr = findSingleExpression( expr, indexer ); 402 delete expr; 403 expr = newExpr; 404 } 405 406 inline void resolveAsType( Expression *& expr, Type * type, SymTab::Indexer & indexer ) { 407 if( !expr ) return; 408 Expression * newExpr = findSingleExpression( new CastExpr( expr, type ), indexer ); 409 delete expr; 410 expr = newExpr; 373 if ( catchStmt->cond ) { 374 findSingleExpression( catchStmt->cond, new BasicType( noQualifiers, BasicType::Bool ), indexer ); 375 } 411 376 } 412 377 … … 578 543 // Resolve the conditions as if it were an IfStmt 579 544 // Resolve the statments normally 580 resolveAsIf( clause.condition, this->indexer );545 findSingleExpression( clause.condition, this->indexer ); 581 546 clause.statement->accept( *visitor ); 582 547 } … … 587 552 // Resolve the conditions as if it were an IfStmt 588 553 // Resolve the statments normally 589 resolveAsType( stmt->timeout.time, new BasicType( noQualifiers, BasicType::LongLongUnsignedInt ), this->indexer );590 resolveAsIf( stmt->timeout.condition, this->indexer );554 findSingleExpression( stmt->timeout.time, new BasicType( noQualifiers, BasicType::LongLongUnsignedInt ), this->indexer ); 555 findSingleExpression( stmt->timeout.condition, this->indexer ); 591 556 stmt->timeout.statement->accept( *visitor ); 592 557 } … … 595 560 // Resolve the conditions as if it were an IfStmt 596 561 // Resolve the statments normally 597 resolveAsIf( stmt->orelse.condition, this->indexer );562 findSingleExpression( stmt->orelse.condition, this->indexer ); 598 563 stmt->orelse.statement->accept( *visitor ); 599 564 } … … 612 577 visit_children = false; 613 578 // resolve initialization using the possibilities as determined by the currentObject cursor 614 UntypedInitExpr * untyped= new UntypedInitExpr( singleInit->get_value(), currentObject.getOptions() );615 Expression * newExpr = findSingleExpression( untyped, indexer );579 Expression * newExpr = new UntypedInitExpr( singleInit->get_value(), currentObject.getOptions() ); 580 findSingleExpression( newExpr, indexer ); 616 581 InitExpr * initExpr = strict_dynamic_cast< InitExpr * >( newExpr ); 617 582 … … 620 585 621 586 // discard InitExpr wrapper and retain relevant pieces 622 newExpr = initExpr->get_expr(); 623 newExpr->set_env( initExpr->get_env() ); 624 initExpr->set_expr( nullptr ); 625 initExpr->set_env( nullptr ); 587 newExpr = initExpr->expr; 588 initExpr->expr = nullptr; 589 std::swap( initExpr->env, newExpr->env ); 626 590 delete initExpr; 627 591 -
src/ResolvExpr/Resolver.h
r0db817e rd2e2865 30 30 void resolve( std::list< Declaration * > translationUnit ); 31 31 void resolveDecl( Declaration *, const SymTab::Indexer &indexer ); 32 Expression *resolveInVoidContext( Expression * expr, const SymTab::Indexer &indexer );33 Expression *findVoidExpression( Expression *untyped, const SymTab::Indexer &indexer );34 Expression * findSingleExpression( Expression *untyped, const SymTab::Indexer &indexer );32 Expression *resolveInVoidContext( Expression * expr, const SymTab::Indexer &indexer ); 33 void findVoidExpression( Expression *& untyped, const SymTab::Indexer &indexer ); 34 void findSingleExpression( Expression *& untyped, const SymTab::Indexer &indexer ); 35 35 void resolveCtorInit( ConstructorInit * ctorInit, const SymTab::Indexer & indexer ); 36 36 void resolveStmtExpr( StmtExpr * stmtExpr, const SymTab::Indexer & indexer ); -
src/SymTab/Validate.cc
r0db817e rd2e2865 276 276 ReturnChecker::checkFunctionReturns( translationUnit ); 277 277 mutateAll( translationUnit, compoundliteral ); 278 acceptAll( translationUnit, fpd ); 278 acceptAll( translationUnit, fpd ); // must happen before autogenerateRoutines 279 279 ArrayLength::computeLength( translationUnit ); 280 280 acceptAll( translationUnit, finder ); -
src/libcfa/Makefile.am
r0db817e rd2e2865 31 31 32 32 libcfa_a-libcfa-prelude.o : libcfa-prelude.c 33 ${AM_V_GEN}@BACKEND_CC@ @CFA_FLAGS@ - O2 -c -o $@ $<33 ${AM_V_GEN}@BACKEND_CC@ @CFA_FLAGS@ -Wall -O2 -c -o $@ $< 34 34 35 35 libcfa_d_a-libcfa-prelude.o : libcfa-prelude.c 36 ${AM_V_GEN}@BACKEND_CC@ @CFA_FLAGS@ -D__CFA_DEBUG__ - O0 -c -o $@ $<36 ${AM_V_GEN}@BACKEND_CC@ @CFA_FLAGS@ -D__CFA_DEBUG__ -Wall -O0 -c -o $@ $< 37 37 38 38 EXTRA_FLAGS = -g -Wall -Wno-unused-function -imacros libcfa-prelude.c @CFA_FLAGS@ -
src/libcfa/Makefile.in
r0db817e rd2e2865 1498 1498 1499 1499 libcfa_a-libcfa-prelude.o : libcfa-prelude.c 1500 ${AM_V_GEN}@BACKEND_CC@ @CFA_FLAGS@ - O2 -c -o $@ $<1500 ${AM_V_GEN}@BACKEND_CC@ @CFA_FLAGS@ -Wall -O2 -c -o $@ $< 1501 1501 1502 1502 libcfa_d_a-libcfa-prelude.o : libcfa-prelude.c 1503 ${AM_V_GEN}@BACKEND_CC@ @CFA_FLAGS@ -D__CFA_DEBUG__ - O0 -c -o $@ $<1503 ${AM_V_GEN}@BACKEND_CC@ @CFA_FLAGS@ -D__CFA_DEBUG__ -Wall -O0 -c -o $@ $< 1504 1504 1505 1505 # extensionless header files are overridden by -o flag in default makerule => explicitly override default rule to silently do nothing -
src/tests/.expect/64/KRfunctions.txt
r0db817e rd2e2865 34 34 ((void)((*___dst__R2sS_1).__i__i_1=___src__2sS_1.__i__i_1)); 35 35 ((void)___constructor__F_R2sS2sS_autogen___1((&___ret__2sS_1), ___src__2sS_1)); 36 return ((struct S )___ret__2sS_1);36 return ___ret__2sS_1; 37 37 } 38 38 static inline void ___constructor__F_R2sSi_autogen___1(struct S *___dst__R2sS_1, signed int __i__i_1){ … … 65 65 signed int *__x__FPi_ii__2(signed int __anonymous_object2, signed int __anonymous_object3); 66 66 ((void)(___retval_f10__PFPi_ii__1=__x__FPi_ii__2) /* ?{} */); 67 return ((signed int *(*)(signed int __x__i_1, signed int __y__i_1))___retval_f10__PFPi_ii__1);67 return ___retval_f10__PFPi_ii__1; 68 68 } 69 69 signed int (*__f11__FPA0i_iPiPi__1(signed int __a__i_1, signed int *__b__Pi_1, signed int *__c__Pi_1))[]{ -
src/tests/.expect/64/attributes.txt
r0db817e rd2e2865 24 24 struct __anonymous0 ___ret__13s__anonymous0_1; 25 25 ((void)___constructor__F_R13s__anonymous013s__anonymous0_autogen___1((&___ret__13s__anonymous0_1), ___src__13s__anonymous0_1)); 26 return ((struct __anonymous0 )___ret__13s__anonymous0_1);26 return ___ret__13s__anonymous0_1; 27 27 } 28 28 __attribute__ ((unused)) struct Agn1; … … 42 42 struct Agn2 ___ret__5sAgn2_1; 43 43 ((void)___constructor__F_R5sAgn25sAgn2_autogen___1((&___ret__5sAgn2_1), ___src__5sAgn2_1)); 44 return ((struct Agn2 )___ret__5sAgn2_1);44 return ___ret__5sAgn2_1; 45 45 } 46 46 enum __attribute__ ((unused)) __anonymous1 { … … 114 114 ((void)((*___dst__R4sFdl_1).__f9__Pi_1=___src__4sFdl_1.__f9__Pi_1)); 115 115 ((void)___constructor__F_R4sFdl4sFdl_autogen___1((&___ret__4sFdl_1), ___src__4sFdl_1)); 116 return ((struct Fdl )___ret__4sFdl_1);116 return ___ret__4sFdl_1; 117 117 } 118 118 static inline void ___constructor__F_R4sFdli_autogen___1(struct Fdl *___dst__R4sFdl_1, signed int __f1__i_1){ … … 301 301 ((void)((*___dst__R13s__anonymous4_2).__i__i_2=___src__13s__anonymous4_2.__i__i_2)); 302 302 ((void)___constructor__F_R13s__anonymous413s__anonymous4_autogen___2((&___ret__13s__anonymous4_2), ___src__13s__anonymous4_2)); 303 return ((struct __anonymous4 )___ret__13s__anonymous4_2);303 return ___ret__13s__anonymous4_2; 304 304 } 305 305 inline void ___constructor__F_R13s__anonymous4i_autogen___2(struct __anonymous4 *___dst__R13s__anonymous4_2, signed int __i__i_2){ … … 320 320 enum __anonymous5 ___ret__13e__anonymous5_2; 321 321 ((void)(___ret__13e__anonymous5_2=((*___dst__R13e__anonymous5_2)=___src__13e__anonymous5_2)) /* ?{} */); 322 return ((enum __anonymous5 )___ret__13e__anonymous5_2);322 return ___ret__13e__anonymous5_2; 323 323 } 324 324 ((void)sizeof(enum __anonymous5 )); … … 350 350 struct Vad ___ret__4sVad_1; 351 351 ((void)___constructor__F_R4sVad4sVad_autogen___1((&___ret__4sVad_1), ___src__4sVad_1)); 352 return ((struct Vad )___ret__4sVad_1);353 } 352 return ___ret__4sVad_1; 353 } -
src/tests/.expect/64/declarationSpecifier.txt
r0db817e rd2e2865 33 33 ((void)((*___dst__R13s__anonymous0_1).__i__i_1=___src__13s__anonymous0_1.__i__i_1)); 34 34 ((void)___constructor__F_R13s__anonymous013s__anonymous0_autogen___1((&___ret__13s__anonymous0_1), ___src__13s__anonymous0_1)); 35 return ((struct __anonymous0 )___ret__13s__anonymous0_1);35 return ___ret__13s__anonymous0_1; 36 36 } 37 37 static inline void ___constructor__F_R13s__anonymous0i_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1, signed int __i__i_1){ … … 59 59 ((void)((*___dst__R13s__anonymous1_1).__i__i_1=___src__13s__anonymous1_1.__i__i_1)); 60 60 ((void)___constructor__F_R13s__anonymous113s__anonymous1_autogen___1((&___ret__13s__anonymous1_1), ___src__13s__anonymous1_1)); 61 return ((struct __anonymous1 )___ret__13s__anonymous1_1);61 return ___ret__13s__anonymous1_1; 62 62 } 63 63 static inline void ___constructor__F_R13s__anonymous1i_autogen___1(struct __anonymous1 *___dst__R13s__anonymous1_1, signed int __i__i_1){ … … 85 85 ((void)((*___dst__R13s__anonymous2_1).__i__i_1=___src__13s__anonymous2_1.__i__i_1)); 86 86 ((void)___constructor__F_R13s__anonymous213s__anonymous2_autogen___1((&___ret__13s__anonymous2_1), ___src__13s__anonymous2_1)); 87 return ((struct __anonymous2 )___ret__13s__anonymous2_1);87 return ___ret__13s__anonymous2_1; 88 88 } 89 89 static inline void ___constructor__F_R13s__anonymous2i_autogen___1(struct __anonymous2 *___dst__R13s__anonymous2_1, signed int __i__i_1){ … … 111 111 ((void)((*___dst__R13s__anonymous3_1).__i__i_1=___src__13s__anonymous3_1.__i__i_1)); 112 112 ((void)___constructor__F_R13s__anonymous313s__anonymous3_autogen___1((&___ret__13s__anonymous3_1), ___src__13s__anonymous3_1)); 113 return ((struct __anonymous3 )___ret__13s__anonymous3_1);113 return ___ret__13s__anonymous3_1; 114 114 } 115 115 static inline void ___constructor__F_R13s__anonymous3i_autogen___1(struct __anonymous3 *___dst__R13s__anonymous3_1, signed int __i__i_1){ … … 137 137 ((void)((*___dst__R13s__anonymous4_1).__i__i_1=___src__13s__anonymous4_1.__i__i_1)); 138 138 ((void)___constructor__F_R13s__anonymous413s__anonymous4_autogen___1((&___ret__13s__anonymous4_1), ___src__13s__anonymous4_1)); 139 return ((struct __anonymous4 )___ret__13s__anonymous4_1);139 return ___ret__13s__anonymous4_1; 140 140 } 141 141 static inline void ___constructor__F_R13s__anonymous4i_autogen___1(struct __anonymous4 *___dst__R13s__anonymous4_1, signed int __i__i_1){ … … 163 163 ((void)((*___dst__R13s__anonymous5_1).__i__i_1=___src__13s__anonymous5_1.__i__i_1)); 164 164 ((void)___constructor__F_R13s__anonymous513s__anonymous5_autogen___1((&___ret__13s__anonymous5_1), ___src__13s__anonymous5_1)); 165 return ((struct __anonymous5 )___ret__13s__anonymous5_1);165 return ___ret__13s__anonymous5_1; 166 166 } 167 167 static inline void ___constructor__F_R13s__anonymous5i_autogen___1(struct __anonymous5 *___dst__R13s__anonymous5_1, signed int __i__i_1){ … … 189 189 ((void)((*___dst__R13s__anonymous6_1).__i__i_1=___src__13s__anonymous6_1.__i__i_1)); 190 190 ((void)___constructor__F_R13s__anonymous613s__anonymous6_autogen___1((&___ret__13s__anonymous6_1), ___src__13s__anonymous6_1)); 191 return ((struct __anonymous6 )___ret__13s__anonymous6_1);191 return ___ret__13s__anonymous6_1; 192 192 } 193 193 static inline void ___constructor__F_R13s__anonymous6i_autogen___1(struct __anonymous6 *___dst__R13s__anonymous6_1, signed int __i__i_1){ … … 215 215 ((void)((*___dst__R13s__anonymous7_1).__i__i_1=___src__13s__anonymous7_1.__i__i_1)); 216 216 ((void)___constructor__F_R13s__anonymous713s__anonymous7_autogen___1((&___ret__13s__anonymous7_1), ___src__13s__anonymous7_1)); 217 return ((struct __anonymous7 )___ret__13s__anonymous7_1);217 return ___ret__13s__anonymous7_1; 218 218 } 219 219 static inline void ___constructor__F_R13s__anonymous7i_autogen___1(struct __anonymous7 *___dst__R13s__anonymous7_1, signed int __i__i_1){ … … 249 249 ((void)((*___dst__R13s__anonymous8_1).__i__s_1=___src__13s__anonymous8_1.__i__s_1)); 250 250 ((void)___constructor__F_R13s__anonymous813s__anonymous8_autogen___1((&___ret__13s__anonymous8_1), ___src__13s__anonymous8_1)); 251 return ((struct __anonymous8 )___ret__13s__anonymous8_1);251 return ___ret__13s__anonymous8_1; 252 252 } 253 253 static inline void ___constructor__F_R13s__anonymous8s_autogen___1(struct __anonymous8 *___dst__R13s__anonymous8_1, signed short int __i__s_1){ … … 275 275 ((void)((*___dst__R13s__anonymous9_1).__i__s_1=___src__13s__anonymous9_1.__i__s_1)); 276 276 ((void)___constructor__F_R13s__anonymous913s__anonymous9_autogen___1((&___ret__13s__anonymous9_1), ___src__13s__anonymous9_1)); 277 return ((struct __anonymous9 )___ret__13s__anonymous9_1);277 return ___ret__13s__anonymous9_1; 278 278 } 279 279 static inline void ___constructor__F_R13s__anonymous9s_autogen___1(struct __anonymous9 *___dst__R13s__anonymous9_1, signed short int __i__s_1){ … … 301 301 ((void)((*___dst__R14s__anonymous10_1).__i__s_1=___src__14s__anonymous10_1.__i__s_1)); 302 302 ((void)___constructor__F_R14s__anonymous1014s__anonymous10_autogen___1((&___ret__14s__anonymous10_1), ___src__14s__anonymous10_1)); 303 return ((struct __anonymous10 )___ret__14s__anonymous10_1);303 return ___ret__14s__anonymous10_1; 304 304 } 305 305 static inline void ___constructor__F_R14s__anonymous10s_autogen___1(struct __anonymous10 *___dst__R14s__anonymous10_1, signed short int __i__s_1){ … … 327 327 ((void)((*___dst__R14s__anonymous11_1).__i__s_1=___src__14s__anonymous11_1.__i__s_1)); 328 328 ((void)___constructor__F_R14s__anonymous1114s__anonymous11_autogen___1((&___ret__14s__anonymous11_1), ___src__14s__anonymous11_1)); 329 return ((struct __anonymous11 )___ret__14s__anonymous11_1);329 return ___ret__14s__anonymous11_1; 330 330 } 331 331 static inline void ___constructor__F_R14s__anonymous11s_autogen___1(struct __anonymous11 *___dst__R14s__anonymous11_1, signed short int __i__s_1){ … … 353 353 ((void)((*___dst__R14s__anonymous12_1).__i__s_1=___src__14s__anonymous12_1.__i__s_1)); 354 354 ((void)___constructor__F_R14s__anonymous1214s__anonymous12_autogen___1((&___ret__14s__anonymous12_1), ___src__14s__anonymous12_1)); 355 return ((struct __anonymous12 )___ret__14s__anonymous12_1);355 return ___ret__14s__anonymous12_1; 356 356 } 357 357 static inline void ___constructor__F_R14s__anonymous12s_autogen___1(struct __anonymous12 *___dst__R14s__anonymous12_1, signed short int __i__s_1){ … … 379 379 ((void)((*___dst__R14s__anonymous13_1).__i__s_1=___src__14s__anonymous13_1.__i__s_1)); 380 380 ((void)___constructor__F_R14s__anonymous1314s__anonymous13_autogen___1((&___ret__14s__anonymous13_1), ___src__14s__anonymous13_1)); 381 return ((struct __anonymous13 )___ret__14s__anonymous13_1);381 return ___ret__14s__anonymous13_1; 382 382 } 383 383 static inline void ___constructor__F_R14s__anonymous13s_autogen___1(struct __anonymous13 *___dst__R14s__anonymous13_1, signed short int __i__s_1){ … … 405 405 ((void)((*___dst__R14s__anonymous14_1).__i__s_1=___src__14s__anonymous14_1.__i__s_1)); 406 406 ((void)___constructor__F_R14s__anonymous1414s__anonymous14_autogen___1((&___ret__14s__anonymous14_1), ___src__14s__anonymous14_1)); 407 return ((struct __anonymous14 )___ret__14s__anonymous14_1);407 return ___ret__14s__anonymous14_1; 408 408 } 409 409 static inline void ___constructor__F_R14s__anonymous14s_autogen___1(struct __anonymous14 *___dst__R14s__anonymous14_1, signed short int __i__s_1){ … … 431 431 ((void)((*___dst__R14s__anonymous15_1).__i__s_1=___src__14s__anonymous15_1.__i__s_1)); 432 432 ((void)___constructor__F_R14s__anonymous1514s__anonymous15_autogen___1((&___ret__14s__anonymous15_1), ___src__14s__anonymous15_1)); 433 return ((struct __anonymous15 )___ret__14s__anonymous15_1);433 return ___ret__14s__anonymous15_1; 434 434 } 435 435 static inline void ___constructor__F_R14s__anonymous15s_autogen___1(struct __anonymous15 *___dst__R14s__anonymous15_1, signed short int __i__s_1){ … … 473 473 ((void)((*___dst__R14s__anonymous16_1).__i__i_1=___src__14s__anonymous16_1.__i__i_1)); 474 474 ((void)___constructor__F_R14s__anonymous1614s__anonymous16_autogen___1((&___ret__14s__anonymous16_1), ___src__14s__anonymous16_1)); 475 return ((struct __anonymous16 )___ret__14s__anonymous16_1);475 return ___ret__14s__anonymous16_1; 476 476 } 477 477 static inline void ___constructor__F_R14s__anonymous16i_autogen___1(struct __anonymous16 *___dst__R14s__anonymous16_1, signed int __i__i_1){ … … 499 499 ((void)((*___dst__R14s__anonymous17_1).__i__i_1=___src__14s__anonymous17_1.__i__i_1)); 500 500 ((void)___constructor__F_R14s__anonymous1714s__anonymous17_autogen___1((&___ret__14s__anonymous17_1), ___src__14s__anonymous17_1)); 501 return ((struct __anonymous17 )___ret__14s__anonymous17_1);501 return ___ret__14s__anonymous17_1; 502 502 } 503 503 static inline void ___constructor__F_R14s__anonymous17i_autogen___1(struct __anonymous17 *___dst__R14s__anonymous17_1, signed int __i__i_1){ … … 525 525 ((void)((*___dst__R14s__anonymous18_1).__i__i_1=___src__14s__anonymous18_1.__i__i_1)); 526 526 ((void)___constructor__F_R14s__anonymous1814s__anonymous18_autogen___1((&___ret__14s__anonymous18_1), ___src__14s__anonymous18_1)); 527 return ((struct __anonymous18 )___ret__14s__anonymous18_1);527 return ___ret__14s__anonymous18_1; 528 528 } 529 529 static inline void ___constructor__F_R14s__anonymous18i_autogen___1(struct __anonymous18 *___dst__R14s__anonymous18_1, signed int __i__i_1){ … … 551 551 ((void)((*___dst__R14s__anonymous19_1).__i__i_1=___src__14s__anonymous19_1.__i__i_1)); 552 552 ((void)___constructor__F_R14s__anonymous1914s__anonymous19_autogen___1((&___ret__14s__anonymous19_1), ___src__14s__anonymous19_1)); 553 return ((struct __anonymous19 )___ret__14s__anonymous19_1);553 return ___ret__14s__anonymous19_1; 554 554 } 555 555 static inline void ___constructor__F_R14s__anonymous19i_autogen___1(struct __anonymous19 *___dst__R14s__anonymous19_1, signed int __i__i_1){ … … 577 577 ((void)((*___dst__R14s__anonymous20_1).__i__i_1=___src__14s__anonymous20_1.__i__i_1)); 578 578 ((void)___constructor__F_R14s__anonymous2014s__anonymous20_autogen___1((&___ret__14s__anonymous20_1), ___src__14s__anonymous20_1)); 579 return ((struct __anonymous20 )___ret__14s__anonymous20_1);579 return ___ret__14s__anonymous20_1; 580 580 } 581 581 static inline void ___constructor__F_R14s__anonymous20i_autogen___1(struct __anonymous20 *___dst__R14s__anonymous20_1, signed int __i__i_1){ … … 603 603 ((void)((*___dst__R14s__anonymous21_1).__i__i_1=___src__14s__anonymous21_1.__i__i_1)); 604 604 ((void)___constructor__F_R14s__anonymous2114s__anonymous21_autogen___1((&___ret__14s__anonymous21_1), ___src__14s__anonymous21_1)); 605 return ((struct __anonymous21 )___ret__14s__anonymous21_1);605 return ___ret__14s__anonymous21_1; 606 606 } 607 607 static inline void ___constructor__F_R14s__anonymous21i_autogen___1(struct __anonymous21 *___dst__R14s__anonymous21_1, signed int __i__i_1){ … … 629 629 ((void)((*___dst__R14s__anonymous22_1).__i__i_1=___src__14s__anonymous22_1.__i__i_1)); 630 630 ((void)___constructor__F_R14s__anonymous2214s__anonymous22_autogen___1((&___ret__14s__anonymous22_1), ___src__14s__anonymous22_1)); 631 return ((struct __anonymous22 )___ret__14s__anonymous22_1);631 return ___ret__14s__anonymous22_1; 632 632 } 633 633 static inline void ___constructor__F_R14s__anonymous22i_autogen___1(struct __anonymous22 *___dst__R14s__anonymous22_1, signed int __i__i_1){ … … 655 655 ((void)((*___dst__R14s__anonymous23_1).__i__i_1=___src__14s__anonymous23_1.__i__i_1)); 656 656 ((void)___constructor__F_R14s__anonymous2314s__anonymous23_autogen___1((&___ret__14s__anonymous23_1), ___src__14s__anonymous23_1)); 657 return ((struct __anonymous23 )___ret__14s__anonymous23_1);657 return ___ret__14s__anonymous23_1; 658 658 } 659 659 static inline void ___constructor__F_R14s__anonymous23i_autogen___1(struct __anonymous23 *___dst__R14s__anonymous23_1, signed int __i__i_1){ … … 672 672 __attribute__ ((unused)) signed int ___retval_main__i_1; 673 673 ((void)(___retval_main__i_1=((signed int )0)) /* ?{} */); 674 return ((signed int )___retval_main__i_1);674 return ___retval_main__i_1; 675 675 ((void)(___retval_main__i_1=0) /* ?{} */); 676 return ((signed int )___retval_main__i_1);676 return ___retval_main__i_1; 677 677 } 678 678 static inline int invoke_main(int argc, char* argv[], char* envp[]) { (void)argc; (void)argv; (void)envp; return __main__Fi_iPPCc__1(argc, argv); } … … 689 689 ((void)(___retval_main__i_1=(((void)(_tmp_cp_ret0=invoke_main(__argc__i_1, __argv__PPc_1, __envp__PPc_1))) , _tmp_cp_ret0)) /* ?{} */); 690 690 ((void)(_tmp_cp_ret0) /* ^?{} */); 691 return ((signed int )___retval_main__i_1);692 } 691 return ___retval_main__i_1; 692 } -
src/tests/.expect/64/extension.txt
r0db817e rd2e2865 38 38 ((void)((*___dst__R2sS_1).__c__i_1=___src__2sS_1.__c__i_1)); 39 39 ((void)___constructor__F_R2sS2sS_autogen___1((&___ret__2sS_1), ___src__2sS_1)); 40 return ((struct S )___ret__2sS_1);40 return ___ret__2sS_1; 41 41 } 42 42 static inline void ___constructor__F_R2sSi_autogen___1(struct S *___dst__R2sS_1, signed int __a__i_1){ … … 71 71 ((void)__builtin_memcpy(((void *)___dst__R2uU_1), ((const void *)(&___src__2uU_1)), sizeof(union U ))); 72 72 ((void)___constructor__F_R2uU2uU_autogen___1((&___ret__2uU_1), ___src__2uU_1)); 73 return ((union U )___ret__2uU_1);73 return ___ret__2uU_1; 74 74 } 75 75 static inline void ___constructor__F_R2uUi_autogen___1(__attribute__ ((unused)) union U *___dst__R2uU_1, signed int __src__i_1){ -
src/tests/.expect/64/gccExtensions.txt
r0db817e rd2e2865 64 64 ((void)((*___dst__R2sS_2).__c__i_2=___src__2sS_2.__c__i_2)); 65 65 ((void)___constructor__F_R2sS2sS_autogen___2((&___ret__2sS_2), ___src__2sS_2)); 66 return ((struct S )___ret__2sS_2);66 return ___ret__2sS_2; 67 67 } 68 68 inline void ___constructor__F_R2sSi_autogen___2(struct S *___dst__R2sS_2, signed int __a__i_2){ … … 114 114 ((void)((*___dst__R3ss2_2).__i__i_2=___src__3ss2_2.__i__i_2)); 115 115 ((void)___constructor__F_R3ss23ss2_autogen___2((&___ret__3ss2_2), ___src__3ss2_2)); 116 return ((struct s2 )___ret__3ss2_2);116 return ___ret__3ss2_2; 117 117 } 118 118 inline void ___constructor__F_R3ss2i_autogen___2(struct s2 *___dst__R3ss2_2, signed int __i__i_2){ … … 135 135 ((void)((*___dst__R3ss3_2).__i__i_2=___src__3ss3_2.__i__i_2)); 136 136 ((void)___constructor__F_R3ss33ss3_autogen___2((&___ret__3ss3_2), ___src__3ss3_2)); 137 return ((struct s3 )___ret__3ss3_2);137 return ___ret__3ss3_2; 138 138 } 139 139 inline void ___constructor__F_R3ss3i_autogen___2(struct s3 *___dst__R3ss3_2, signed int __i__i_2){ … … 158 158 ((void)((*___dst__R3ss4_2).__i__i_2=___src__3ss4_2.__i__i_2)); 159 159 ((void)___constructor__F_R3ss43ss4_autogen___2((&___ret__3ss4_2), ___src__3ss4_2)); 160 return ((struct s4 )___ret__3ss4_2);160 return ___ret__3ss4_2; 161 161 } 162 162 inline void ___constructor__F_R3ss4i_autogen___2(struct s4 *___dst__R3ss4_2, signed int __i__i_2){ … … 169 169 signed int __m3__A0A0i_2[((unsigned long int )10)][((unsigned long int )10)]; 170 170 ((void)(___retval_main__i_1=((signed int )0)) /* ?{} */); 171 return ((signed int )___retval_main__i_1);171 return ___retval_main__i_1; 172 172 ((void)(___retval_main__i_1=0) /* ?{} */); 173 return ((signed int )___retval_main__i_1);173 return ___retval_main__i_1; 174 174 } 175 175 static inline int invoke_main(int argc, char* argv[], char* envp[]) { (void)argc; (void)argv; (void)envp; return __main__Fi_iPPCc__1(argc, argv); } … … 186 186 ((void)(___retval_main__i_1=(((void)(_tmp_cp_ret0=invoke_main(__argc__i_1, __argv__PPc_1, __envp__PPc_1))) , _tmp_cp_ret0)) /* ?{} */); 187 187 ((void)(_tmp_cp_ret0) /* ^?{} */); 188 return ((signed int )___retval_main__i_1);188 return ___retval_main__i_1; 189 189 } -
src/tests/.expect/64/literals.txt
r0db817e rd2e2865 77 77 ((void)((*___dst__R16s_Istream_cstrUC_1).__s__Pc_1=___src__16s_Istream_cstrUC_1.__s__Pc_1)); 78 78 ((void)___constructor__F_R16s_Istream_cstrUC16s_Istream_cstrUC_autogen___1((&___ret__16s_Istream_cstrUC_1), ___src__16s_Istream_cstrUC_1)); 79 return ((struct _Istream_cstrUC )___ret__16s_Istream_cstrUC_1);79 return ___ret__16s_Istream_cstrUC_1; 80 80 } 81 81 static inline void ___constructor__F_R16s_Istream_cstrUCPc_autogen___1(struct _Istream_cstrUC *___dst__R16s_Istream_cstrUC_1, char *__s__Pc_1){ … … 109 109 ((void)((*___dst__R15s_Istream_cstrC_1).__size__i_1=___src__15s_Istream_cstrC_1.__size__i_1)); 110 110 ((void)___constructor__F_R15s_Istream_cstrC15s_Istream_cstrC_autogen___1((&___ret__15s_Istream_cstrC_1), ___src__15s_Istream_cstrC_1)); 111 return ((struct _Istream_cstrC )___ret__15s_Istream_cstrC_1);111 return ___ret__15s_Istream_cstrC_1; 112 112 } 113 113 static inline void ___constructor__F_R15s_Istream_cstrCPc_autogen___1(struct _Istream_cstrC *___dst__R15s_Istream_cstrC_1, char *__s__Pc_1){ … … 230 230 231 231 ((void)___constructor__F_R9sofstream9sofstream_autogen___1((&___ret__9sofstream_1), ___src__9sofstream_1)); 232 return ((struct ofstream )___ret__9sofstream_1);232 return ___ret__9sofstream_1; 233 233 } 234 234 static inline void ___constructor__F_R9sofstreamPv_autogen___1(struct ofstream *___dst__R9sofstream_1, void *__file__Pv_1){ … … 437 437 ((void)((*___dst__R9sifstream_1).__file__Pv_1=___src__9sifstream_1.__file__Pv_1)); 438 438 ((void)___constructor__F_R9sifstream9sifstream_autogen___1((&___ret__9sifstream_1), ___src__9sifstream_1)); 439 return ((struct ifstream )___ret__9sifstream_1);439 return ___ret__9sifstream_1; 440 440 } 441 441 static inline void ___constructor__F_R9sifstreamPv_autogen___1(struct ifstream *___dst__R9sifstream_1, void *__file__Pv_1){ … … 1363 1363 ((void)L"a" "b" "c"); 1364 1364 ((void)(___retval_main__i_1=0) /* ?{} */); 1365 return ((signed int )___retval_main__i_1);1365 return ___retval_main__i_1; 1366 1366 } 1367 1367 static inline int invoke_main(int argc, char* argv[], char* envp[]) { (void)argc; (void)argv; (void)envp; return __main__Fi___1(); } … … 1378 1378 ((void)(___retval_main__i_1=(((void)(_tmp_cp_ret0=invoke_main(__argc__i_1, __argv__PPc_1, __envp__PPc_1))) , _tmp_cp_ret0)) /* ?{} */); 1379 1379 ((void)(_tmp_cp_ret0) /* ^?{} */); 1380 return ((signed int )___retval_main__i_1);1381 } 1380 return ___retval_main__i_1; 1381 } -
src/tests/.expect/references.txt
r0db817e rd2e2865 2 2 12 12 1 3 3 12 12 1 1 4 13 1 12 5 14 14 4 6 Default constructing a Y 5 7 Copy constructing a Y -
src/tests/references.c
r0db817e rd2e2865 37 37 int * toptr( int & r ) { return &r; } 38 38 39 void changeRef( int & r ) { 40 r++; 41 } 42 39 43 int main() { 40 44 int x = 123456, *p1 = &x, **p2 = &p1, ***p3 = &p2, … … 43 47 **p3 = &x; // change p1 44 48 *p3 = &p1; // change p2 45 int y , z, & ar[3] = { x, y, z }; // initialize array of references49 int y = 0, z = 11, & ar[3] = { x, y, z }; // initialize array of references 46 50 47 51 // test that basic reference properties are true - r1 should be an alias for x … … 52 56 // test that functions using basic references work 53 57 printf("%d %d %d %d\n", toref(&x), toref(p1), toptr(r1) == toptr(x), toptr(r1) == &x); 58 59 changeRef( x ); 60 changeRef( y ); 61 changeRef( z ); 62 printf("%d %d %d\n", x, y, z); 63 changeRef( r1 ); 64 printf("%d %d\n", r1, x); 54 65 55 66 // test that reference members are not implicitly constructed/destructed/assigned
Note: See TracChangeset
for help on using the changeset viewer.