Community
Participate
Working Groups
This FVT test // Test default exit within FOR loop for ( counter from 5 to stop by 1) total = total + counter; exit; end is incorrectly represent as an incrementing for loop in the IR; as a result, both Java and JavaGen generate the wrong code: <statements ID="180" eClass="org.eclipse.edt.mof.egl.ForStatement" isIncrement="true" > <annotations ID="181" eClass="dynMof:org.eclipse.edt.mof.egl.Annotation:EGL_Location" len="i:80" off="i:1844" line="i:67" /> <container IDREF="20"/> <body ID="182" eClass="org.eclipse.edt.mof.egl.StatementBlock" > <annotations ID="183" eClass="dynMof:org.eclipse.edt.mof.egl.Annotation:EGL_Location" len="i:80" off="i:1844" line="i:67" /> <container IDREF="20"/> <statements ID="184" eClass="org.eclipse.edt.mof.egl.AssignmentStatement" > <annotations ID="185" eClass="dynMof:org.eclipse.edt.mof.egl.Annotation:EGL_Location" len="i:24" off="i:1883" line="i:68" /> <container IDREF="20"/> <expr ID="186" eClass="org.eclipse.edt.mof.egl.Assignment" operator="=" > <annotations ID="187" eClass="dynMof:org.eclipse.edt.mof.egl.Annotation:EGL_Location" len="i:23" off="i:1883" line="i:68" /> <LHS ID="188" eClass="org.eclipse.edt.mof.egl.MemberName" id="total" > <annotations ID="189" eClass="dynMof:org.eclipse.edt.mof.egl.Annotation:EGL_Location" len="i:5" off="i:1883" line="i:68" /> <member IDREF="73"/> </LHS> <RHS ID="190" eClass="org.eclipse.edt.mof.egl.BinaryExpression" operator="+" > <annotations ID="191" eClass="dynMof:org.eclipse.edt.mof.egl.Annotation:EGL_Location" len="i:15" off="i:1891" line="i:68" /> <operands ID="192" eClass="org.eclipse.edt.mof.egl.MemberName" id="total" > <annotations ID="193" eClass="dynMof:org.eclipse.edt.mof.egl.Annotation:EGL_Location" len="i:5" off="i:1891" line="i:68" /> <member IDREF="73"/> </operands> <operands ID="194" eClass="org.eclipse.edt.mof.egl.MemberName" id="counter" > <annotations ID="195" eClass="dynMof:org.eclipse.edt.mof.egl.Annotation:EGL_Location" len="i:7" off="i:1899" line="i:68" /> <member IDREF="40"/> </operands> </RHS> </expr> </statements> <statements ID="196" eClass="org.eclipse.edt.mof.egl.ExitStatement" exitStatementType="0" > <annotations ID="197" eClass="dynMof:org.eclipse.edt.mof.egl.Annotation:EGL_Location" len="i:5" off="i:1912" line="i:69" /> <container IDREF="20"/> </statements> </body> <deltaExpression ID="198" eClass="org.eclipse.edt.mof.egl.IntegerLiteral" value="1" isNegated="false" > <annotations ID="199" eClass="dynMof:org.eclipse.edt.mof.egl.Annotation:EGL_Location" len="i:1" off="i:1876" line="i:67" /> </deltaExpression> <counterVariable ID="200" eClass="org.eclipse.edt.mof.egl.MemberName" id="counter" > <annotations ID="201" eClass="dynMof:org.eclipse.edt.mof.egl.Annotation:EGL_Location" len="i:7" off="i:1850" line="i:67" /> <member IDREF="40"/> </counterVariable> <fromExpression ID="202" eClass="org.eclipse.edt.mof.egl.IntegerLiteral" value="5" isNegated="false" > <annotations ID="203" eClass="dynMof:org.eclipse.edt.mof.egl.Annotation:EGL_Location" len="i:1" off="i:1863" line="i:67" /> </fromExpression> <toExpression ID="204" eClass="org.eclipse.edt.mof.egl.MemberName" id="stop" > <annotations ID="205" eClass="dynMof:org.eclipse.edt.mof.egl.Annotation:EGL_Location" len="i:4" off="i:1868" line="i:67" /> <member IDREF="55"/> </toExpression> </statements>
I do not understand why this testcase should NOT be increment. According to the code you have pasted, this should be an incremental for.
closing this defect for Scott