/***************************************************
 ** @author   STF 409
 ** @version  0.0.1
 ** @desc     Test cases for clause 5.2 Scope rules
 ** @purpose  1:5.3, Ensure that declarations are in the allowed ordering
 ** @verdict  pass reject
 ***************************************************/
module NegSem_0503_Ordering_002 {

    type component GeneralComp {
        var integer vc_component := 0;
    }

    function f_function() runs on GeneralComp {
        var integer v_function := 0;
    }

    testcase TC_NegSem_0503_Ordering_002() runs on GeneralComp  {
        if(true) {
            var integer v_int := 0;
            if (v_int == 0) {
                var integer v_statement_block_1 := 0;
                v_statement_block_1 := v_statement_block_1 + 1;
                var integer v_statement_block_2 := 0; // declaration has to go before other statements
            }

        }
        setverdict(pass);
    }

    control {
        var integer v_control := 0;
        execute(TC_NegSem_0503_Ordering_002());
    }

}
