/******************************************************************************
 * Copyright (c) 2000-2021 Ericsson Telecom AB
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
 *
 * Contributors:
 *   Balasko, Jeno
 *   Raduly, Csaba
 *
 ******************************************************************************/
module small
{
    type record R2
    {
        integer i1,
        integer i2,
        integer i3,
        integer i4
    }

    type component C2 {}

    testcase tc4() runs on C2
    {   //var integer i3;
        var template R2 r1 := {
            1,2,3,4
        }
        var template R2 r2 := {
            i1 := 1, i2 := 2, i3 := 3, i4 := 4
        }
        fi( i1:=1, i2:=2, i3:=3 );
        fi( 1, i2:=2, i3:=3 );
        fi( 1,2, i3 := 3 );
        fi( 1,2,3 );
        /* temp commented out
        fi( -, i1:=1, i2:=2 );
        fi( -,-,3, i1:=1, i2:=2 );
        */

        setverdict(pass);
    }

    function fit( in template integer it )
    {
        log( "it=", it );
    }

    function fi(in integer i1, integer i2, integer i3 := 0)
    {
        template integer ti1 := ( 1,2,3 );
        template integer ti2 modifies ti1 := 42;
        log( "i3=", i3 );

        fit( modifies ti1 := 42 );
    }
}
