Functions calls, EN/ENO

This test case it part of the test suite proposed for new devices.

Test case ID: R0111
Language: ST

Code:
tests2/t0111.st
// several cases of functions invocations (non extensible)

PROGRAM Test_R0111
    VAR
        i1,i2 : INT;
        o1,o2,o3,o1x,o4,o5,o6 : INT;
        eno2,eno3,eno5,eno6 : BOOL;
    END_VAR
    i1 := 20;
    i2 := 30;
    o1 := AV_R0111( i1,i2); // 25
    o1x :=  AV_R0111( AV_R0111(i1,i2) ,  AV_R0111(i1,i2) + 2);
    o2 := AV_R0111( EN := TRUE, X := i1 + 2 , Y := i2 + 2 , ENO => eno2);
    o3 := AV_R0111( EN := FALSE, X := i1 , Y := i2  , ENO => eno3);
   // similar with sdtlib
    o4 := MUL( IN1 := i1, IN2 := 2);
    o5 := MUL( EN := TRUE, IN1 := i1 + 2 , IN2 := 2 , ENO => eno5);
    o6 := MUL( EN := FALSE, IN1 := i1 , IN2 := 2  , ENO => eno6);

_GEB_ASSERT_(eno2 = 1);
_GEB_ASSERT_(eno3 = 0);
_GEB_ASSERT_(eno5 = 1);
_GEB_ASSERT_(eno6 = 0);
_GEB_ASSERT_(o1 = 25);
_GEB_ASSERT_(o1x = 26);
_GEB_ASSERT_(o2 = 27);
_GEB_ASSERT_(o3 = 0);
_GEB_ASSERT_(o4 = 40);
_GEB_ASSERT_(o5 = 44);
_GEB_ASSERT_(o6 = 0);

END_PROGRAM

// average
FUNCTION AV_R0111 : INT
    VAR_INPUT
        X, Y : INT;
    END_VAR
    AV_R0111 := (X + Y) / 2 ;    
END_FUNCTION