/***************************************************
 ** @author   STF 572
 ** @version  0.0.1
 ** @purpose  1:5.4.2, verify a function called during evaluation of a deterministic fuzzy parameter cannot contain a component variable used as an actual inout parameter
 ** @verdict  pass reject
 ***************************************************/

// The following requirement is tested:
// Actual parameters passed to fuzzy or lazy formal parameters shall fulfill the restrictions imposed on content
// of functions used in special places given in 16.1.4.
// The following operations shall not be used:
// g) Changing of component variables, i.e. using component variables on the left-hand side of assignments,
// and in the instantiation of out and inout parameters (see notes 4 and 6).

module NegSem_050402_actual_parameters_225 {
    type port P message {
        inout integer;
    }

    type component GeneralComp {
        port P p;
		var integer vc_int := 0;
	}

	function f_inout (inout integer p_inout) {
		p_inout := 1;
	}

	function f_test() runs on GeneralComp return template integer {
		f_inout(vc_int);
		return ?;
	}

    function f_param(template @fuzzy @deterministic integer p_param) runs on GeneralComp  {
        log(p_param); // causes validation
    }

    testcase TC_NegSem_050402_actual_parameters_225() runs on GeneralComp system GeneralComp {
        f_param(f_test());
		setverdict(pass);
	}

	control {
		execute(TC_NegSem_050402_actual_parameters_225());
	}
}
