/***************************************************
 ** @author   STF 487
 ** @version  0.0.1
 ** @purpose  1:6.2.7, runtime resolved constant in array variable declaration
 ** @verdict  pass reject
 ***************************************************/

// The following requirement is tested:
// Array dimensions shall be specified using constant expressions, which shall
// evaluate to a positive integer values. Constants used in the constant
// expressions shall meet with the restrictions in clause 10.

module NegSem_060207_arrays_012 {

	type component GeneralComp {
	}

    function f() return integer {
        if (rnd() < 0.5) { return 5; }
        else { return 10; }
    }

    const integer c_dimension := f();

	testcase TC_NegSem_060207_arrays_012() runs on GeneralComp {
        var integer v_arr[c_dimension];
        v_arr[0] := 1;
		setverdict(pass);
	}

	control {
		execute(TC_NegSem_060207_arrays_012());
	}

}
