Changeset 8dbedfc for src


Ignore:
Timestamp:
May 25, 2018, 1:37:38 PM (7 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, with_gc
Children:
58e822a
Parents:
13073be (diff), 34ca532 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

Location:
src
Files:
4 added
27 edited
2 moved

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    r13073be r8dbedfc  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue May 22 08:41:57 2018
    13 // Update Count     : 3353
     12// Last Modified On : Thu May 24 18:11:59 2018
     13// Update Count     : 3369
    1414//
    1515
     
    837837//      '[' push assignment_expression pop ']'
    838838//              { $$ = new ExpressionNode( build_tuple( $3 ) ); }
    839         '[' ',' tuple_expression_list ']'
    840                 { $$ = new ExpressionNode( build_tuple( (ExpressionNode *)(new ExpressionNode( nullptr ) )->set_last( $3 ) ) ); }
    841         | '[' assignment_expression ',' tuple_expression_list ']'
    842                 { $$ = new ExpressionNode( build_tuple( (ExpressionNode *)$2->set_last( $4 ) ) ); }
     839        '[' push ',' tuple_expression_list pop ']'
     840                { $$ = new ExpressionNode( build_tuple( (ExpressionNode *)(new ExpressionNode( nullptr ) )->set_last( $4 ) ) ); }
     841        | '[' push assignment_expression ',' tuple_expression_list pop ']'
     842                { $$ = new ExpressionNode( build_tuple( (ExpressionNode *)$3->set_last( $5 ) ) ); }
    843843        ;
    844844
     
    866866        labeled_statement
    867867        | compound_statement
    868         | expression_statement                                          { $$ = $1; }
     868        | expression_statement
    869869        | selection_statement
    870870        | iteration_statement
     
    11831183        type_specifier_nobody
    11841184        | type_specifier_nobody declarator
    1185                 {
    1186                         $$ = $2->addType( $1 );
    1187                 }
     1185                { $$ = $2->addType( $1 ); }
    11881186        | type_specifier_nobody variable_abstract_declarator
    11891187                { $$ = $2->addType( $1 ); }
    11901188        | cfa_abstract_declarator_tuple no_attr_identifier      // CFA
    1191                 {
    1192                         $$ = $1->addName( $2 );
    1193                 }
     1189                { $$ = $1->addName( $2 ); }
    11941190        | cfa_abstract_declarator_tuple                                         // CFA
    11951191        ;
     
    12691265
    12701266declaration_list_opt:                                                                   // used at beginning of switch statement
    1271         pop
     1267        pop     // empty
    12721268                { $$ = nullptr; }
    12731269        | declaration_list
     
    13041300
    13051301local_label_list:                                                                               // GCC, local label
    1306         no_attr_identifier_or_type_name                         {}
    1307         | local_label_list ',' no_attr_identifier_or_type_name {}
     1302        no_attr_identifier_or_type_name
     1303        | local_label_list ',' no_attr_identifier_or_type_name
    13081304        ;
    13091305
     
    14001396                // type_specifier can resolve to just TYPEDEFname (e.g., typedef int T; int f( T );). Therefore this must be
    14011397                // flattened to allow lookahead to the '(' without having to reduce identifier_or_type_name.
    1402         cfa_abstract_tuple identifier_or_type_name '(' cfa_parameter_type_list_opt ')'
     1398        cfa_abstract_tuple identifier_or_type_name '(' push cfa_parameter_type_list_opt pop ')'
    14031399                // To obtain LR(1 ), this rule must be factored out from function return type (see cfa_abstract_declarator).
    1404                 { $$ = DeclarationNode::newFunction( $2, $1, $4, 0 ); }
    1405         | cfa_function_return identifier_or_type_name '(' cfa_parameter_type_list_opt ')'
    1406                 { $$ = DeclarationNode::newFunction( $2, $1, $4, 0 ); }
     1400                { $$ = DeclarationNode::newFunction( $2, $1, $5, 0 ); }
     1401        | cfa_function_return identifier_or_type_name '(' push cfa_parameter_type_list_opt pop ')'
     1402                { $$ = DeclarationNode::newFunction( $2, $1, $5, 0 ); }
    14071403        ;
    14081404
    14091405cfa_function_return:                                                                    // CFA
    1410         '[' cfa_parameter_list ']'
    1411                 { $$ = DeclarationNode::newTuple( $2 ); }
    1412         | '[' cfa_parameter_list ',' cfa_abstract_parameter_list ']'
    1413                 // To obtain LR(1 ), the last cfa_abstract_parameter_list is added into this flattened rule to lookahead to the
    1414                 // ']'.
    1415                 { $$ = DeclarationNode::newTuple( $2->appendList( $4 ) ); }
     1406        '[' push cfa_parameter_list pop ']'
     1407                { $$ = DeclarationNode::newTuple( $3 ); }
     1408        | '[' push cfa_parameter_list pop ',' push cfa_abstract_parameter_list pop ']'
     1409                // To obtain LR(1 ), the last cfa_abstract_parameter_list is added into this flattened rule to lookahead to the ']'.
     1410                { $$ = DeclarationNode::newTuple( $3->appendList( $7 ) ); }
    14161411        ;
    14171412
     
    15871582
    15881583forall:
    1589         FORALL '('
    1590                 {
    1591                         typedefTable.enterScope();
    1592                 }
    1593           type_parameter_list ')'                                                       // CFA
    1594                 {
    1595                         typedefTable.leaveScope();
    1596                         $$ = DeclarationNode::newForall( $4 );
    1597                 }
     1584        FORALL '(' push type_parameter_list pop ')'                                     // CFA
     1585                { $$ = DeclarationNode::newForall( $4 ); }
    15981586        ;
    15991587
     
    19701958        | cfa_abstract_parameter_list
    19711959        | cfa_parameter_list
    1972         | cfa_parameter_list ',' cfa_abstract_parameter_list
    1973                 { $$ = $1->appendList( $3 ); }
    1974         | cfa_abstract_parameter_list ',' ELLIPSIS
     1960        | cfa_parameter_list pop ',' push cfa_abstract_parameter_list
     1961                { $$ = $1->appendList( $5 ); }
     1962        | cfa_abstract_parameter_list pop ',' push ELLIPSIS
    19751963                { $$ = $1->addVarArgs(); }
    1976         | cfa_parameter_list ',' ELLIPSIS
     1964        | cfa_parameter_list pop ',' push ELLIPSIS
    19771965                { $$ = $1->addVarArgs(); }
    19781966        ;
     
    19821970                // factored out from cfa_parameter_list, flattening the rules to get lookahead to the ']'.
    19831971        cfa_parameter_declaration
    1984         | cfa_abstract_parameter_list ',' cfa_parameter_declaration
    1985                 { $$ = $1->appendList( $3 ); }
    1986         | cfa_parameter_list ',' cfa_parameter_declaration
    1987                 { $$ = $1->appendList( $3 ); }
    1988         | cfa_parameter_list ',' cfa_abstract_parameter_list ',' cfa_parameter_declaration
    1989                 { $$ = $1->appendList( $3 )->appendList( $5 ); }
     1972        | cfa_abstract_parameter_list pop ',' push cfa_parameter_declaration
     1973                { $$ = $1->appendList( $5 ); }
     1974        | cfa_parameter_list pop ',' push cfa_parameter_declaration
     1975                { $$ = $1->appendList( $5 ); }
     1976        | cfa_parameter_list pop ',' push cfa_abstract_parameter_list pop ',' push cfa_parameter_declaration
     1977                { $$ = $1->appendList( $5 )->appendList( $9 ); }
    19901978        ;
    19911979
    19921980cfa_abstract_parameter_list:                                                    // CFA, new & old style abstract
    19931981        cfa_abstract_parameter_declaration
    1994         | cfa_abstract_parameter_list ',' cfa_abstract_parameter_declaration
    1995                 { $$ = $1->appendList( $3 ); }
     1982        | cfa_abstract_parameter_list pop ',' push cfa_abstract_parameter_declaration
     1983                { $$ = $1->appendList( $5 ); }
    19961984        ;
    19971985
     
    21422130        '.' no_attr_identifier                                                          // C99, field name
    21432131                { $$ = new ExpressionNode( build_varref( $2 ) ); }
    2144         | '[' assignment_expression ']'                                         // C99, single array element
     2132        | '[' push assignment_expression pop ']'                        // C99, single array element
    21452133                // assignment_expression used instead of constant_expression because of shift/reduce conflicts with tuple.
    2146                 { $$ = $2; }
    2147         | '[' subrange ']'                                                                      // CFA, multiple array elements
    2148                 { $$ = $2; }
    2149         | '[' constant_expression ELLIPSIS constant_expression ']' // GCC, multiple array elements
    2150                 { $$ = new ExpressionNode( new RangeExpr( maybeMoveBuild< Expression >( $2 ), maybeMoveBuild< Expression >( $4 ) ) ); }
    2151         | '.' '[' field_list ']'                                                        // CFA, tuple field selector
    21522134                { $$ = $3; }
     2135        | '[' push subrange pop ']'                                                     // CFA, multiple array elements
     2136                { $$ = $3; }
     2137        | '[' push constant_expression ELLIPSIS constant_expression pop ']' // GCC, multiple array elements
     2138                { $$ = new ExpressionNode( new RangeExpr( maybeMoveBuild< Expression >( $3 ), maybeMoveBuild< Expression >( $5 ) ) ); }
     2139        | '.' '[' push field_list pop ']'                                       // CFA, tuple field selector
     2140                { $$ = $4; }
    21532141        ;
    21542142
     
    22692257        TRAIT no_attr_identifier_or_type_name '(' push type_parameter_list pop ')' '{' '}'
    22702258                { $$ = DeclarationNode::newTrait( $2, $5, 0 ); }
    2271         | TRAIT no_attr_identifier_or_type_name '(' push type_parameter_list pop ')' '{'
    2272                 { typedefTable.enterScope(); }
    2273           trait_declaration_list '}'
     2259        | TRAIT no_attr_identifier_or_type_name '(' push type_parameter_list pop ')' '{' push trait_declaration_list '}'
    22742260                { $$ = DeclarationNode::newTrait( $2, $5, $10 ); }
    22752261        ;
     
    22882274cfa_trait_declaring_list:                                                               // CFA
    22892275        cfa_variable_specifier
    2290                 { $$ = $1; }
    22912276        | cfa_function_specifier
    2292                 { $$ = $1; }
    22932277        | cfa_trait_declaring_list pop ',' push identifier_or_type_name
    22942278                { $$ = $1->appendList( $1->cloneType( $5 ) ); }
     
    23492333                }
    23502334        | type_qualifier_list
    2351                 {
    2352                         if ( $1->type->forall ) xxx = forall = true; // remember generic type
    2353                 }
     2335                { if ( $1->type->forall ) xxx = forall = true; } // remember generic type
    23542336          push '{' external_definition_list '}'                         // CFA, namespace
    23552337                {
     
    23642346                }
    23652347        | declaration_qualifier_list
    2366                 {
    2367                         if ( $1->type->forall ) xxx = forall = true; // remember generic type
    2368                 }
     2348                { if ( $1->type->forall ) xxx = forall = true; } // remember generic type
    23692349          push '{' external_definition_list '}'                         // CFA, namespace
    23702350                {
     
    24062386                // declaration must still have a type_specifier.  OBSOLESCENT (see 1)
    24072387        | function_declarator compound_statement
    2408                 {
    2409                         typedefTable.leaveScope();
    2410                         $$ = $1->addFunctionBody( $2 );
    2411                 }
     2388                { $$ = $1->addFunctionBody( $2 ); }
    24122389        | KR_function_declarator KR_declaration_list_opt compound_statement
    2413                 {
    2414                         typedefTable.leaveScope();
    2415                         $$ = $1->addOldDeclList( $2 )->addFunctionBody( $3 );
    2416                 }
     2390                { $$ = $1->addOldDeclList( $2 )->addFunctionBody( $3 ); }
    24172391        ;
    24182392
     
    24272401        cfa_function_declaration with_clause_opt compound_statement     // CFA
    24282402                {
    2429                         typedefTable.leaveScope();
    24302403                        // Add the function body to the last identifier in the function definition list, i.e., foo3:
    24312404                        //   [const double] foo1(), foo2( int ), foo3( double ) { return 3.0; }
     
    24362409                {
    24372410                        rebindForall( $1, $2 );
    2438                         typedefTable.leaveScope();
    24392411                        $$ = $2->addFunctionBody( $4, $3 )->addType( $1 );
    24402412                }
     
    24422414                {
    24432415                        rebindForall( $1, $2 );
    2444                         typedefTable.leaveScope();
    24452416                        $$ = $2->addFunctionBody( $4, $3 )->addType( $1 );
    24462417                }
    24472418                // handles default int return type, OBSOLESCENT (see 1)
    24482419        | type_qualifier_list function_declarator with_clause_opt compound_statement
    2449                 {
    2450                         typedefTable.leaveScope();
    2451                         $$ = $2->addFunctionBody( $4, $3 )->addQualifiers( $1 );
    2452                 }
     2420                { $$ = $2->addFunctionBody( $4, $3 )->addQualifiers( $1 ); }
    24532421                // handles default int return type, OBSOLESCENT (see 1)
    24542422        | declaration_qualifier_list function_declarator with_clause_opt compound_statement
    2455                 {
    2456                         typedefTable.leaveScope();
    2457                         $$ = $2->addFunctionBody( $4, $3 )->addQualifiers( $1 );
    2458                 }
     2423                { $$ = $2->addFunctionBody( $4, $3 )->addQualifiers( $1 ); }
    24592424                // handles default int return type, OBSOLESCENT (see 1)
    24602425        | declaration_qualifier_list type_qualifier_list function_declarator with_clause_opt compound_statement
    2461                 {
    2462                         typedefTable.leaveScope();
    2463                         $$ = $3->addFunctionBody( $5, $4 )->addQualifiers( $2 )->addQualifiers( $1 );
    2464                 }
     2426                { $$ = $3->addFunctionBody( $5, $4 )->addQualifiers( $2 )->addQualifiers( $1 ); }
    24652427
    24662428                // Old-style K&R function definition, OBSOLESCENT (see 4)
     
    24682430                {
    24692431                        rebindForall( $1, $2 );
    2470                         typedefTable.leaveScope();
    24712432                        $$ = $2->addOldDeclList( $3 )->addFunctionBody( $5, $4 )->addType( $1 );
    24722433                }
    24732434                // handles default int return type, OBSOLESCENT (see 1)
    24742435        | type_qualifier_list KR_function_declarator KR_declaration_list_opt with_clause_opt compound_statement
    2475                 {
    2476                         typedefTable.leaveScope();
    2477                         $$ = $2->addOldDeclList( $3 )->addFunctionBody( $5, $4 )->addQualifiers( $1 );
    2478                 }
     2436                { $$ = $2->addOldDeclList( $3 )->addFunctionBody( $5, $4 )->addQualifiers( $1 ); }
    24792437                // handles default int return type, OBSOLESCENT (see 1)
    24802438        | declaration_qualifier_list KR_function_declarator KR_declaration_list_opt with_clause_opt compound_statement
    2481                 {
    2482                         typedefTable.leaveScope();
    2483                         $$ = $2->addOldDeclList( $3 )->addFunctionBody( $5, $4 )->addQualifiers( $1 );
    2484                 }
     2439                { $$ = $2->addOldDeclList( $3 )->addFunctionBody( $5, $4 )->addQualifiers( $1 ); }
    24852440                // handles default int return type, OBSOLESCENT (see 1)
    24862441        | declaration_qualifier_list type_qualifier_list KR_function_declarator KR_declaration_list_opt with_clause_opt compound_statement
    2487                 {
    2488                         typedefTable.leaveScope();
    2489                         $$ = $3->addOldDeclList( $4 )->addFunctionBody( $6, $5 )->addQualifiers( $2 )->addQualifiers( $1 );
    2490                 }
     2442                { $$ = $3->addOldDeclList( $4 )->addFunctionBody( $6, $5 )->addQualifiers( $2 )->addQualifiers( $1 ); }
    24912443        ;
    24922444
     
    26852637        paren_identifier '(' identifier_list ')'                        // function_declarator handles empty parameter
    26862638                { $$ = $1->addIdList( $3 ); }
    2687         | '(' KR_function_ptr ')' '(' parameter_type_list_opt ')'
    2688                 { $$ = $2->addParamList( $5 ); }
     2639        | '(' KR_function_ptr ')' '(' push parameter_type_list_opt pop ')'
     2640                { $$ = $2->addParamList( $6 ); }
    26892641        | '(' KR_function_no_ptr ')'                                            // redundant parenthesis
    26902642                { $$ = $2; }
     
    28042756
    28052757identifier_parameter_function:
    2806         paren_identifier '(' parameter_type_list_opt ')'        // empty parameter list OBSOLESCENT (see 3)
    2807                 { $$ = $1->addParamList( $3 ); }
    2808         | '(' identifier_parameter_ptr ')' '(' parameter_type_list_opt ')' // empty parameter list OBSOLESCENT (see 3)
    2809                 { $$ = $2->addParamList( $5 ); }
     2758        paren_identifier '(' push parameter_type_list_opt pop ')' // empty parameter list OBSOLESCENT (see 3)
     2759                { $$ = $1->addParamList( $4 ); }
     2760        | '(' identifier_parameter_ptr ')' '(' push parameter_type_list_opt pop ')' // empty parameter list OBSOLESCENT (see 3)
     2761                { $$ = $2->addParamList( $6 ); }
    28102762        | '(' identifier_parameter_function ')'                         // redundant parenthesis
    28112763                { $$ = $2; }
     
    28572809
    28582810type_parameter_function:
    2859         typedef '(' parameter_type_list_opt ')'                         // empty parameter list OBSOLESCENT (see 3)
    2860                 { $$ = $1->addParamList( $3 ); }
    2861         | '(' type_parameter_ptr ')' '(' parameter_type_list_opt ')' // empty parameter list OBSOLESCENT (see 3)
    2862                 { $$ = $2->addParamList( $5 ); }
     2811        typedef '(' push parameter_type_list_opt pop ')'        // empty parameter list OBSOLESCENT (see 3)
     2812                { $$ = $1->addParamList( $4 ); }
     2813        | '(' type_parameter_ptr ')' '(' push parameter_type_list_opt pop ')' // empty parameter list OBSOLESCENT (see 3)
     2814                { $$ = $2->addParamList( $6 ); }
    28632815        ;
    28642816
     
    29072859
    29082860abstract_function:
    2909         '(' parameter_type_list_opt ')'                                         // empty parameter list OBSOLESCENT (see 3)
    2910                 { $$ = DeclarationNode::newFunction( nullptr, nullptr, $2, nullptr ); }
    2911         | '(' abstract_ptr ')' '(' parameter_type_list_opt ')' // empty parameter list OBSOLESCENT (see 3)
    2912                 { $$ = $2->addParamList( $5 ); }
     2861        '(' push parameter_type_list_opt pop ')'                        // empty parameter list OBSOLESCENT (see 3)
     2862                { $$ = DeclarationNode::newFunction( nullptr, nullptr, $3, nullptr ); }
     2863        | '(' abstract_ptr ')' '(' push parameter_type_list_opt pop ')' // empty parameter list OBSOLESCENT (see 3)
     2864                { $$ = $2->addParamList( $6 ); }
    29132865        | '(' abstract_function ')'                                                     // redundant parenthesis
    29142866                { $$ = $2; }
     
    29252877
    29262878multi_array_dimension:
    2927         '[' assignment_expression ']'
    2928                 { $$ = DeclarationNode::newArray( $2, 0, false ); }
    2929         | '[' '*' ']'                                                                           // C99
     2879        '[' push assignment_expression pop ']'
     2880                { $$ = DeclarationNode::newArray( $3, 0, false ); }
     2881        | '[' push '*' pop ']'                                                          // C99
    29302882                { $$ = DeclarationNode::newVarArray( 0 ); }
    2931         | multi_array_dimension '[' assignment_expression ']'
    2932                 { $$ = $1->addArray( DeclarationNode::newArray( $3, 0, false ) ); }
    2933         | multi_array_dimension '[' '*' ']'                                     // C99
     2883        | multi_array_dimension '[' push assignment_expression pop ']'
     2884                { $$ = $1->addArray( DeclarationNode::newArray( $4, 0, false ) ); }
     2885        | multi_array_dimension '[' push '*' pop ']'            // C99
    29342886                { $$ = $1->addArray( DeclarationNode::newVarArray( 0 ) ); }
    29352887        ;
     
    29982950
    29992951abstract_parameter_function:
    3000         '(' parameter_type_list_opt ')'                                         // empty parameter list OBSOLESCENT (see 3)
    3001                 { $$ = DeclarationNode::newFunction( nullptr, nullptr, $2, nullptr ); }
    3002         | '(' abstract_parameter_ptr ')' '(' parameter_type_list_opt ')' // empty parameter list OBSOLESCENT (see 3)
    3003                 { $$ = $2->addParamList( $5 ); }
     2952        '(' push parameter_type_list_opt pop ')'                        // empty parameter list OBSOLESCENT (see 3)
     2953                { $$ = DeclarationNode::newFunction( nullptr, nullptr, $3, nullptr ); }
     2954        | '(' abstract_parameter_ptr ')' '(' push parameter_type_list_opt pop ')' // empty parameter list OBSOLESCENT (see 3)
     2955                { $$ = $2->addParamList( $6 ); }
    30042956        | '(' abstract_parameter_function ')'                           // redundant parenthesis
    30052957                { $$ = $2; }
     
    30232975                { $$ = DeclarationNode::newArray( 0, 0, false ); }
    30242976        // multi_array_dimension handles the '[' '*' ']' case
    3025         | '[' type_qualifier_list '*' ']'                                       // remaining C99
    3026                 { $$ = DeclarationNode::newVarArray( $2 ); }
    3027         | '[' type_qualifier_list ']'
    3028                 { $$ = DeclarationNode::newArray( 0, $2, false ); }
     2977        | '[' push type_qualifier_list '*' pop ']'                      // remaining C99
     2978                { $$ = DeclarationNode::newVarArray( $3 ); }
     2979        | '[' push type_qualifier_list pop ']'
     2980                { $$ = DeclarationNode::newArray( 0, $3, false ); }
    30292981        // multi_array_dimension handles the '[' assignment_expression ']' case
    3030         | '[' type_qualifier_list assignment_expression ']'
    3031                 { $$ = DeclarationNode::newArray( $3, $2, false ); }
    3032         | '[' STATIC type_qualifier_list_opt assignment_expression ']'
    3033                 { $$ = DeclarationNode::newArray( $4, $3, true ); }
    3034         | '[' type_qualifier_list STATIC assignment_expression ']'
    3035                 { $$ = DeclarationNode::newArray( $4, $2, true ); }
     2982        | '[' push type_qualifier_list assignment_expression pop ']'
     2983                { $$ = DeclarationNode::newArray( $4, $3, false ); }
     2984        | '[' push STATIC type_qualifier_list_opt assignment_expression pop ']'
     2985                { $$ = DeclarationNode::newArray( $5, $4, true ); }
     2986        | '[' push type_qualifier_list STATIC assignment_expression pop ']'
     2987                { $$ = DeclarationNode::newArray( $5, $3, true ); }
    30362988        ;
    30372989
     
    30773029
    30783030variable_abstract_function:
    3079         '(' variable_abstract_ptr ')' '(' parameter_type_list_opt ')' // empty parameter list OBSOLESCENT (see 3)
    3080                 { $$ = $2->addParamList( $5 ); }
     3031        '(' variable_abstract_ptr ')' '(' push parameter_type_list_opt pop ')' // empty parameter list OBSOLESCENT (see 3)
     3032                { $$ = $2->addParamList( $6 ); }
    30813033        | '(' variable_abstract_function ')'                            // redundant parenthesis
    30823034                { $$ = $2; }
     
    31413093
    31423094cfa_array_parameter_1st_dimension:
    3143         '[' type_qualifier_list '*' ']'                                         // remaining C99
    3144                 { $$ = DeclarationNode::newVarArray( $2 ); }
    3145         | '[' type_qualifier_list assignment_expression ']'
    3146                 { $$ = DeclarationNode::newArray( $3, $2, false ); }
    3147         | '[' declaration_qualifier_list assignment_expression ']'
     3095        '[' push type_qualifier_list '*' pop ']'                        // remaining C99
     3096                { $$ = DeclarationNode::newVarArray( $3 ); }
     3097        | '[' push type_qualifier_list assignment_expression pop ']'
     3098                { $$ = DeclarationNode::newArray( $4, $3, false ); }
     3099        | '[' push declaration_qualifier_list assignment_expression pop ']'
    31483100                // declaration_qualifier_list must be used because of shift/reduce conflict with
    31493101                // assignment_expression, so a semantic check is necessary to preclude them as a type_qualifier cannot
    31503102                // appear in this context.
    3151                 { $$ = DeclarationNode::newArray( $3, $2, true ); }
    3152         | '[' declaration_qualifier_list type_qualifier_list assignment_expression ']'
    3153                 { $$ = DeclarationNode::newArray( $4, $3->addQualifiers( $3 ), true ); }
     3103                { $$ = DeclarationNode::newArray( $4, $3, true ); }
     3104        | '[' push declaration_qualifier_list type_qualifier_list assignment_expression pop ']'
     3105                { $$ = DeclarationNode::newArray( $5, $4->addQualifiers( $3 ), true ); }
    31543106        ;
    31553107
     
    32203172
    32213173cfa_abstract_tuple:                                                                             // CFA
    3222         '[' cfa_abstract_parameter_list ']'
    3223                 { $$ = DeclarationNode::newTuple( $2 ); }
     3174        '[' push cfa_abstract_parameter_list pop ']'
     3175                { $$ = DeclarationNode::newTuple( $3 ); }
    32243176        ;
    32253177
     
    32273179//      '[' ']' '(' cfa_parameter_type_list_opt ')'
    32283180//              { $$ = DeclarationNode::newFunction( nullptr, DeclarationNode::newTuple( nullptr ), $4, nullptr ); }
    3229         cfa_abstract_tuple '(' cfa_parameter_type_list_opt ')'
    3230                 { $$ = DeclarationNode::newFunction( nullptr, $1, $3, nullptr ); }
    3231         | cfa_function_return '(' cfa_parameter_type_list_opt ')'
    3232                 { $$ = DeclarationNode::newFunction( nullptr, $1, $3, nullptr ); }
     3181        cfa_abstract_tuple '(' push cfa_parameter_type_list_opt pop ')'
     3182                { $$ = DeclarationNode::newFunction( nullptr, $1, $4, nullptr ); }
     3183        | cfa_function_return '(' push cfa_parameter_type_list_opt pop ')'
     3184                { $$ = DeclarationNode::newFunction( nullptr, $1, $4, nullptr ); }
    32333185        ;
    32343186
  • src/ResolvExpr/AlternativeFinder.cc

    r13073be r8dbedfc  
    698698                        const ExplodedArgs& args, std::vector<ArgPack>& results, std::size_t& genStart,
    699699                        const SymTab::Indexer& indexer, unsigned nTuples = 0 ) {
    700                 if ( TupleType* tupleType = dynamic_cast<TupleType*>( formalType ) ) {
     700                if ( TupleType * tupleType = dynamic_cast<TupleType*>( formalType ) ) {
    701701                        // formalType is a TupleType - group actuals into a TupleExpr
    702702                        ++nTuples;
    703703                        for ( Type* type : *tupleType ) {
    704704                                // xxx - dropping initializer changes behaviour from previous, but seems correct
     705                                // ^^^ need to handle the case where a tuple has a default argument
    705706                                if ( ! instantiateArgument(
    706707                                                type, nullptr, args, results, genStart, indexer, nTuples ) )
     
    713714                        }
    714715                        return true;
    715                 } else if ( TypeInstType* ttype = Tuples::isTtype( formalType ) ) {
     716                } else if ( TypeInstType * ttype = Tuples::isTtype( formalType ) ) {
    716717                        // formalType is a ttype, consumes all remaining arguments
    717718                        // xxx - mixing default arguments with variadic??
     
    916917                                // consider only first exploded actual
    917918                                Expression* expr = expl.exprs.front().get();
    918                                 Type* actualType = expr->get_result()->clone();
     919                                Type* actualType = expr->result->clone();
    919920
    920921                                PRINT(
     
    947948                ApplicationExpr *appExpr = new ApplicationExpr( func.expr->clone() );
    948949                // sum cost and accumulate actuals
    949                 std::list<Expression*>& args = appExpr->get_args();
     950                std::list<Expression*>& args = appExpr->args;
    950951                Cost cost = func.cost;
    951952                const ArgPack* pack = &result;
     
    974975                // add all type variables as open variables now so that those not used in the parameter
    975976                // list are still considered open.
    976                 funcEnv.add( funcType->get_forall() );
    977 
    978                 if ( targetType && ! targetType->isVoid() && ! funcType->get_returnVals().empty() ) {
     977                funcEnv.add( funcType->forall );
     978
     979                if ( targetType && ! targetType->isVoid() && ! funcType->returnVals.empty() ) {
    979980                        // attempt to narrow based on expected target type
    980                         Type * returnType = funcType->get_returnVals().front()->get_type();
     981                        Type * returnType = funcType->returnVals.front()->get_type();
    981982                        if ( ! unify( returnType, targetType, funcEnv, funcNeed, funcHave, funcOpenVars,
    982983                                        indexer ) ) {
     
    991992                std::size_t genStart = 0;
    992993
    993                 for ( DeclarationWithType* formal : funcType->get_parameters() ) {
     994                for ( DeclarationWithType* formal : funcType->parameters ) {
    994995                        ObjectDecl* obj = strict_dynamic_cast< ObjectDecl* >( formal );
    995996                        if ( ! instantiateArgument(
    996                                         obj->get_type(), obj->get_init(), args, results, genStart, indexer ) )
     997                                        obj->type, obj->init, args, results, genStart, indexer ) )
    997998                                return;
    998999                }
     
    10751076        void AlternativeFinder::Finder::postvisit( UntypedExpr *untypedExpr ) {
    10761077                AlternativeFinder funcFinder( indexer, env );
    1077                 funcFinder.findWithAdjustment( untypedExpr->get_function() );
     1078                funcFinder.findWithAdjustment( untypedExpr->function );
    10781079                // if there are no function alternatives, then proceeding is a waste of time.
    10791080                if ( funcFinder.alternatives.empty() ) return;
     
    11201121                                )
    11211122                                // check if the type is pointer to function
    1122                                 if ( PointerType *pointer = dynamic_cast< PointerType* >( func->expr->get_result()->stripReferences() ) ) {
    1123                                         if ( FunctionType *function = dynamic_cast< FunctionType* >( pointer->get_base() ) ) {
     1123                                if ( PointerType *pointer = dynamic_cast< PointerType* >( func->expr->result->stripReferences() ) ) {
     1124                                        if ( FunctionType *function = dynamic_cast< FunctionType* >( pointer->base ) ) {
    11241125                                                Alternative newFunc( *func );
    11251126                                                referenceToRvalueConversion( newFunc.expr, newFunc.cost );
     
    11271128                                                        std::back_inserter( candidates ) );
    11281129                                        }
    1129                                 } else if ( TypeInstType *typeInst = dynamic_cast< TypeInstType* >( func->expr->get_result()->stripReferences() ) ) { // handle ftype (e.g. *? on function pointer)
     1130                                } else if ( TypeInstType *typeInst = dynamic_cast< TypeInstType* >( func->expr->result->stripReferences() ) ) { // handle ftype (e.g. *? on function pointer)
    11301131                                        EqvClass eqvClass;
    1131                                         if ( func->env.lookup( typeInst->get_name(), eqvClass ) && eqvClass.type ) {
     1132                                        if ( func->env.lookup( typeInst->name, eqvClass ) && eqvClass.type ) {
    11321133                                                if ( FunctionType *function = dynamic_cast< FunctionType* >( eqvClass.type ) ) {
    11331134                                                        Alternative newFunc( *func );
     
    11581159                                        // check if type is a pointer to function
    11591160                                        if ( PointerType* pointer = dynamic_cast<PointerType*>(
    1160                                                         funcOp->expr->get_result()->stripReferences() ) ) {
     1161                                                        funcOp->expr->result->stripReferences() ) ) {
    11611162                                                if ( FunctionType* function =
    1162                                                                 dynamic_cast<FunctionType*>( pointer->get_base() ) ) {
     1163                                                                dynamic_cast<FunctionType*>( pointer->base ) ) {
    11631164                                                        Alternative newFunc( *funcOp );
    11641165                                                        referenceToRvalueConversion( newFunc.expr, newFunc.cost );
     
    11821183                        PRINT(
    11831184                                ApplicationExpr *appExpr = strict_dynamic_cast< ApplicationExpr* >( withFunc.expr );
    1184                                 PointerType *pointer = strict_dynamic_cast< PointerType* >( appExpr->get_function()->get_result() );
    1185                                 FunctionType *function = strict_dynamic_cast< FunctionType* >( pointer->get_base() );
    1186                                 std::cerr << "Case +++++++++++++ " << appExpr->get_function() << std::endl;
     1185                                PointerType *pointer = strict_dynamic_cast< PointerType* >( appExpr->function->result );
     1186                                FunctionType *function = strict_dynamic_cast< FunctionType* >( pointer->base );
     1187                                std::cerr << "Case +++++++++++++ " << appExpr->function << std::endl;
    11871188                                std::cerr << "formals are:" << std::endl;
    1188                                 printAll( function->get_parameters(), std::cerr, 8 );
     1189                                printAll( function->parameters, std::cerr, 8 );
    11891190                                std::cerr << "actuals are:" << std::endl;
    1190                                 printAll( appExpr->get_args(), std::cerr, 8 );
     1191                                printAll( appExpr->args, std::cerr, 8 );
    11911192                                std::cerr << "bindings are:" << std::endl;
    11921193                                withFunc.env.print( std::cerr, 8 );
     
    12291230        bool isLvalue( Expression *expr ) {
    12301231                // xxx - recurse into tuples?
    1231                 return expr->result && ( expr->get_result()->get_lvalue() || dynamic_cast< ReferenceType * >( expr->get_result() ) );
     1232                return expr->result && ( expr->result->get_lvalue() || dynamic_cast< ReferenceType * >( expr->result ) );
    12321233        }
    12331234
     
    12911292                        AssertionSet needAssertions, haveAssertions;
    12921293                        OpenVarSet openVars;
     1294
     1295                        alt.env.extractOpenVars( openVars );
    12931296
    12941297                        // It's possible that a cast can throw away some values in a multiply-valued expression.  (An example is a
     
    17091712                        AlternativeFinder finder( indexer, env );
    17101713                        finder.targetType = toType;
    1711                         finder.findWithAdjustment( initExpr->get_expr() );
     1714                        finder.findWithAdjustment( initExpr->expr );
    17121715                        for ( Alternative & alt : finder.get_alternatives() ) {
    17131716                                TypeEnvironment newEnv( alt.env );
     
    17161719                                PRINT(
    17171720                                        std::cerr << "  @ " << toType << " " << initAlt.designation << std::endl;
    1718                                  )
     1721                                )
    17191722                                // It's possible that a cast can throw away some values in a multiply-valued expression.  (An example is a
    17201723                                // cast-to-void, which casts from one value to zero.)  Figure out the prefix of the subexpression results
    17211724                                // that are cast directly.  The candidate is invalid if it has fewer results than there are types to cast
    17221725                                // to.
    1723                                 int discardedValues = alt.expr->get_result()->size() - toType->size();
     1726                                int discardedValues = alt.expr->result->size() - toType->size();
    17241727                                if ( discardedValues < 0 ) continue;
    17251728                                // xxx - may need to go into tuple types and extract relevant types and use unifyList. Note that currently, this does not
     
    17281731                                unify( toType, alt.expr->result, newEnv, needAssertions, haveAssertions, openVars, indexer ); // xxx - do some inspecting on this line... why isn't result bound to initAlt.type??
    17291732
    1730                                 Cost thisCost = castCost( alt.expr->get_result(), toType, indexer, newEnv );
     1733                                Cost thisCost = castCost( alt.expr->result, toType, indexer, newEnv );
    17311734                                if ( thisCost != Cost::infinity ) {
    17321735                                        // count one safe conversion for each value that is thrown away
  • src/Tuples/TupleAssignment.cc

    r13073be r8dbedfc  
    231231
    232232                        ResolvExpr::AlternativeFinder finder{ currentFinder.get_indexer(),
    233                                 currentFinder.get_environ() };
     233                                matcher->compositeEnv };
     234
    234235                        try {
    235236                                finder.findWithAdjustment(*i);
     
    349350                                ltmp.push_back( lobj );
    350351                                rtmp.push_back( robj );
     352
     353                                // resolve the cast expression so that rhsAlt return type is bound by the cast type as needed, and transfer the resulting environment
     354                                ResolvExpr::AlternativeFinder finder{ spotter.currentFinder.get_indexer(), compositeEnv };
     355                                finder.findWithAdjustment( rhsAlt.expr );
     356                                assert( finder.get_alternatives().size() == 1 );
     357                                compositeEnv = std::move( finder.get_alternatives().front().env );
    351358                        }
    352359                        tmpDecls.splice( tmpDecls.end(), ltmp );
  • src/libcfa/concurrency/alarm.c

    r13073be r8dbedfc  
    1010// Created On       : Fri Jun 2 11:31:25 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Apr  9 13:36:18 2018
    13 // Update Count     : 61
     12// Last Modified On : Fri May 25 06:25:47 2018
     13// Update Count     : 67
    1414//
    1515
     
    3737
    3838void __kernel_set_timer( Duration alarm ) {
    39         verifyf(alarm >= 1`us || alarm == 0, "Setting timer to < 1us (%luns)", alarm.tv);
     39        verifyf(alarm >= 1`us || alarm == 0, "Setting timer to < 1us (%jins)", alarm.tv);
    4040        setitimer( ITIMER_REAL, &(itimerval){ alarm }, NULL );
    4141}
  • src/tests/.expect/io2.txt

    r13073be r8dbedfc  
    1 9 6 28 0 7 1 2
    2 1 2 3
    3 123
    4 123
    5 
    6 opening delimiters
    7 x (1 x [2 x {3 x =4 x $5 x £6 x ¥7 x ¡8 x ¿9 x «10
    8 
    9 closing delimiters
    10 1, x 2. x 3; x 4! x 5? x 6% x 7¢ x 8» x 9) x 10] x 11} x
    11 
    12 opening/closing delimiters
    13 x`1`x'2'x"3"x:4:x 5 x   6       x
    14 7
    15 x
    16 8
    17 x
    18 9
    19 x
    20 10
    21 x
    22 
    23 override opening/closing delimiters
    24 x ( 1 ) x 2 , x 3 :x: 4
    25 
    261input bacis types
    272
  • src/tests/.expect/math1.x64.txt

    r13073be r8dbedfc  
    1212\ 16 256
    1313\ 912673 256 64 -64 0.015625 -0.015625 18.3791736799526 0.264715-1.1922i
    14 log:0 0 0 0.346574+0.785398i 0.346573590279973+0.785398163397448i 0.346573590279972655+0.78539816339744831i
    15 log2:3 3 3
    16 log10:2 2 2
    17 log1p:0.693147 0.693147180559945 0.693147180559945309
    18 ilogb:0 0 0
    19 logb:3 3 3
    20 sqrt:1 1 1 1.09868+0.45509i 1.09868411346781+0.455089860562227i 1.09868411346780997+0.455089860562227341i
    21 cbrt:3 3 3
    22 hypot:1.41421 1.4142135623731 1.41421356237309505
  • src/tests/.expect/math1.x86.txt

    r13073be r8dbedfc  
    1212\ 16 256
    1313\ 912673 256 64 -64 0.015625 -0.015625 18.3791736799526 0.264715-1.1922i
    14 log:0 0 0 0.346574+0.785398i 0.346573590279973+0.785398163397448i 0.346573590279972655+0.78539816339744831i
    15 log2:3 3 3
    16 log10:2 2 2
    17 log1p:0.693147 0.693147180559945 0.693147180559945309
    18 ilogb:0 0 0
    19 logb:3 3 3
    20 sqrt:1 1 1 1.09868+0.45509i 1.09868411346781+0.455089860562227i 1.09868411346780997+0.455089860562227341i
    21 cbrt:3 3 3
    22 hypot:1.41421 1.4142135623731 1.41421356237309505
  • src/tests/.expect/math2.x64.txt

    r13073be r8dbedfc  
     1log:0 0 0 0.346574+0.785398i 0.346573590279973+0.785398163397448i 0.346573590279972655+0.78539816339744831i
     2log2:3 3 3
     3log10:2 2 2
     4log1p:0.693147 0.693147180559945 0.693147180559945309
     5ilogb:0 0 0
     6logb:3 3 3
     7sqrt:1 1 1 1.09868+0.45509i 1.09868411346781+0.455089860562227i 1.09868411346780997+0.455089860562227341i
     8cbrt:3 3 3
     9hypot:1.41421 1.4142135623731 1.41421356237309505
    110sin:0.841471 0.841470984807897 0.841470984807896507 1.29846+0.634964i 1.29845758141598+0.634963914784736i 1.29845758141597729+0.634963914784736108i
    211cos:0.540302 0.54030230586814 0.540302305868139717 0.83373-0.988898i 0.833730025131149-0.988897705762865i 0.833730025131149049-0.988897705762865096i
     
    615atan:0.785398 0.785398163397448 0.78539816339744831 1.01722+0.402359i 1.01722196789785+0.402359478108525i 1.01722196789785137+0.402359478108525094i
    716atan2:0.785398 0.785398163397448 0.78539816339744831 atan:0.785398 0.785398163397448 0.78539816339744831
    8 sinh:1.1752 1.1752011936438 1.17520119364380146 0.634964+1.29846i 0.634963914784736+1.29845758141598i 0.634963914784736108+1.29845758141597729i
    9 cosh:1.54308 1.54308063481524 1.54308063481524378 0.83373+0.988898i 0.833730025131149+0.988897705762865i 0.833730025131149049+0.988897705762865096i
    10 tanh:0.761594 0.761594155955765 0.761594155955764888 1.08392+0.271753i 1.08392332733869+0.271752585319512i 1.08392332733869454+0.271752585319511717i
    11 acosh:0 0 0 1.06128+0.904557i 1.06127506190504+0.904556894302381i 1.06127506190503565+0.904556894302381364i
    12 asinh:0.881374 0.881373587019543 0.881373587019543025 1.06128+0.666239i 1.06127506190504+0.666239432492515i 1.06127506190503565+0.666239432492515255i
    13 atanh:inf inf inf 0.402359+1.01722i 0.402359478108525+1.01722196789785i 0.402359478108525094+1.01722196789785137i
    14 erf:0.842701 0.842700792949715 0.842700792949714869
    15 erfc:0.157299 0.157299207050285 0.157299207050285131
    16 lgamma:1.79176 1.79175946922805 1.791759469228055
    17 lgamma:1.79176 1 1.79175946922805 1 1.791759469228055 1
    18 tgamma:6 6 6
  • src/tests/.expect/math2.x86.txt

    r13073be r8dbedfc  
     1log:0 0 0 0.346574+0.785398i 0.346573590279973+0.785398163397448i 0.346573590279972655+0.78539816339744831i
     2log2:3 3 3
     3log10:2 2 2
     4log1p:0.693147 0.693147180559945 0.693147180559945309
     5ilogb:0 0 0
     6logb:3 3 3
     7sqrt:1 1 1 1.09868+0.45509i 1.09868411346781+0.455089860562227i 1.09868411346780997+0.455089860562227341i
     8cbrt:3 3 3
     9hypot:1.41421 1.4142135623731 1.41421356237309505
    110sin:0.841471 0.841470984807897 0.841470984807896507 1.29846+0.634964i 1.29845758141598+0.634963914784736i 1.29845758141597729+0.634963914784736108i
    211cos:0.540302 0.54030230586814 0.540302305868139717 0.83373-0.988898i 0.833730025131149-0.988897705762865i 0.833730025131149049-0.988897705762865096i
     
    615atan:0.785398 0.785398163397448 0.78539816339744831 1.01722+0.402359i 1.01722196789785+0.402359478108525i 1.01722196789785137+0.402359478108525094i
    716atan2:0.785398 0.785398163397448 0.78539816339744831 atan:0.785398 0.785398163397448 0.78539816339744831
    8 sinh:1.1752 1.1752011936438 1.17520119364380146 0.634964+1.29846i 0.634963914784736+1.29845758141598i 0.634963914784736108+1.29845758141597729i
    9 cosh:1.54308 1.54308063481524 1.54308063481524378 0.83373+0.988898i 0.833730025131149+0.988897705762865i 0.833730025131149049+0.988897705762865096i
    10 tanh:0.761594 0.761594155955765 0.761594155955764888 1.08392+0.271753i 1.08392332733869+0.271752585319512i 1.08392332733869454+0.271752585319511717i
    11 acosh:0 0 0 1.06128+0.904557i 1.06127506190504+0.904556894302381i 1.06127506190503565+0.904556894302381364i
    12 asinh:0.881374 0.881373587019543 0.881373587019543025 1.06128+0.666239i 1.06127506190504+0.666239432492515i 1.06127506190503565+0.666239432492515255i
    13 atanh:inf inf inf 0.402359+1.01722i 0.402359478108525+1.01722196789785i 0.402359478108525094+1.01722196789785137i
    14 erf:0.842701 0.842700792949715 0.842700792949714869
    15 erfc:0.157299 0.157299207050285 0.157299207050285131
    16 lgamma:1.79176 1.79175946922805 1.791759469228055
    17 lgamma:1.79176 1 1.79175946922805 1 1.791759469228055 1
    18 tgamma:6 6 6
  • src/tests/.expect/math3.x64.txt

    r13073be r8dbedfc  
    1 floor:1 1 1
    2 ceil:2 2 2
    3 trunc:3 3 3
    4 rint:2 2 2
    5 rint:2 2 2
    6 rint:2 2 2
    7 lrint:2 2 2
    8 llrint:2 2 2
    9 nearbyint:4 4 4
    10 round:2 2 2
    11 round:2 2 2
    12 round:2 2 2
    13 lround:2 2 2
    14 llround:2 2 2
    15 copysign:-1 -1 -1
    16 frexp:0.5 3 0.5 3 0.5 3
    17 ldexp:8 8 8
    18 modf:2 0.3 2 0.3 2 0.3
    19 modf:2, 0.3 2, 0.3 2, 0.3
    20 nextafter:2 2 2
    21 nexttoward:2 2 2
    22 scalbn:16 16 16
    23 scalbln:16 16 16
     1sinh:1.1752 1.1752011936438 1.17520119364380146 0.634964+1.29846i 0.634963914784736+1.29845758141598i 0.634963914784736108+1.29845758141597729i
     2cosh:1.54308 1.54308063481524 1.54308063481524378 0.83373+0.988898i 0.833730025131149+0.988897705762865i 0.833730025131149049+0.988897705762865096i
     3tanh:0.761594 0.761594155955765 0.761594155955764888 1.08392+0.271753i 1.08392332733869+0.271752585319512i 1.08392332733869454+0.271752585319511717i
     4acosh:0 0 0 1.06128+0.904557i 1.06127506190504+0.904556894302381i 1.06127506190503565+0.904556894302381364i
     5asinh:0.881374 0.881373587019543 0.881373587019543025 1.06128+0.666239i 1.06127506190504+0.666239432492515i 1.06127506190503565+0.666239432492515255i
     6atanh:inf inf inf 0.402359+1.01722i 0.402359478108525+1.01722196789785i 0.402359478108525094+1.01722196789785137i
     7erf:0.842701 0.842700792949715 0.842700792949714869
     8erfc:0.157299 0.157299207050285 0.157299207050285131
     9lgamma:1.79176 1.79175946922805 1.791759469228055
     10lgamma:1.79176 1 1.79175946922805 1 1.791759469228055 1
     11tgamma:6 6 6
  • src/tests/.expect/math3.x86.txt

    r13073be r8dbedfc  
    1 floor:1 1 1
    2 ceil:2 2 2
    3 trunc:3 3 3
    4 rint:2 2 2
    5 rint:2 2 2
    6 rint:2 2 2
    7 lrint:2 2 2
    8 llrint:2 2 2
    9 nearbyint:4 4 4
    10 round:2 2 2
    11 round:2 2 2
    12 round:2 2 2
    13 lround:2 2 2
    14 llround:2 2 2
    15 copysign:-1 -1 -1
    16 frexp:0.5 3 0.5 3 0.5 3
    17 ldexp:8 8 8
    18 modf:2 0.3 2 0.3 2 0.3
    19 modf:2, 0.3 2, 0.3 2, 0.3
    20 nextafter:2 2 2
    21 nexttoward:2 2 2
    22 scalbn:16 16 16
    23 scalbln:16 16 16
     1sinh:1.1752 1.1752011936438 1.17520119364380146 0.634964+1.29846i 0.634963914784736+1.29845758141598i 0.634963914784736108+1.29845758141597729i
     2cosh:1.54308 1.54308063481524 1.54308063481524378 0.83373+0.988898i 0.833730025131149+0.988897705762865i 0.833730025131149049+0.988897705762865096i
     3tanh:0.761594 0.761594155955765 0.761594155955764888 1.08392+0.271753i 1.08392332733869+0.271752585319512i 1.08392332733869454+0.271752585319511717i
     4acosh:0 0 0 1.06128+0.904557i 1.06127506190504+0.904556894302381i 1.06127506190503565+0.904556894302381364i
     5asinh:0.881374 0.881373587019543 0.881373587019543025 1.06128+0.666239i 1.06127506190504+0.666239432492515i 1.06127506190503565+0.666239432492515255i
     6atanh:inf inf inf 0.402359+1.01722i 0.402359478108525+1.01722196789785i 0.402359478108525094+1.01722196789785137i
     7erf:0.842701 0.842700792949715 0.842700792949714869
     8erfc:0.157299 0.157299207050285 0.157299207050285131
     9lgamma:1.79176 1.79175946922805 1.791759469228055
     10lgamma:1.79176 1 1.79175946922805 1 1.791759469228055 1
     11tgamma:6 6 6
  • src/tests/concurrent/coroutineYield.c

    r13073be r8dbedfc  
    33#include <stdlib>
    44#include <thread>
     5#include <time>
     6
     7#ifndef PREEMPTION_RATE
     8#define PREEMPTION_RATE 10`ms
     9#endif
     10
     11Duration default_preemption() {
     12        return PREEMPTION_RATE;
     13}
    514
    615#ifdef LONG_TEST
  • src/tests/concurrent/examples/matrixSum.c

    r13073be r8dbedfc  
    1111// Created On       : Mon Oct  9 08:29:28 2017
    1212// Last Modified By : Peter A. Buhr
    13 // Last Modified On : Tue Dec  5 22:56:46 2017
    14 // Update Count     : 4
     13// Last Modified On : Fri May 25 09:34:27 2018
     14// Update Count     : 10
    1515//
    1616
     
    2020
    2121thread Adder {
    22     int * row, cols, * subtotal;                                                // communication
     22        int * row, cols, & subtotal;                                            // communication
    2323};
    2424
    2525void ?{}( Adder & adder, int row[], int cols, int & subtotal ) {
    26     adder.row = row;
    27     adder.cols = cols;
    28     adder.subtotal = &subtotal;
     26        adder.[ row, cols ] = [ row, cols ];                            // expression disallowed in multi-member access
     27        &adder.subtotal = &subtotal;
    2928}
    3029
    31 void main( Adder & adder ) with( adder ) {
    32     *subtotal = 0;
    33     for ( int c = 0; c < cols; c += 1 ) {
    34                 *subtotal += row[c];
    35     } // for
     30void main( Adder & adder ) with( adder ) {                              // thread starts here
     31        subtotal = 0;
     32        for ( int c = 0; c < cols; c += 1 ) {
     33                subtotal += row[c];
     34        } // for
    3635}
    3736
    3837int main() {
    39     const int rows = 10, cols = 1000;
    40     int matrix[rows][cols], subtotals[rows], total = 0;
    41     processor p;                                                                                // extra kernel thread
     38        const int rows = 10, cols = 1000;
     39        int matrix[rows][cols], subtotals[rows], total = 0;
     40        processor p;                                                                            // add kernel thread
    4241
    43     for ( int r = 0; r < rows; r += 1 ) {
     42        for ( int r = 0; r < rows; r += 1 ) {
    4443                for ( int c = 0; c < cols; c += 1 ) {
    4544                        matrix[r][c] = 1;
    4645                } // for
    47     } // for
    48     Adder * adders[rows];
    49     for ( int r = 0; r < rows; r += 1 ) {                               // start threads to sum rows
     46        } // for
     47        Adder * adders[rows];
     48        for ( int r = 0; r < rows; r += 1 ) {                           // start threads to sum rows
    5049                adders[r] = &(*malloc()){ matrix[r], cols, subtotals[r] };
    5150//              adders[r] = new( matrix[r], cols, &subtotals[r] );
    52     } // for
    53     for ( int r = 0; r < rows; r += 1 ) {                               // wait for threads to finish
     51        } // for
     52        for ( int r = 0; r < rows; r += 1 ) {                           // wait for threads to finish
    5453                delete( adders[r] );
    5554                total += subtotals[r];                                                  // total subtotals
    56     } // for
    57     sout | total | endl;
     55        } // for
     56        sout | total | endl;
    5857}
    5958
  • src/tests/concurrent/signal/block.c

    r13073be r8dbedfc  
    1414#include <time>
    1515
    16 #ifdef LONG_TEST
    17 static const unsigned long N = 150_000ul;
    18 #else
    19 static const unsigned long N = 5_000ul;
    20 #endif
    21 
    2216#ifndef PREEMPTION_RATE
    2317#define PREEMPTION_RATE 10`ms
     
    2721        return PREEMPTION_RATE;
    2822}
     23
     24#ifdef LONG_TEST
     25static const unsigned long N = 150_000ul;
     26#else
     27static const unsigned long N = 5_000ul;
     28#endif
    2929
    3030enum state_t { WAITED, SIGNAL, BARGE };
  • src/tests/concurrent/signal/disjoint.c

    r13073be r8dbedfc  
    44#include <thread>
    55#include <time>
    6 
    7 #ifdef LONG_TEST
    8 static const unsigned long N = 300_000ul;
    9 #else
    10 static const unsigned long N = 10_000ul;
    11 #endif
    126
    137#ifndef PREEMPTION_RATE
     
    1812        return PREEMPTION_RATE;
    1913}
     14
     15#ifdef LONG_TEST
     16static const unsigned long N = 300_000ul;
     17#else
     18static const unsigned long N = 10_000ul;
     19#endif
    2020
    2121enum state_t { WAIT, SIGNAL, BARGE };
  • src/tests/concurrent/signal/wait.c

    r13073be r8dbedfc  
    1212#include <time>
    1313
    14 #ifdef LONG_TEST
    15 static const unsigned long N = 375_000ul;
    16 #else
    17 static const unsigned long N = 2_500ul;
    18 #endif
    19 
    2014#ifndef PREEMPTION_RATE
    2115#define PREEMPTION_RATE 10`ms
     
    2519        return PREEMPTION_RATE;
    2620}
     21
     22#ifdef LONG_TEST
     23static const unsigned long N = 375_000ul;
     24#else
     25static const unsigned long N = 2_500ul;
     26#endif
    2727
    2828monitor global_t {};
  • src/tests/io2.c

    r13073be r8dbedfc  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // io.c --
     7// io2.c --
    88//
    99// Author           : Peter A. Buhr
    1010// Created On       : Wed Mar  2 16:56:02 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Jan 26 15:19:34 2018
    13 // Update Count     : 100
     12// Last Modified On : Thu May 24 21:17:41 2018
     13// Update Count     : 103
    1414//
    1515
     
    3737        enum { size = 10 };
    3838        char s1[size], s2[size];
    39 
    40         int x = 3, y = 5, z = 7;
    41         sout | x * 3 | y + 1 | z << 2 | x == y | (x | y) | (x || y) | (x > z ? 1 : 2) | endl;
    42         sout | 1 | 2 | 3 | endl;
    43         sout | '1' | '2' | '3' | endl;
    44         sout | 1 | "" | 2 | "" | 3 | endl;
    45         sout | endl;
    46 
    47         sout | "opening delimiters" | endl;
    48         sout
    49                  | "x (" | 1
    50                  | "x [" | 2
    51                  | "x {" | 3
    52                  | "x =" | 4
    53                  | "x $" | 5
    54                  | "x £" | 6
    55                  | "x ¥" | 7
    56                  | "x ¡" | 8
    57                  | "x ¿" | 9
    58                  | "x «" | 10
    59                  | endl | endl;
    60 
    61         sout | "closing delimiters" | endl;
    62         sout
    63                  | 1 | ", x"
    64                  | 2 | ". x"
    65                  | 3 | "; x"
    66                  | 4 | "! x"
    67                  | 5 | "? x"
    68                  | 6 | "% x"
    69                  | 7 | "¢ x"
    70                  | 8 | "» x"
    71                  | 9 | ") x"
    72                  | 10 | "] x"
    73                  | 11 | "} x"
    74                  | endl | endl;
    75 
    76         sout | "opening/closing delimiters" | endl;
    77         sout
    78                  | "x`" | 1 | "`x'" | 2
    79                  | "'x\"" | 3 | "\"x:" | 4
    80                  | ":x " | 5 | " x\t" | 6
    81                  | "\tx\f" | 7 | "\fx\v" | 8
    82                  | "\vx\n" | 9 | "\nx\r" | 10
    83                  | "\rx"
    84                  | endl | endl;
    85 
    86         sout | "override opening/closing delimiters" | endl;
    87         sout | "x ( " | 1 | " ) x" | 2 | " , x" | 3 | " :x: " | 4 | endl;
    88         sout | endl;
    8939
    9040        ifstream in = { "io.data" };                                            // create / open file
     
    181131// Local Variables: //
    182132// tab-width: 4 //
    183 // compile-command: "cfa io.c" //
     133// compile-command: "cfa io2.c" //
    184134// End: //
  • src/tests/math1.c

    r13073be r8dbedfc  
    1010// Created On       : Fri Apr 22 14:59:21 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Aug 11 15:16:41 2017
    13 // Update Count     : 84
     12// Last Modified On : Thu May 24 21:01:15 2018
     13// Update Count     : 85
    1414//
    1515
     
    4848    sout | "\\" | b | b \ e | endl;
    4949    sout | "\\" | 'a' \ 3u | 2 \ 8u | 4 \ 3u | -4 \ 3u | 4 \ -3 | -4 \ -3 | 4.0 \ 2.1 | (1.0f+2.0fi) \ (3.0f+2.0fi) | endl;
    50 
    51         //---------------------- Logarithm ----------------------
    52 
    53         sout | "log:" | log( 1.0F ) | log( 1.0D ) | log( 1.0L ) | log( 1.0F+1.0FI ) | log( 1.0D+1.0DI ) | log( 1.0DL+1.0LI ) | endl;
    54         sout | "log2:" | log2( 8.0F ) | log2( 8.0D ) | log2( 8.0L ) | endl;
    55         sout | "log10:" | log10( 100.0F ) | log10( 100.0D ) | log10( 100.0L ) | endl;
    56         sout | "log1p:" | log1p( 1.0F ) | log1p( 1.0D ) | log1p( 1.0L ) | endl;
    57         sout | "ilogb:" | ilogb( 1.0F ) | ilogb( 1.0D ) | ilogb( 1.0L ) | endl;
    58         sout | "logb:" | logb( 8.0F ) | logb( 8.0D ) | logb( 8.0L ) | endl;
    59 
    60         sout | "sqrt:" | sqrt( 1.0F ) | sqrt( 1.0D ) | sqrt( 1.0L ) | sqrt( 1.0F+1.0FI ) | sqrt( 1.0D+1.0DI ) | sqrt( 1.0DL+1.0LI ) | endl;
    61         sout | "cbrt:" | cbrt( 27.0F ) | cbrt( 27.0D ) | cbrt( 27.0L ) | endl;
    62         sout | "hypot:" | hypot( 1.0F, -1.0F ) | hypot( 1.0D, -1.0D ) | hypot( 1.0L, -1.0L ) | endl;
    6350} // main
    6451
  • src/tests/math2.c

    r13073be r8dbedfc  
    1010// Created On       : Fri Apr 22 14:59:21 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Aug 11 15:40:04 2017
    13 // Update Count     : 81
     12// Last Modified On : Thu May 24 21:06:10 2018
     13// Update Count     : 82
    1414//
    1515
     
    2121        double d;
    2222        long double l;
     23
     24        //---------------------- Logarithm ----------------------
     25
     26        sout | "log:" | log( 1.0F ) | log( 1.0D ) | log( 1.0L ) | log( 1.0F+1.0FI ) | log( 1.0D+1.0DI ) | log( 1.0DL+1.0LI ) | endl;
     27        sout | "log2:" | log2( 8.0F ) | log2( 8.0D ) | log2( 8.0L ) | endl;
     28        sout | "log10:" | log10( 100.0F ) | log10( 100.0D ) | log10( 100.0L ) | endl;
     29        sout | "log1p:" | log1p( 1.0F ) | log1p( 1.0D ) | log1p( 1.0L ) | endl;
     30        sout | "ilogb:" | ilogb( 1.0F ) | ilogb( 1.0D ) | ilogb( 1.0L ) | endl;
     31        sout | "logb:" | logb( 8.0F ) | logb( 8.0D ) | logb( 8.0L ) | endl;
     32
     33        sout | "sqrt:" | sqrt( 1.0F ) | sqrt( 1.0D ) | sqrt( 1.0L ) | sqrt( 1.0F+1.0FI ) | sqrt( 1.0D+1.0DI ) | sqrt( 1.0DL+1.0LI ) | endl;
     34        sout | "cbrt:" | cbrt( 27.0F ) | cbrt( 27.0D ) | cbrt( 27.0L ) | endl;
     35        sout | "hypot:" | hypot( 1.0F, -1.0F ) | hypot( 1.0D, -1.0D ) | hypot( 1.0L, -1.0L ) | endl;
    2336
    2437        //---------------------- Trigonometric ----------------------
     
    3245        sout | "atan2:" | atan2( 1.0F, 1.0F ) | atan2( 1.0D, 1.0D ) | atan2( 1.0L, 1.0L );
    3346        sout | "atan:" | atan( 1.0F, 1.0F ) | atan( 1.0D, 1.0D ) | atan( 1.0L, 1.0L ) | endl;
    34 
    35         //---------------------- Hyperbolic ----------------------
    36 
    37         sout | "sinh:" | sinh( 1.0F ) | sinh( 1.0D ) | sinh( 1.0L ) | sinh( 1.0F+1.0FI ) | sinh( 1.0D+1.0DI ) | sinh( 1.0DL+1.0LI ) | endl;
    38         sout | "cosh:" | cosh( 1.0F ) | cosh( 1.0D ) | cosh( 1.0L ) | cosh( 1.0F+1.0FI ) | cosh( 1.0D+1.0DI ) | cosh( 1.0DL+1.0LI ) | endl;
    39         sout | "tanh:" | tanh( 1.0F ) | tanh( 1.0D ) | tanh( 1.0L ) | tanh( 1.0F+1.0FI ) | tanh( 1.0D+1.0DI ) | tanh( 1.0DL+1.0LI ) | endl;
    40         sout | "acosh:" | acosh( 1.0F ) | acosh( 1.0D ) | acosh( 1.0L ) | acosh( 1.0F+1.0FI ) | acosh( 1.0D+1.0DI ) | acosh( 1.0DL+1.0LI ) | endl;
    41         sout | "asinh:" | asinh( 1.0F ) | asinh( 1.0D ) | asinh( 1.0L ) | asinh( 1.0F+1.0FI ) | asinh( 1.0D+1.0DI ) | asinh( 1.0DL+1.0LI ) | endl;
    42         sout | "atanh:" | atanh( 1.0F ) | atanh( 1.0D ) | atanh( 1.0L ) | atanh( 1.0F+1.0FI ) | atanh( 1.0D+1.0DI ) | atanh( 1.0DL+1.0LI ) | endl;
    43 
    44         //---------------------- Error / Gamma ----------------------
    45 
    46         sout | "erf:" | erf( 1.0F ) | erf( 1.0D ) | erf( 1.0L ) | endl;
    47         sout | "erfc:" | erfc( 1.0F ) | erfc( 1.0D ) | erfc( 1.0L ) | endl;
    48         sout | "lgamma:" | lgamma( 4.0F ) | lgamma( 4.0D ) | lgamma( 4.0L ) | endl;
    49         int sign;
    50         f = lgamma( 4.0F, &sign );
    51         sout | "lgamma:" | f | sign;
    52         d = lgamma( 4.0D, &sign );
    53         sout | d | sign;
    54         l = lgamma( 4.0L, &sign );
    55         sout | l | sign | endl;
    56         sout | "tgamma:" | tgamma( 4.0F ) | tgamma( 4.0D ) | tgamma( 4.0L ) | endl;
    5747} // main
    5848
  • src/tests/math3.c

    r13073be r8dbedfc  
    1010// Created On       : Fri Apr 22 14:59:21 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Aug 11 15:40:03 2017
    13 // Update Count     : 81
     12// Last Modified On : Thu May 24 21:06:12 2018
     13// Update Count     : 82
    1414//
    1515
     
    2222        long double l;
    2323
    24         //---------------------- Nearest Integer ----------------------
     24        //---------------------- Hyperbolic ----------------------
    2525
    26         sout | "floor:" | floor( 1.2F ) | floor( 1.2D ) | floor( 1.2L ) | endl;
    27         sout | "ceil:" | ceil( 1.6F ) | ceil( 1.6D ) | ceil( 1.6L ) | endl;
    28         sout | "trunc:" | trunc( 3.5F ) | trunc( 3.5D ) | trunc( 3.5L ) | endl;
    29         sout | "rint:" | (float)rint( 1.5F ) | (double)rint( 1.5D ) | (long double)rint( 1.5L ) | endl;
    30         sout | "rint:" | (long int)rint( 1.5F ) | (long int)rint( 1.5D ) | (long int)rint( 1.5L ) | endl;
    31         sout | "rint:" | (long long int)rint( 1.5F ) | (long long int)rint( 1.5D ) | (long long int)rint( 1.5L ) | endl;
    32         sout | "lrint:" | lrint( 1.5F ) | lrint( 1.5D ) | lrint( 1.5L ) | endl;
    33         sout | "llrint:" | llrint( 1.5F ) | llrint( 1.5D ) | llrint( 1.5L ) | endl;
    34         sout | "nearbyint:" | nearbyint( 3.5F ) | nearbyint( 3.5D ) | nearbyint( 3.5L ) | endl;
    35         sout | "round:" | (float)round( 1.5F ) | (double)round( 1.5D ) | (long double)round( 1.5L ) | endl;
    36         sout | "round:" | (long int)round( 1.5F ) | (long int)round( 1.5D ) | (long int)round( 1.5L ) | endl;
    37         sout | "round:" | (long long int)round( 1.5F ) | (long long int)round( 1.5D ) | (long long int)round( 1.5L ) | endl;
    38         sout | "lround:" | lround( 1.5F ) | lround( 1.5D ) | lround( 1.5L ) | endl;
    39         sout | "llround:" | llround( 1.5F ) | llround( 1.5D ) | llround( 1.5L ) | endl;
     26        sout | "sinh:" | sinh( 1.0F ) | sinh( 1.0D ) | sinh( 1.0L ) | sinh( 1.0F+1.0FI ) | sinh( 1.0D+1.0DI ) | sinh( 1.0DL+1.0LI ) | endl;
     27        sout | "cosh:" | cosh( 1.0F ) | cosh( 1.0D ) | cosh( 1.0L ) | cosh( 1.0F+1.0FI ) | cosh( 1.0D+1.0DI ) | cosh( 1.0DL+1.0LI ) | endl;
     28        sout | "tanh:" | tanh( 1.0F ) | tanh( 1.0D ) | tanh( 1.0L ) | tanh( 1.0F+1.0FI ) | tanh( 1.0D+1.0DI ) | tanh( 1.0DL+1.0LI ) | endl;
     29        sout | "acosh:" | acosh( 1.0F ) | acosh( 1.0D ) | acosh( 1.0L ) | acosh( 1.0F+1.0FI ) | acosh( 1.0D+1.0DI ) | acosh( 1.0DL+1.0LI ) | endl;
     30        sout | "asinh:" | asinh( 1.0F ) | asinh( 1.0D ) | asinh( 1.0L ) | asinh( 1.0F+1.0FI ) | asinh( 1.0D+1.0DI ) | asinh( 1.0DL+1.0LI ) | endl;
     31        sout | "atanh:" | atanh( 1.0F ) | atanh( 1.0D ) | atanh( 1.0L ) | atanh( 1.0F+1.0FI ) | atanh( 1.0D+1.0DI ) | atanh( 1.0DL+1.0LI ) | endl;
    4032
    41         //---------------------- Manipulation ----------------------
     33        //---------------------- Error / Gamma ----------------------
    4234
    43         sout | "copysign:" | copysign( 1.0F, -1.0F ) | copysign( 1.0D, -1.0D ) | copysign( 1.0L, -1.0L ) | endl;
    44         int exp;
    45         f = frexp( 4.0F, &exp );
    46         sout | "frexp:" | f | exp;
    47         d = frexp( 4.0D, &exp );
    48         sout | d | exp;
    49         l = frexp( 4.0L, &exp );
    50         sout | l | exp | endl;
    51         sout | "ldexp:" | ldexp( 2.0F, 2 ) | ldexp( 2.0D, 2 ) | ldexp( 2.0L, 2 ) | endl;
    52         float fi;
    53         double di;
    54         long double ldi;
    55         f = modf( 2.3F, &fi );
    56         sout | "modf:" | fi | f;
    57         d = modf( 2.3D, &di );
    58         sout | di | d;
    59         l = modf( 2.3L, &ldi );
    60         sout | ldi | l | endl;
    61         sout | "modf:" | modf( 2.3F ) | modf( 2.3D ) | modf( 2.3L ) | endl;
    62         sout | "nextafter:" | nextafter( 2.0F, 3.0F ) | nextafter( 2.0D, 3.0D ) | nextafter( 2.0L, 3.0L ) | endl;
    63         sout | "nexttoward:" | nexttoward( 2.0F, 3.0F ) | nexttoward( 2.0D, 3.0D ) | nexttoward( 2.0L, 3.0L ) | endl;
    64 
    65         sout | "scalbn:" | scalbn( 2.0F, 3 ) | scalbn( 2.0D, 3 ) | scalbn( 2.0L, 3 ) | endl;
    66         sout | "scalbln:" | scalbln( 2.0F, 3L ) | scalbln( 2.0D, 3L ) | scalbln( 2.0L, 3L ) | endl;
     35        sout | "erf:" | erf( 1.0F ) | erf( 1.0D ) | erf( 1.0L ) | endl;
     36        sout | "erfc:" | erfc( 1.0F ) | erfc( 1.0D ) | erfc( 1.0L ) | endl;
     37        sout | "lgamma:" | lgamma( 4.0F ) | lgamma( 4.0D ) | lgamma( 4.0L ) | endl;
     38        int sign;
     39        f = lgamma( 4.0F, &sign );
     40        sout | "lgamma:" | f | sign;
     41        d = lgamma( 4.0D, &sign );
     42        sout | d | sign;
     43        l = lgamma( 4.0L, &sign );
     44        sout | l | sign | endl;
     45        sout | "tgamma:" | tgamma( 4.0F ) | tgamma( 4.0D ) | tgamma( 4.0L ) | endl;
    6746} // main
    6847
  • src/tests/preempt_longrun/Makefile.am

    r13073be r8dbedfc  
    1717repeats=10
    1818max_time=600
    19 preempt=1_000ul
     19preempt=10ul\`ms
    2020debug=-debug
    2121
  • src/tests/preempt_longrun/Makefile.in

    r13073be r8dbedfc  
    450450repeats = 10
    451451max_time = 600
    452 preempt = 1_000ul
     452preempt = 10ul\`ms
    453453debug = -debug
    454454REPEAT = ${abs_top_srcdir}/tools/repeat
  • src/tests/preempt_longrun/create.c

    r13073be r8dbedfc  
    11#include <kernel>
    22#include <thread>
    3 
    4 static const unsigned long N = 60_000ul;
     3#include <time>
    54
    65#ifndef PREEMPTION_RATE
    7 #define PREEMPTION_RATE 10`ms
     6#error PREEMPTION_RATE not defined in makefile
    87#endif
    98
     
    1110        return PREEMPTION_RATE;
    1211}
     12
     13static const unsigned long N = 60_000ul;
    1314
    1415thread worker_t {};
  • src/tests/preempt_longrun/enter.c

    r13073be r8dbedfc  
    22#include <monitor>
    33#include <thread>
    4 
    5 static const unsigned long N  = 2_100_000ul;
     4#include <time>
    65
    76#ifndef PREEMPTION_RATE
    8 #define PREEMPTION_RATE 10`ms
     7#error PREEMPTION_RATE not defined in makefile
    98#endif
    109
     
    1211        return PREEMPTION_RATE;
    1312}
     13
     14static const unsigned long N  = 2_100_000ul;
    1415
    1516monitor mon_t {};
  • src/tests/preempt_longrun/enter3.c

    r13073be r8dbedfc  
    22#include <monitor>
    33#include <thread>
    4 
    5 static const unsigned long N  = 500_000ul;
     4#include <time>
    65
    76#ifndef PREEMPTION_RATE
    8 #define PREEMPTION_RATE 10`ms
     7#error PREEMPTION_RATE not defined in makefile
    98#endif
    109
     
    1211        return PREEMPTION_RATE;
    1312}
     13
     14static const unsigned long N  = 500_000ul;
    1415
    1516monitor mon_t {};
  • src/tests/preempt_longrun/processor.c

    r13073be r8dbedfc  
    11#include <kernel>
    22#include <thread>
    3 
    4 static const unsigned long N = 5_000ul;
     3#include <time>
    54
    65#ifndef PREEMPTION_RATE
    7 #define PREEMPTION_RATE 10`ms
     6#error PREEMPTION_RATE not defined in makefile
    87#endif
    98
     
    1110        return PREEMPTION_RATE;
    1211}
     12
     13static const unsigned long N = 5_000ul;
    1314
    1415int main(int argc, char* argv[]) {
  • src/tests/preempt_longrun/stack.c

    r13073be r8dbedfc  
    11#include <kernel>
     2#include <math>
    23#include <thread>
    3 
    4 #include <math>
     4#include <time>
    55
    66#ifndef PREEMPTION_RATE
    7 #define PREEMPTION_RATE 10`ms
     7#error PREEMPTION_RATE not defined in makefile
    88#endif
    99
  • src/tests/preempt_longrun/yield.c

    r13073be r8dbedfc  
    11#include <kernel>
    22#include <thread>
     3#include <time>
     4
     5#ifndef PREEMPTION_RATE
     6#error PREEMPTION_RATE not defined in makefile
     7#endif
     8
     9Duration default_preemption() {
     10        return PREEMPTION_RATE;
     11}
    312
    413#ifdef LONG_TEST
     
    716static const unsigned long N = 325_000ul;
    817#endif
    9 
    10 #ifndef PREEMPTION_RATE
    11 #define PREEMPTION_RATE 10`ms
    12 #endif
    13 
    14 Duration default_preemption() {
    15         return PREEMPTION_RATE;
    16 }
    1718
    1819thread worker_t {};
  • src/tests/test.py

    r13073be r8dbedfc  
    7878                        else :
    7979                                print('ERROR: No expected file for test %s, ignoring it' % testname, file=sys.stderr)
    80 
    81         # make sure we have at least some test to run
    82         if not tests :
    83                 print('ERROR: No valid test to run', file=sys.stderr)
    84                 sys.exit(1)
    8580
    8681        return tests
     
    266261                tests = validTests( options )
    267262
     263        # make sure we have at least some test to run
     264        if not tests :
     265                print('ERROR: No valid test to run', file=sys.stderr)
     266                sys.exit(1)
     267
     268
    268269        # sort the test alphabetically for convenience
    269270        tests.sort(key=lambda t: (t.arch if t.arch else '') + t.target())
Note: See TracChangeset for help on using the changeset viewer.