Changeset 14204


Ignore:
Timestamp:
Nov 28, 2019 8:48:52 AM (8 days ago)
Author:
Jonathan Kämpe
Message:

#5883 Merge to trunk. Array assignments in functions are now kept as composite rather than
expanded to for loops. Translates to memcpy in c-code. Should improve
compilation and runtime performance.

Location:
trunk
Files:
45 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/CHANGELOG.txt

    r14179 r14204  
    11================= Unreleased ==================
     2; Change ; Minor ; Compiler ; #5883
     3Array assignments in functions are now kept as composite rather than
     4expanded to for loops. Translates to memcpy in c-code. Should improve
     5compilation and runtime performance.
     6
    27; Fixed ; Minor ; Runtime ; #5884
    38Fixed an issue on Linux with linking external model libraries
  • trunk/Compiler/ModelicaCBackEnd/src/jastadd/CCodeGen/CCodeGenAlgorithms.jrag

    r12904 r14204  
    1616aspect CCodeGenAlgorithms {
    1717
     18    interface AssignPrintable_C {
     19        void genTempArg(CodePrinter.StepPrinter p, CodeStream str, String indent);
     20        boolean shouldBeDifferentiated();
     21        /**
     22         * Returns a string that denotes which macro will be used when assigning the value.
     23         * Depends on the FType and circumstances which might enable optimizations.
     24         */
     25        String assignMacroType();
     26        boolean isImmutable();
     27       
     28        ASTNode asASTNode(); // Workaround when transferring to frameworks that does not use interfaces yet.
     29    }
     30   
     31    FAbstractVariable implements AssignPrintable_C;
     32    FExp              implements AssignPrintable_C;
     33
    1834    /*
    1935     * Hook for printing assignment
     
    2137   
    2238    public class CodePrinter {
    23         public abstract void printAssign(FType type, CodeStream str, String indent, ASTNode left, ASTNode right);
     39        public abstract void printAssign(FType type, CodeStream str, String indent, AssignPrintable_C dst, AssignPrintable_C src);
    2440    }
    2541
    2642    public class CPrettyPrinter {
    2743        @Override
    28         public void printAssign(FType type, CodeStream str, String indent, ASTNode left, ASTNode right) {
    29             type.printAssign(ExecStep, str, indent, left, right);
     44        public void printAssign(FType type, CodeStream str, String indent, AssignPrintable_C dst, AssignPrintable_C src) {
     45            type.printAssign(ExecStep, str, indent, dst, src);
    3046        }
    3147    }
    3248
    3349    public void FType.printAssign(CodePrinter.ExecuteCodePrinter p, CodeStream str, String indent,
    34             ASTNode dst, ASTNode src) {
    35         str.print(indent);
    36         boolean deref = dst.deref_C();
     50            AssignPrintable_C dst, AssignPrintable_C src) {
     51        if (isComposite() || isString()) {
     52            printAssignMacro(p, str, indent, dst, src);
     53        } else {
     54            printAssignValue(p, str, indent, dst, src);
     55        }
     56    }
     57
     58    public void FType.printAssignMacro(CodePrinter.ExecuteCodePrinter p, CodeStream str, String indent,
     59            AssignPrintable_C dst, AssignPrintable_C src) {
     60        final boolean deref = isRecord() && isScalar();
     61       
     62        str.print(indent);
     63        str.print("JMI_ASG(");
     64        if (dst.isImmutable() && src.isImmutable()) {
     65            str.print("REF");
     66        } else {
     67            str.print(dst.assignMacroType());
     68        }
     69        str.print(", ");
    3770        if (deref) {
    3871            str.print("*");
    3972        }
    40         p.print(dst, str, indent);
    41         str.print(" = ");
     73        dst.genTempArg(p, str, indent);
     74        str.print(", ");
    4275        if (deref) {
    4376            str.print("*");
    4477        }
    45         p.print(src, str, indent);
    46         str.print(";\n");
    47     }
    48 
    49     syn boolean ASTNode.deref_C() = false;
    50     eq FAccessExp.deref_C() = type().isRecord() && hasFArraySubscripts();
    51 
    52     @Override
    53     public void FStringType.printAssign(CodePrinter.ExecuteCodePrinter p, CodeStream str, String indent,
    54             ASTNode dst, ASTNode src) {
    55         str.print(indent);
    56         str.print("JMI_ASG(");
    57         str.print(dst.assignMacroType(this));
    58         str.print(", ");
    59         p.print(dst, str, indent);
    60         str.print(", ");
    61         p.print(src, str, indent);
     78        src.genTempArg(p, str, indent);
    6279        str.print(")\n");
    6380    }
    64 
    65     syn String ASTNode.assignMacroType(FType type) = type.macroType();
    66     eq FAccessExp.assignMacroType(FType type)       = myFV().assignMacroType(type);
    67     eq FVariable.assignMacroType(FType type)       = isString() && !inRecord() ? "STR_Z" : super.assignMacroType(type);
     81   
     82   
     83    public void FType.printAssignValue(CodePrinter.ExecuteCodePrinter p, CodeStream str, String indent,
     84            AssignPrintable_C dst, AssignPrintable_C src) {
     85        str.print(indent);
     86        p.print(dst.asASTNode(), str, indent);
     87        str.print(" = ");
     88        p.print(src.asASTNode(), str, indent);
     89        str.print(";", "\n");
     90    }
     91
     92    @Override
     93    public ASTNode FAbstractVariable.asASTNode() {
     94        return this;
     95    }
     96   
     97    @Override
     98    public ASTNode FExp.asASTNode() {
     99        return this;
     100    }
     101
     102
     103    @Override
     104    public String FAbstractVariable.assignMacroType() {
     105        return assignMacroType(type());
     106    }
     107   
     108    @Override
     109    public String FExp.assignMacroType() {
     110        return type().macroType();
     111    }
     112   
     113    @Override
     114    public String FAccessExp.assignMacroType() {
     115        return myFV().assignMacroType(type());
     116    }
     117
     118    syn String FAbstractVariable.assignMacroType(FType type);
     119    eq FAbstractVariable.assignMacroType(FType type) = type.macroType();
     120    // Strings in z vector need to be deallocated before they are replaced, hence the STR_Z macro type.
     121    eq FVariable        .assignMacroType(FType type) = isString() && !inRecord() ? "STR_Z" : type.macroType();
    68122
    69123    /*
     
    191245    public void FVariable.algorithmInit(CodePrinter.ExecuteCodePrinter p, CodeStream str, String indent) {
    192246        if (isString()) {
    193             str.print(indent, "JMI_ASG(", assignMacroType(type()), ", ", p.name(this), ", ");
     247            str.print(indent, "JMI_ASG(", assignMacroType(), ", ", p.name(this), ", ");
    194248        } else {
    195249            str.print(indent, p.name(this), " = ");
     
    231285    }
    232286
     287    public void FAssignStmt.genVarDecls_C(CodePrinter p, CodeStream str, String indent) {
     288        p.DeclStep.printAssign(getLeft().type(), str, indent, getLeft(), getRight());
     289    }
     290
    233291    @Override
    234292    public void FAssignStmt.prettyPrint_C(CodePrinter p, CodeStream str, String indent) {
    235         p.printPreSteps(this, str, indent);
    236         p.printAssign(getLeft().type(), str, indent, getLeft(), getRight());
    237         p.printPostSteps(this, str, indent);
     293        p.PreStep.printAssign (getLeft().type(), str, indent, getLeft(), getRight());
     294        p.printAssign         (getLeft().type(), str, indent, getLeft(), getRight());
     295        p.PostStep.printAssign(getLeft().type(), str, indent, getLeft(), getRight());
    238296    }
    239297
  • trunk/Compiler/ModelicaCBackEnd/src/jastadd/CodeGen/StepPrinter.jrag

    r13640 r14204  
    2424            public void print(CodeStream str, String s) {
    2525               
     26            }
     27            public void printAssign(FType type, CodeStream str, String indent, AssignPrintable_C dst, AssignPrintable_C src) {
     28                if (type.isComposite() || type.isString()) {
     29                    dst.genTempArg(this, str, indent);
     30                    src.genTempArg(this, str, indent);
     31                } else {
     32                    print(dst.asASTNode(), str, indent);
     33                    print(src.asASTNode(), str, indent);
     34                }
    2635            }
    2736        }
     
    157166    }
    158167   
     168    @Override
     169    public void FAbstractVariable.genTempArg(CodePrinter.StepPrinter p, CodeStream str, String indent) {
     170        p.print(this, str, indent);
     171    }
     172   
     173    @Override
    159174    public void FExp.genTempArg(CodePrinter.StepPrinter p, CodeStream str, String indent) {
    160175        p.printIO(this, str, indent);
    161176    }
    162177   
     178    @Override
     179    public void FGlobalAccessExp.genTempArg(CodePrinter.StepPrinter p, CodeStream str, String indent) {
     180        if (isFunctionCallArg()) {
     181            p.printIO(this, str, indent);
     182        } else {
     183            p.print(this, str, indent);
     184        }
     185    }
     186   
     187    @Override
    163188    public void FIfExp.genTempArg(CodePrinter.StepPrinter p, CodeStream str, String indent) {
    164189        p.print(this, str, indent);
  • trunk/Compiler/ModelicaCBackEnd/test/modelica/CCodeGenAlgorithmTests.mo

    r14004 r14204  
    965965    JMI_ARR(STACK, jmi_real_t, jmi_array_t, o_an, 2, 1)
    966966    JMI_ARR(STACK, jmi_real_t, jmi_array_t, temp_1_a, 2, 1)
    967     jmi_real_t i1_0i;
    968     jmi_int_t i1_0ie;
    969     jmi_int_t i1_0in;
    970967    if (o_a == NULL) {
    971968        JMI_ARRAY_INIT_1(STACK, jmi_real_t, jmi_array_t, o_an, 2, 1, 2)
     
    975972    jmi_array_ref_1(temp_1_a, 1) = 1;
    976973    jmi_array_ref_1(temp_1_a, 2) = 1;
    977     i1_0in = 0;
    978     i1_0ie = floor((2) - (1));
    979     for (i1_0i = 1; i1_0in <= i1_0ie; i1_0i = 1 + (++i1_0in)) {
    980         jmi_array_ref_1(o_a, i1_0i) = jmi_array_val_1(temp_1_a, i1_0i);
    981     }
     974    JMI_ASG(GEN_ARR, o_a, temp_1_a)
    982975    JMI_DYNAMIC_FREE()
    983976    return;
     
    992985    JMI_ARR(STACK, jmi_real_t, jmi_array_t, temp_1_a, 2, 1)
    993986    JMI_ARR(STACK, jmi_real_t, jmi_array_t, temp_2_a, 2, 1)
     987    jmi_real_t i1_0i;
     988    jmi_int_t i1_0ie;
     989    jmi_int_t i1_0in;
    994990    jmi_real_t i1_1i;
    995991    jmi_int_t i1_1ie;
    996992    jmi_int_t i1_1in;
    997     jmi_real_t i1_2i;
    998     jmi_int_t i1_2ie;
    999     jmi_int_t i1_2in;
    1000     jmi_real_t i1_3i;
    1001     jmi_int_t i1_3ie;
    1002     jmi_int_t i1_3in;
    1003993    JMI_ARRAY_INIT_1(STACK, jmi_real_t, jmi_array_t, tmp_1, 3, 1, 3)
    1004994    r__v->a = tmp_1;
     
    10101000    JMI_ARRAY_INIT_1(STACK, jmi_real_t, jmi_array_t, temp_1_a, 2, 1, 2)
    10111001    func_CCodeGenAlgorithmTests_Algorithm9_f_def0(temp_1_a);
     1002    i1_0in = 0;
     1003    i1_0ie = floor((2) - (1));
     1004    for (i1_0i = 1; i1_0in <= i1_0ie; i1_0i = 1 + (++i1_0in)) {
     1005        jmi_array_ref_1(r_v->a, i1_0i) = 2 * jmi_array_val_1(temp_1_a, i1_0i);
     1006    }
     1007    JMI_ARRAY_INIT_1(STACK, jmi_real_t, jmi_array_t, temp_2_a, 2, 1, 2)
     1008    func_CCodeGenAlgorithmTests_Algorithm9_f_def0(temp_2_a);
    10121009    i1_1in = 0;
    10131010    i1_1ie = floor((2) - (1));
    10141011    for (i1_1i = 1; i1_1in <= i1_1ie; i1_1i = 1 + (++i1_1in)) {
    1015         jmi_array_ref_1(r_v->a, i1_1i) = 2 * jmi_array_val_1(temp_1_a, i1_1i);
    1016     }
    1017     JMI_ARRAY_INIT_1(STACK, jmi_real_t, jmi_array_t, temp_2_a, 2, 1, 2)
    1018     func_CCodeGenAlgorithmTests_Algorithm9_f_def0(temp_2_a);
    1019     i1_2in = 0;
    1020     i1_2ie = floor((2) - (1));
    1021     for (i1_2i = 1; i1_2in <= i1_2ie; i1_2i = 1 + (++i1_2in)) {
    1022         jmi_array_ref_1(r_v->a, 2 + (i1_2i - 1)) = jmi_array_val_1(temp_2_a, i1_2i);
    1023     }
    1024     i1_3in = 0;
    1025     i1_3ie = floor((3) - (1));
    1026     for (i1_3i = 1; i1_3in <= i1_3ie; i1_3i = 1 + (++i1_3in)) {
    1027         jmi_array_ref_1(r__v->a, i1_3i) = jmi_array_val_1(r_v->a, i1_3i);
    1028     }
     1012        jmi_array_ref_1(r_v->a, 2 + (i1_1i - 1)) = jmi_array_val_1(temp_2_a, i1_1i);
     1013    }
     1014    JMI_ASG(GEN_ARR, r__v->a, r_v->a)
    10291015    JMI_DYNAMIC_FREE()
    10301016    return;
     
    11701156    JMI_ARR(STACK, jmi_real_t, jmi_array_t, o_an, 2, 1)
    11711157    JMI_DEF(REA, dummy_v)
    1172     jmi_real_t i1_3i;
    1173     jmi_int_t i1_3ie;
    1174     jmi_int_t i1_3in;
    11751158    if (o_a == NULL) {
    11761159        JMI_ARRAY_INIT_1(STACK, jmi_real_t, jmi_array_t, o_an, 2, 1, 2)
     
    11781161    }
    11791162    dummy_v = 1;
    1180     i1_3in = 0;
    1181     i1_3ie = floor((2) - (1));
    1182     for (i1_3i = 1; i1_3in <= i1_3ie; i1_3i = 1 + (++i1_3in)) {
    1183         jmi_array_ref_1(o_a, i1_3i) = jmi_array_val_1(i_a, i1_3i);
    1184     }
     1163    JMI_ASG(GEN_ARR, o_a, i_a)
    11851164    JMI_RET(GEN, dummy_o, dummy_v)
    11861165    JMI_DYNAMIC_FREE()
  • trunk/Compiler/ModelicaCBackEnd/test/modelica/CCodeGenArrayTests.mo

    r14004 r14204  
    766766    jmi_array_ref_1(temp_2_a, 2) = 2;
    767767    JMI_ARRAY_INIT_1(STACK, jmi_string_t, jmi_string_array_t, temp_3_a, 1, 1, 1)
    768     JMI_ASG(STR, jmi_array_ref_1(temp_3_a, 1), s_v)
    769     jmi_array_rec_1(temp_1_a, 1)->x = temp_2_a;
    770     JMI_ASG(STR_ARR, jmi_array_rec_1(temp_1_a, 1)->s, temp_3_a)
     768    JMI_ASG(REF, jmi_array_ref_1(temp_3_a, 1), s_v)
     769    JMI_ASG(REF, jmi_array_rec_1(temp_1_a, 1)->x, temp_2_a)
     770    JMI_ASG(REF, jmi_array_rec_1(temp_1_a, 1)->s, temp_3_a)
    771771    JMI_ARRAY_INIT_1(STACK, jmi_real_t, jmi_array_t, temp_4_a, 1, 1, 1)
    772772    jmi_array_ref_1(temp_4_a, 1) = _time;
     
    780780    snprintf(JMI_STR_END(tmp_2), JMI_STR_LEFT(tmp_2), \"%s\", \"s3\");
    781781    JMI_ASG(STR, jmi_array_ref_1(temp_5_a, 2), tmp_2)
    782     jmi_array_rec_1(temp_1_a, 2)->x = temp_4_a;
    783     JMI_ASG(STR_ARR, jmi_array_rec_1(temp_1_a, 2)->s, temp_5_a)
     782    JMI_ASG(REF, jmi_array_rec_1(temp_1_a, 2)->x, temp_4_a)
     783    JMI_ASG(REF, jmi_array_rec_1(temp_1_a, 2)->s, temp_5_a)
    784784    y_v = func_CCodeGenArrayTests_RecordArray10_f_exp1(temp_1_a);
    785785    JMI_RET(GEN, y_o, y_v)
     
    835835    return ef;
    836836}
    837 
    838837")})));
    839838end RecordArray10;
  • trunk/Compiler/ModelicaCBackEnd/test/modelica/CCodeGenCompositeStatementTests.mo

    r12904 r14204  
    3232        R[:] r = f(R(time));
    3333
    34 annotation(__JModelica(UnitTesting(tests={
    35     CCodeGenTestCase(
    36         name="RecordStmt1",
    37         description="",
    38         template="
    39 $C_functions$
    40 ",
    41         generatedCode="
     34    annotation(__JModelica(UnitTesting(tests={
     35        CCodeGenTestCase(
     36            name="RecordStmt1",
     37            description="",
     38            template="$C_functions$",
     39            generatedCode="
    4240void func_CCodeGenCompositeStatementTests_RecordStmt1_f_def0(R_0_r* r_v, R_0_ra* y_a) {
    4341    JMI_DYNAMIC_INIT()
     
    5250    }
    5351    JMI_ARRAY_INIT_1(STACK, R_0_r, R_0_ra, temp_1_a, 2, 1, 2)
    54     *jmi_array_rec_1(temp_1_a, 1) = *JMI_GLOBAL(CCodeGenCompositeStatementTests_RecordStmt1_f_c);
    55     *jmi_array_rec_1(temp_1_a, 2) = *r_v;
     52    JMI_ASG(REF, *jmi_array_rec_1(temp_1_a, 1), *JMI_GLOBAL(CCodeGenCompositeStatementTests_RecordStmt1_f_c))
     53    JMI_ASG(REF, *jmi_array_rec_1(temp_1_a, 2), *r_v)
    5654    i1_0in = 0;
    5755    i1_0ie = floor((2) - (1));
     
    6260    return;
    6361}
     62
    6463")})));
    6564    end RecordStmt1;
     
    7978        R[:] r = f(R({time}));
    8079
    81 annotation(__JModelica(UnitTesting(tests={
    82     CCodeGenTestCase(
    83         name="RecordStmt2",
    84         description="",
    85         template="
    86 $C_functions$
    87 ",
    88         generatedCode="
     80    annotation(__JModelica(UnitTesting(tests={
     81        CCodeGenTestCase(
     82            name="RecordStmt2",
     83            description="",
     84            template="$C_functions$",
     85            generatedCode="
    8986void func_CCodeGenCompositeStatementTests_RecordStmt2_f_def0(R_0_r* r_v, R_0_ra* y_a) {
    9087    JMI_DYNAMIC_INIT()
     
    9693    jmi_int_t i1_0ie;
    9794    jmi_int_t i1_0in;
    98     jmi_real_t i2_1i;
    99     jmi_int_t i2_1ie;
    100     jmi_int_t i2_1in;
    10195    if (y_a == NULL) {
    10296        JMI_ARRAY_INIT_1(STACK, R_0_r, R_0_ra, y_an, 2, 1, 2)
     
    108102    }
    109103    JMI_ARRAY_INIT_1(STACK, R_0_r, R_0_ra, temp_1_a, 2, 1, 2)
    110     *jmi_array_rec_1(temp_1_a, 1) = *JMI_GLOBAL(CCodeGenCompositeStatementTests_RecordStmt2_f_c);
    111     *jmi_array_rec_1(temp_1_a, 2) = *r_v;
     104    JMI_ASG(REF, *jmi_array_rec_1(temp_1_a, 1), *JMI_GLOBAL(CCodeGenCompositeStatementTests_RecordStmt2_f_c))
     105    JMI_ASG(REF, *jmi_array_rec_1(temp_1_a, 2), *r_v)
    112106    i1_0in = 0;
    113107    i1_0ie = floor((2) - (1));
    114108    for (i1_0i = 1; i1_0in <= i1_0ie; i1_0i = 1 + (++i1_0in)) {
    115         i2_1in = 0;
    116         i2_1ie = floor((1) - (1));
    117         for (i2_1i = 1; i2_1in <= i2_1ie; i2_1i = 1 + (++i2_1in)) {
    118             jmi_array_ref_1(jmi_array_rec_1(y_a, i1_0i)->x, i2_1i) = jmi_array_val_1(jmi_array_rec_1(temp_1_a, i1_0i)->x, i2_1i);
    119         }
    120     }
    121     JMI_DYNAMIC_FREE()
    122     return;
    123 }
     109        JMI_ASG(GEN_ARR, jmi_array_rec_1(y_a, i1_0i)->x, jmi_array_rec_1(temp_1_a, i1_0i)->x)
     110    }
     111    JMI_DYNAMIC_FREE()
     112    return;
     113}
     114
    124115")})));
    125116    end RecordStmt2;
     
    149140        R3[:] r = f(R3(R2(R1({time}))));
    150141
    151 annotation(__JModelica(UnitTesting(tests={
    152     CCodeGenTestCase(
    153         name="RecordStmt3",
    154         description="",
    155         template="
    156 $C_functions$
    157 ",
    158         generatedCode="
     142    annotation(__JModelica(UnitTesting(tests={
     143        CCodeGenTestCase(
     144            name="RecordStmt3",
     145            description="",
     146            template="$C_functions$",
     147            generatedCode="
    159148void func_CCodeGenCompositeStatementTests_RecordStmt3_f_def0(R3_2_r* r_v, R3_2_ra* y_a) {
    160149    JMI_DYNAMIC_INIT()
     
    175164    jmi_int_t i1_0ie;
    176165    jmi_int_t i1_0in;
    177     jmi_real_t i1_1i;
    178     jmi_int_t i1_1ie;
    179     jmi_int_t i1_1in;
    180     jmi_real_t i1_2i;
    181     jmi_int_t i1_2ie;
    182     jmi_int_t i1_2in;
    183     jmi_real_t i2_3i;
    184     jmi_int_t i2_3ie;
    185     jmi_int_t i2_3in;
    186166    JMI_ARRAY_INIT_1(STACK, jmi_real_t, jmi_array_t, tmp_3, 1, 1, 1)
    187167    tmp_2->x = tmp_3;
     
    190170    JMI_ARRAY_INIT_1(STACK, jmi_real_t, jmi_array_t, temp_1_a, 1, 1, 1)
    191171    jmi_array_ref_1(temp_1_a, 1) = 1;
    192     i1_0in = 0;
    193     i1_0ie = floor((1) - (1));
    194     for (i1_0i = 1; i1_0in <= i1_0ie; i1_0i = 1 + (++i1_0in)) {
    195         jmi_array_ref_1(c_v->r->r->x, i1_0i) = jmi_array_val_1(temp_1_a, i1_0i);
    196     }
     172    JMI_ASG(GEN_ARR, c_v->r->r->x, temp_1_a)
    197173    c_v->r->x = 0;
    198174    if (y_a == NULL) {
     
    211187    jmi_array_rec_1(temp_2_a, 1)->r = jmi_dynamic_function_pool_alloc(&dyn_mem, 1*sizeof(R2_1_r), TRUE);
    212188    jmi_array_rec_1(temp_2_a, 1)->r->r = jmi_dynamic_function_pool_alloc(&dyn_mem, 1*sizeof(R1_0_r), TRUE);
    213     JMI_ARRAY_INIT_1(HEAP, jmi_real_t, jmi_array_t, jmi_array_rec_1(temp_2_a, 1)->r->r->x, 1, 1, 1)
    214     i1_1in = 0;
    215     i1_1ie = floor((1) - (1));
    216     for (i1_1i = 1; i1_1in <= i1_1ie; i1_1i = 1 + (++i1_1in)) {
    217         jmi_array_ref_1(jmi_array_rec_1(temp_2_a, 1)->r->r->x, i1_1i) = jmi_array_val_1(c_v->r->r->x, i1_1i);
    218     }
     189    JMI_ASG(GEN_ARR, jmi_array_rec_1(temp_2_a, 1)->r->r->x, c_v->r->r->x)
    219190    jmi_array_rec_1(temp_2_a, 1)->r->x = c_v->r->x;
    220     *jmi_array_rec_1(temp_2_a, 2) = *r_v;
    221     i1_2in = 0;
    222     i1_2ie = floor((2) - (1));
    223     for (i1_2i = 1; i1_2in <= i1_2ie; i1_2i = 1 + (++i1_2in)) {
    224         i2_3in = 0;
    225         i2_3ie = floor((1) - (1));
    226         for (i2_3i = 1; i2_3in <= i2_3ie; i2_3i = 1 + (++i2_3in)) {
    227             jmi_array_ref_1(jmi_array_rec_1(y_a, i1_2i)->r->r->x, i2_3i) = jmi_array_val_1(jmi_array_rec_1(temp_2_a, i1_2i)->r->r->x, i2_3i);
    228         }
    229         jmi_array_rec_1(y_a, i1_2i)->r->x = jmi_array_rec_1(temp_2_a, i1_2i)->r->x;
    230     }
    231     JMI_DYNAMIC_FREE()
    232     return;
    233 }
     191    JMI_ASG(REF, *jmi_array_rec_1(temp_2_a, 2), *r_v)
     192    i1_0in = 0;
     193    i1_0ie = floor((2) - (1));
     194    for (i1_0i = 1; i1_0in <= i1_0ie; i1_0i = 1 + (++i1_0in)) {
     195        JMI_ASG(GEN_ARR, jmi_array_rec_1(y_a, i1_0i)->r->r->x, jmi_array_rec_1(temp_2_a, i1_0i)->r->r->x)
     196        jmi_array_rec_1(y_a, i1_0i)->r->x = jmi_array_rec_1(temp_2_a, i1_0i)->r->x;
     197    }
     198    JMI_DYNAMIC_FREE()
     199    return;
     200}
     201
    234202")})));
    235203    end RecordStmt3;
     
    251219        R1[:] y = f(time);
    252220
    253 annotation(__JModelica(UnitTesting(tests={
    254     CCodeGenTestCase(
    255         name="RecordStmt4",
    256         description="Primitive array in record array initialization",
    257         template="
    258 $C_functions$
    259 ",
    260         generatedCode="
     221    annotation(__JModelica(UnitTesting(tests={
     222        CCodeGenTestCase(
     223            name="RecordStmt4",
     224            description="Primitive array in record array initialization",
     225            template="$C_functions$",
     226            generatedCode="
    261227void func_CCodeGenCompositeStatementTests_RecordStmt4_f_def0(jmi_real_t x_v, R1_0_ra* y_a) {
    262228    JMI_DYNAMIC_INIT()
     
    267233    jmi_int_t i1_0ie;
    268234    jmi_int_t i1_0in;
    269     jmi_real_t i2_1i;
    270     jmi_int_t i2_1ie;
    271     jmi_int_t i2_1in;
    272235    if (y_a == NULL) {
    273236        JMI_ARRAY_INIT_1(STACK, R1_0_r, R1_0_ra, y_an, 1, 1, 1)
     
    277240    }
    278241    JMI_ARRAY_INIT_1(STACK, R1_0_r, R1_0_ra, temp_1_a, 1, 1, 1)
    279     jmi_array_rec_1(temp_1_a, 1)->x = JMI_GLOBAL(CCodeGenCompositeStatementTests_RecordStmt4_f_c);
     242    JMI_ASG(REF, jmi_array_rec_1(temp_1_a, 1)->x, JMI_GLOBAL(CCodeGenCompositeStatementTests_RecordStmt4_f_c))
    280243    i1_0in = 0;
    281244    i1_0ie = floor((1) - (1));
    282245    for (i1_0i = 1; i1_0in <= i1_0ie; i1_0i = 1 + (++i1_0in)) {
    283         i2_1in = 0;
    284         i2_1ie = floor((1) - (1));
    285         for (i2_1i = 1; i2_1in <= i2_1ie; i2_1i = 1 + (++i2_1in)) {
    286             jmi_array_ref_1(jmi_array_rec_1(y_a, i1_0i)->x, i2_1i) = jmi_array_val_1(jmi_array_rec_1(temp_1_a, i1_0i)->x, i2_1i);
    287         }
    288     }
    289     JMI_DYNAMIC_FREE()
    290     return;
    291 }
     246        JMI_ASG(GEN_ARR, jmi_array_rec_1(y_a, i1_0i)->x, jmi_array_rec_1(temp_1_a, i1_0i)->x)
     247    }
     248    JMI_DYNAMIC_FREE()
     249    return;
     250}
     251
    292252")})));
    293253    end RecordStmt4;
     
    313273        R2[:] y = f(time);
    314274
    315 annotation(__JModelica(UnitTesting(tests={
    316     CCodeGenTestCase(
    317         name="RecordStmt5",
    318         description="Record array in record array initialization",
    319         template="
    320 $C_functions$
    321 ",
    322         generatedCode="
     275    annotation(__JModelica(UnitTesting(tests={
     276        CCodeGenTestCase(
     277            name="RecordStmt5",
     278            description="Record array in record array initialization",
     279            template="$C_functions$",
     280            generatedCode="
    323281void func_CCodeGenCompositeStatementTests_RecordStmt5_f_def0(jmi_real_t x_v, R2_1_ra* y_a) {
    324282    JMI_DYNAMIC_INIT()
     
    334292    jmi_int_t i2_1ie;
    335293    jmi_int_t i2_1in;
    336     jmi_real_t i3_2i;
    337     jmi_int_t i3_2ie;
    338     jmi_int_t i3_2in;
    339294    if (y_a == NULL) {
    340295        JMI_ARRAY_INIT_1(STACK, R2_1_r, R2_1_ra, y_an, 1, 1, 1)
     
    347302    JMI_ARRAY_INIT_1(STACK, R2_1_r, R2_1_ra, temp_1_a, 1, 1, 1)
    348303    JMI_ARRAY_INIT_1(STACK, R1_0_r, R1_0_ra, temp_2_a, 1, 1, 1)
    349     jmi_array_rec_1(temp_2_a, 1)->x = JMI_GLOBAL(CCodeGenCompositeStatementTests_RecordStmt5_f_c);
    350     jmi_array_rec_1(temp_1_a, 1)->r1 = temp_2_a;
     304    JMI_ASG(REF, jmi_array_rec_1(temp_2_a, 1)->x, JMI_GLOBAL(CCodeGenCompositeStatementTests_RecordStmt5_f_c))
     305    JMI_ASG(REF, jmi_array_rec_1(temp_1_a, 1)->r1, temp_2_a)
    351306    i1_0in = 0;
    352307    i1_0ie = floor((1) - (1));
     
    355310        i2_1ie = floor((1) - (1));
    356311        for (i2_1i = 1; i2_1in <= i2_1ie; i2_1i = 1 + (++i2_1in)) {
    357             i3_2in = 0;
    358             i3_2ie = floor((1) - (1));
    359             for (i3_2i = 1; i3_2in <= i3_2ie; i3_2i = 1 + (++i3_2in)) {
    360                 jmi_array_ref_1(jmi_array_rec_1(jmi_array_rec_1(y_a, i1_0i)->r1, i2_1i)->x, i3_2i) = jmi_array_val_1(jmi_array_rec_1(jmi_array_rec_1(temp_1_a, i1_0i)->r1, i2_1i)->x, i3_2i);
    361             }
     312            JMI_ASG(GEN_ARR, jmi_array_rec_1(jmi_array_rec_1(y_a, i1_0i)->r1, i2_1i)->x, jmi_array_rec_1(jmi_array_rec_1(temp_1_a, i1_0i)->r1, i2_1i)->x)
    362313        }
    363314    }
     
    365316    return;
    366317}
     318
    367319")})));
    368320    end RecordStmt5;
    369321
     322    model DifferentiatedStmt1
     323        function f
     324            input Real x;
     325            constant Real[:] c = {3,4};
     326            Real[:] t1 = {1, 2};
     327            Real[:] t2 = c;
     328            output Real[:] y = x .+ t1 .+ t2;
     329        algorithm
     330            annotation(smoothOrder=2);
     331        end f;
     332       
     333        Real[:] y = f(time);
     334        Real x;
     335    equation
     336        der(y[1]) = der(x);
     337
     338annotation(__JModelica(UnitTesting(tests={
     339    CCodeGenTestCase(
     340        name="DifferentiatedStmt1",
     341        description="",
     342        template="
     343$C_functions$
     344",
     345        generatedCode="
     346void func_CCodeGenCompositeStatementTests_DifferentiatedStmt1_f_def0(jmi_real_t x_v, jmi_array_t* y_a) {
     347    JMI_DYNAMIC_INIT()
     348    JMI_ARR(STACK, jmi_real_t, jmi_array_t, t1_a, 2, 1)
     349    JMI_ARR(STACK, jmi_real_t, jmi_array_t, t2_a, 2, 1)
     350    JMI_ARR(STACK, jmi_real_t, jmi_array_t, y_an, 2, 1)
     351    JMI_ARR(STACK, jmi_real_t, jmi_array_t, temp_1_a, 2, 1)
     352    jmi_real_t i1_0i;
     353    jmi_int_t i1_0ie;
     354    jmi_int_t i1_0in;
     355    JMI_ARRAY_INIT_1(STACK, jmi_real_t, jmi_array_t, t1_a, 2, 1, 2)
     356    JMI_ARRAY_INIT_1(STACK, jmi_real_t, jmi_array_t, temp_1_a, 2, 1, 2)
     357    jmi_array_ref_1(temp_1_a, 1) = 1;
     358    jmi_array_ref_1(temp_1_a, 2) = 2;
     359    JMI_ASG(GEN_ARR, t1_a, temp_1_a)
     360    JMI_ARRAY_INIT_1(STACK, jmi_real_t, jmi_array_t, t2_a, 2, 1, 2)
     361    JMI_ASG(GEN_ARR, t2_a, JMI_GLOBAL(CCodeGenCompositeStatementTests_DifferentiatedStmt1_f_c))
     362    if (y_a == NULL) {
     363        JMI_ARRAY_INIT_1(STACK, jmi_real_t, jmi_array_t, y_an, 2, 1, 2)
     364        y_a = y_an;
     365    }
     366    i1_0in = 0;
     367    i1_0ie = floor((2) - (1));
     368    for (i1_0i = 1; i1_0in <= i1_0ie; i1_0i = 1 + (++i1_0in)) {
     369        jmi_array_ref_1(y_a, i1_0i) = x_v + jmi_array_val_1(t1_a, i1_0i) + jmi_array_val_1(t2_a, i1_0i);
     370    }
     371    JMI_DYNAMIC_FREE()
     372    return;
     373}
     374
     375void func_CCodeGenCompositeStatementTests_DifferentiatedStmt1__der_f_def1(jmi_real_t x_v, jmi_real_t _der_x_v, jmi_array_t* _der_y_a) {
     376    JMI_DYNAMIC_INIT()
     377    JMI_ARR(STACK, jmi_real_t, jmi_array_t, _der_y_an, 2, 1)
     378    JMI_ARR(STACK, jmi_real_t, jmi_array_t, t1_a, 2, 1)
     379    JMI_ARR(STACK, jmi_real_t, jmi_array_t, _der_t1_a, 2, 1)
     380    JMI_ARR(STACK, jmi_real_t, jmi_array_t, t2_a, 2, 1)
     381    JMI_ARR(STACK, jmi_real_t, jmi_array_t, _der_t2_a, 2, 1)
     382    JMI_ARR(STACK, jmi_real_t, jmi_array_t, y_a, 2, 1)
     383    JMI_ARR(STACK, jmi_real_t, jmi_array_t, temp_1_a, 2, 1)
     384    JMI_ARR(STACK, jmi_real_t, jmi_array_t, tmp_1, 2, 1)
     385    JMI_ARR(STACK, jmi_real_t, jmi_array_t, tmp_2, 2, 1)
     386    jmi_real_t i1_1i;
     387    jmi_int_t i1_1ie;
     388    jmi_int_t i1_1in;
     389    JMI_ARRAY_INIT_1(STACK, jmi_real_t, jmi_array_t, t1_a, 2, 1, 2)
     390    JMI_ARRAY_INIT_1(STACK, jmi_real_t, jmi_array_t, _der_t1_a, 2, 1, 2)
     391    JMI_ARRAY_INIT_1(STACK, jmi_real_t, jmi_array_t, temp_1_a, 2, 1, 2)
     392    jmi_array_ref_1(temp_1_a, 1) = 1;
     393    jmi_array_ref_1(temp_1_a, 2) = 2;
     394    JMI_ARRAY_INIT_1(STACK, jmi_real_t, jmi_array_t, tmp_1, 2, 1, 2)
     395    jmi_array_ref_1(tmp_1, 1) = 0.0;
     396    jmi_array_ref_1(tmp_1, 2) = 0.0;
     397    JMI_ASG(GEN_ARR, _der_t1_a, tmp_1)
     398    JMI_ASG(GEN_ARR, t1_a, temp_1_a)
     399    JMI_ARRAY_INIT_1(STACK, jmi_real_t, jmi_array_t, t2_a, 2, 1, 2)
     400    JMI_ARRAY_INIT_1(STACK, jmi_real_t, jmi_array_t, _der_t2_a, 2, 1, 2)
     401    JMI_ARRAY_INIT_1(STACK, jmi_real_t, jmi_array_t, tmp_2, 2, 1, 2)
     402    jmi_array_ref_1(tmp_2, 1) = 0.0;
     403    jmi_array_ref_1(tmp_2, 2) = 0.0;
     404    JMI_ASG(GEN_ARR, _der_t2_a, tmp_2)
     405    JMI_ASG(GEN_ARR, t2_a, JMI_GLOBAL(CCodeGenCompositeStatementTests_DifferentiatedStmt1_f_c))
     406    JMI_ARRAY_INIT_1(STACK, jmi_real_t, jmi_array_t, y_a, 2, 1, 2)
     407    if (_der_y_a == NULL) {
     408        JMI_ARRAY_INIT_1(STACK, jmi_real_t, jmi_array_t, _der_y_an, 2, 1, 2)
     409        _der_y_a = _der_y_an;
     410    }
     411    i1_1in = 0;
     412    i1_1ie = floor((2) - (1));
     413    for (i1_1i = 1; i1_1in <= i1_1ie; i1_1i = 1 + (++i1_1in)) {
     414        jmi_array_ref_1(_der_y_a, i1_1i) = _der_x_v + jmi_array_val_1(_der_t1_a, i1_1i) + jmi_array_val_1(_der_t2_a, i1_1i);
     415        jmi_array_ref_1(y_a, i1_1i) = x_v + jmi_array_val_1(t1_a, i1_1i) + jmi_array_val_1(t2_a, i1_1i);
     416    }
     417    JMI_DYNAMIC_FREE()
     418    return;
     419}
     420")})));
     421    end DifferentiatedStmt1;
     422
    370423end CCodeGenCompositeStatementTests;
  • trunk/Compiler/ModelicaCBackEnd/test/modelica/CCodeGenExternalTests.mo

    r13491 r14204  
    22292229    JMI_ARR(HEAP, jmi_real_t, jmi_array_t, Awork_a, -1, 2)
    22302230    JMI_ARR(HEAP, jmi_real_t, jmi_array_t, work_a, -1, 1)
    2231     jmi_real_t i1_0i;
    2232     jmi_int_t i1_0ie;
    2233     jmi_int_t i1_0in;
    2234     jmi_real_t i2_1i;
    2235     jmi_int_t i2_1ie;
    2236     jmi_int_t i2_1in;
    22372231    JMI_DEF(STR_EXT, tmp_1)
    22382232    JMI_DEF(STR_EXT, tmp_2)
     
    22622256    lwork_v = 12 * n_v;
    22632257    JMI_ARRAY_INIT_2(HEAP, jmi_real_t, jmi_array_t, Awork_a, jmi_array_size(A_a, 0) * jmi_array_size(A_a, 0), 2, jmi_array_size(A_a, 0), jmi_array_size(A_a, 0))
    2264     i1_0in = 0;
    2265     i1_0ie = floor((jmi_array_size(A_a, 0)) - (1));
    2266     for (i1_0i = 1; i1_0in <= i1_0ie; i1_0i = 1 + (++i1_0in)) {
    2267         i2_1in = 0;
    2268         i2_1ie = floor((jmi_array_size(A_a, 0)) - (1));
    2269         for (i2_1i = 1; i2_1in <= i2_1ie; i2_1i = 1 + (++i2_1in)) {
    2270             jmi_array_ref_2(Awork_a, i1_0i, i2_1i) = jmi_array_val_2(A_a, i1_0i, i2_1i);
    2271         }
    2272     }
     2258    JMI_ASG(GEN_ARR, Awork_a, A_a)
    22732259    JMI_ARRAY_INIT_1(HEAP, jmi_real_t, jmi_array_t, work_a, 12 * jmi_array_size(A_a, 0), 1, 12 * jmi_array_size(A_a, 0))
    22742260    JMI_ASG(STR, tmp_1, \"N\")
  • trunk/Compiler/ModelicaCBackEnd/test/modelica/CCodeGenTests.mo

    r14004 r14204  
    941941    jmi_int_t i1_2ie;
    942942    jmi_int_t i1_2in;
    943     jmi_real_t i1_3i;
    944     jmi_int_t i1_3ie;
    945     jmi_int_t i1_3in;
    946     jmi_real_t i2_4i;
    947     jmi_int_t i2_4ie;
    948     jmi_int_t i2_4in;
    949943    if (y_a == NULL) {
    950944        JMI_ARRAY_INIT_2(STACK, jmi_real_t, jmi_array_t, y_an, 1, 2, 1, 1)
     
    959953        jmi_array_ref_2(temp_1_a, 1, i1_2i) = jmi_array_val_1(temp_2_a, i1_2i);
    960954    }
     955    JMI_ASG(GEN_ARR, y_a, temp_1_a)
     956    JMI_DYNAMIC_FREE()
     957    return;
     958}
     959
     960void func_CCodeGenTests_CCodeGenTest20_mysum_def2(jmi_array_t* x_a, jmi_real_t* y_o) {
     961    JMI_DYNAMIC_INIT()
     962    JMI_DEF(REA, y_v)
     963    JMI_DEF(REA, temp_1_v)
     964    jmi_real_t i1_3i;
     965    jmi_int_t i1_3ie;
     966    jmi_int_t i1_3in;
     967    jmi_real_t i2_4i;
     968    jmi_int_t i2_4ie;
     969    jmi_int_t i2_4in;
     970    temp_1_v = 0.0;
    961971    i1_3in = 0;
    962     i1_3ie = floor((1) - (1));
     972    i1_3ie = floor((jmi_array_size(x_a, 0)) - (1));
    963973    for (i1_3i = 1; i1_3in <= i1_3ie; i1_3i = 1 + (++i1_3in)) {
    964974        i2_4in = 0;
    965         i2_4ie = floor((1) - (1));
     975        i2_4ie = floor((jmi_array_size(x_a, 1)) - (1));
    966976        for (i2_4i = 1; i2_4in <= i2_4ie; i2_4i = 1 + (++i2_4in)) {
    967             jmi_array_ref_2(y_a, i1_3i, i2_4i) = jmi_array_val_2(temp_1_a, i1_3i, i2_4i);
    968         }
    969     }
    970     JMI_DYNAMIC_FREE()
    971     return;
    972 }
    973 
    974 void func_CCodeGenTests_CCodeGenTest20_mysum_def2(jmi_array_t* x_a, jmi_real_t* y_o) {
    975     JMI_DYNAMIC_INIT()
    976     JMI_DEF(REA, y_v)
    977     JMI_DEF(REA, temp_1_v)
    978     jmi_real_t i1_5i;
    979     jmi_int_t i1_5ie;
    980     jmi_int_t i1_5in;
    981     jmi_real_t i2_6i;
    982     jmi_int_t i2_6ie;
    983     jmi_int_t i2_6in;
    984     temp_1_v = 0.0;
    985     i1_5in = 0;
    986     i1_5ie = floor((jmi_array_size(x_a, 0)) - (1));
    987     for (i1_5i = 1; i1_5in <= i1_5ie; i1_5i = 1 + (++i1_5in)) {
    988         i2_6in = 0;
    989         i2_6ie = floor((jmi_array_size(x_a, 1)) - (1));
    990         for (i2_6i = 1; i2_6in <= i2_6ie; i2_6i = 1 + (++i2_6in)) {
    991             temp_1_v = temp_1_v + jmi_array_val_2(x_a, i1_5i, i2_6i);
     977            temp_1_v = temp_1_v + jmi_array_val_2(x_a, i1_3i, i2_4i);
    992978        }
    993979    }
     
    29492935    JMI_DYNAMIC_INIT()
    29502936    JMI_ARR(STACK, jmi_real_t, jmi_array_t, y_an, 2, 1)
    2951     jmi_real_t i1_0i;
    2952     jmi_int_t i1_0ie;
    2953     jmi_int_t i1_0in;
    29542937    if (y_a == NULL) {
    29552938        JMI_ARRAY_INIT_1(STACK, jmi_real_t, jmi_array_t, y_an, 2, 1, 2)
    29562939        y_a = y_an;
    29572940    }
    2958     i1_0in = 0;
    2959     i1_0ie = floor((2) - (1));
    2960     for (i1_0i = 1; i1_0in <= i1_0ie; i1_0i = 1 + (++i1_0in)) {
    2961         jmi_array_ref_1(y_a, i1_0i) = jmi_array_val_1(x_a, i1_0i);
    2962     }
     2941    JMI_ASG(GEN_ARR, y_a, x_a)
    29632942    JMI_DYNAMIC_FREE()
    29642943    return;
     
    29762955    (*res)[2] = 1 - ((_z_1_0*sf(0)));
    29772956    (*res)[3] = 1 - ((_z_2_1*sf(1)));
    2978 
    29792957")})));
    29802958end CFunctionTest12;
     
    36923670    JMI_ARR(STACK, jmi_real_t, jmi_array_t, tmp_1, 2, 1)
    36933671    JMI_ARR(STACK, jmi_real_t, jmi_array_t, tmp_2, 2, 1)
    3694     JMI_ARR(STACK, jmi_real_t, jmi_array_t, tmp_3, 2, 1)
    3695     jmi_real_t i1_0i;
    3696     jmi_int_t i1_0ie;
    3697     jmi_int_t i1_0in;
    36983672    if (y_a == NULL) {
    36993673        JMI_ARRAY_INIT_1(STACK, jmi_real_t, jmi_array_t, tmp_1, 2, 1, 2)
     
    37113685    JMI_ARRAY_INIT_1(STACK, jmi_real_t, jmi_array_t, temp_1_a, 1, 1, 1)
    37123686    jmi_array_ref_1(temp_1_a, 1) = x_v;
    3713     JMI_ARRAY_INIT_1(STACK, jmi_real_t, jmi_array_t, tmp_3, 2, 1, 2)
    3714     jmi_array_ref_1(tmp_3, 1) = x_v;
    3715     jmi_array_ref_1(tmp_3, 2) = x_v;
    3716     i1_0in = 0;
    3717     i1_0ie = floor((func_CCodeGenTests_FuncWithArray_g_exp1(tmp_3)) - (1));
    3718     for (i1_0i = 1; i1_0in <= i1_0ie; i1_0i = 1 + (++i1_0in)) {
    3719         jmi_array_ref_1(y_a, i1_0i) = jmi_array_val_1(temp_1_a, i1_0i);
    3720     }
     3687    JMI_ASG(GEN_ARR, y_a, temp_1_a)
    37213688    JMI_DYNAMIC_FREE()
    37223689    return;
     
    37283695    JMI_DEF(REA, temp_1_v)
    37293696    JMI_DEF(REA, temp_2_v)
     3697    jmi_real_t i1_0i;
     3698    jmi_int_t i1_0ie;
     3699    jmi_int_t i1_0in;
    37303700    jmi_real_t i1_1i;
    37313701    jmi_int_t i1_1ie;
    37323702    jmi_int_t i1_1in;
    3733     jmi_real_t i1_2i;
    3734     jmi_int_t i1_2ie;
    3735     jmi_int_t i1_2in;
    37363703    temp_1_v = 0.0;
     3704    i1_0in = 0;
     3705    i1_0ie = floor((jmi_array_size(x_a, 0)) - (1));
     3706    for (i1_0i = 1; i1_0in <= i1_0ie; i1_0i = 1 + (++i1_0in)) {
     3707        temp_1_v = temp_1_v + jmi_array_val_1(x_a, i1_0i);
     3708    }
     3709    temp_2_v = 0.0;
    37373710    i1_1in = 0;
    37383711    i1_1ie = floor((jmi_array_size(x_a, 0)) - (1));
    37393712    for (i1_1i = 1; i1_1in <= i1_1ie; i1_1i = 1 + (++i1_1in)) {
    3740         temp_1_v = temp_1_v + jmi_array_val_1(x_a, i1_1i);
    3741     }
    3742     temp_2_v = 0.0;
    3743     i1_2in = 0;
    3744     i1_2ie = floor((jmi_array_size(x_a, 0)) - (1));
    3745     for (i1_2i = 1; i1_2in <= i1_2ie; i1_2i = 1 + (++i1_2in)) {
    3746         temp_2_v = temp_2_v + jmi_array_val_1(x_a, i1_2i);
     3713        temp_2_v = temp_2_v + jmi_array_val_1(x_a, i1_1i);
    37473714    }
    37483715    n_v = floor(JMI_DIVIDE_FUNCTION(\"CCodeGenTests.FuncWithArray.g\", temp_1_v, temp_2_v, \"temp_1 / temp_2\"));
     
    49164883 Real x[2] = f();
    49174884
    4918     annotation(__JModelica(UnitTesting(tests={
    4919         CCodeGenTestCase(
    4920             name="CArrayOutputs1",
    4921             description="C code generation: array outputs from functions: in equation",
    4922             variability_propagation=false,
    4923             inline_functions="none",
    4924             generate_ode=false,
    4925             generate_dae=true,
    4926             template="
     4885annotation(__JModelica(UnitTesting(tests={
     4886    CCodeGenTestCase(
     4887        name="CArrayOutputs1",
     4888        description="C code generation: array outputs from functions: in equation",
     4889        variability_propagation=false,
     4890        inline_functions="none",
     4891        generate_ode=false,
     4892        generate_dae=true,
     4893        template="
    49274894$C_function_headers$
    49284895$C_functions$
    49294896$C_DAE_equation_residuals$
    49304897",
    4931             generatedCode="
     4898        generatedCode="
    49324899void func_CCodeGenTests_CArrayOutputs1_f_def0(jmi_array_t* o_a);
    49334900
     
    49364903    JMI_ARR(STACK, jmi_real_t, jmi_array_t, o_an, 2, 1)
    49374904    JMI_ARR(STACK, jmi_real_t, jmi_array_t, temp_1_a, 2, 1)
    4938     jmi_real_t i1_0i;
    4939     jmi_int_t i1_0ie;
    4940     jmi_int_t i1_0in;
    49414905    if (o_a == NULL) {
    49424906        JMI_ARRAY_INIT_1(STACK, jmi_real_t, jmi_array_t, o_an, 2, 1, 2)
     
    49464910    jmi_array_ref_1(temp_1_a, 1) = 1;
    49474911    jmi_array_ref_1(temp_1_a, 2) = 2;
    4948     i1_0in = 0;
    4949     i1_0ie = floor((2) - (1));
    4950     for (i1_0i = 1; i1_0in <= i1_0ie; i1_0i = 1 + (++i1_0in)) {
    4951         jmi_array_ref_1(o_a, i1_0i) = jmi_array_val_1(temp_1_a, i1_0i);
    4952     }
     4912    JMI_ASG(GEN_ARR, o_a, temp_1_a)
    49534913    JMI_DYNAMIC_FREE()
    49544914    return;
     
    49954955    JMI_ARR(STACK, jmi_real_t, jmi_array_t, o_an, 2, 1)
    49964956    JMI_ARR(STACK, jmi_real_t, jmi_array_t, temp_1_a, 2, 1)
    4997     jmi_real_t i1_0i;
    4998     jmi_int_t i1_0ie;
    4999     jmi_int_t i1_0in;
    50004957    if (o_a == NULL) {
    50014958        JMI_ARRAY_INIT_1(STACK, jmi_real_t, jmi_array_t, o_an, 2, 1, 2)
     
    50054962    jmi_array_ref_1(temp_1_a, 1) = 1;
    50064963    jmi_array_ref_1(temp_1_a, 2) = 2;
    5007     i1_0in = 0;
    5008     i1_0ie = floor((2) - (1));
    5009     for (i1_0i = 1; i1_0in <= i1_0ie; i1_0i = 1 + (++i1_0in)) {
    5010         jmi_array_ref_1(o_a, i1_0i) = jmi_array_val_1(temp_1_a, i1_0i);
    5011     }
     4964    JMI_ASG(GEN_ARR, o_a, temp_1_a)
    50124965    JMI_DYNAMIC_FREE()
    50134966    return;
     
    50985051    JMI_ARR(STACK, jmi_real_t, jmi_array_t, o_an, 2, 1)
    50995052    JMI_ARR(STACK, jmi_real_t, jmi_array_t, temp_1_a, 2, 1)
    5100     jmi_real_t i1_1i;
    5101     jmi_int_t i1_1ie;
    5102     jmi_int_t i1_1in;
    51035053    if (o_a == NULL) {
    51045054        JMI_ARRAY_INIT_1(STACK, jmi_real_t, jmi_array_t, o_an, 2, 1, 2)
     
    51085058    jmi_array_ref_1(temp_1_a, 1) = 1;
    51095059    jmi_array_ref_1(temp_1_a, 2) = 2;
    5110     i1_1in = 0;
    5111     i1_1ie = floor((2) - (1));
    5112     for (i1_1i = 1; i1_1in <= i1_1ie; i1_1i = 1 + (++i1_1in)) {
    5113         jmi_array_ref_1(o_a, i1_1i) = jmi_array_val_1(temp_1_a, i1_1i);
    5114     }
     5060    JMI_ASG(GEN_ARR, o_a, temp_1_a)
    51155061    JMI_DYNAMIC_FREE()
    51165062    return;
     
    51405086 Real x = f1();
    51415087
    5142     annotation(__JModelica(UnitTesting(tests={
    5143         CCodeGenTestCase(
    5144             name="CArrayOutputs4",
    5145             description="C code generation: array outputs from functions: function call statement",
    5146             variability_propagation=false,
    5147             inline_functions="none",
    5148             generate_ode=false,
    5149             generate_dae=true,
    5150             template="
     5088annotation(__JModelica(UnitTesting(tests={
     5089    CCodeGenTestCase(
     5090        name="CArrayOutputs4",
     5091        description="C code generation: array outputs from functions: function call statement",
     5092        variability_propagation=false,
     5093        inline_functions="none",
     5094        generate_ode=false,
     5095        generate_dae=true,
     5096        template="
    51515097$C_function_headers$
    51525098$C_functions$
    51535099$C_DAE_equation_residuals$
    51545100",
    5155             generatedCode="
     5101        generatedCode="
    51565102void func_CCodeGenTests_CArrayOutputs4_f1_def0(jmi_real_t* o_o);
    51575103jmi_real_t func_CCodeGenTests_CArrayOutputs4_f1_exp0();
     
    51825128    JMI_DEF(REA, o2_v)
    51835129    JMI_ARR(STACK, jmi_real_t, jmi_array_t, temp_1_a, 2, 1)
    5184     jmi_real_t i1_0i;
    5185     jmi_int_t i1_0ie;
    5186     jmi_int_t i1_0in;
    51875130    if (o1_a == NULL) {
    51885131        JMI_ARRAY_INIT_1(STACK, jmi_real_t, jmi_array_t, o1_an, 2, 1, 2)
     
    51925135    jmi_array_ref_1(temp_1_a, 1) = 1;
    51935136    jmi_array_ref_1(temp_1_a, 2) = 2;
    5194     i1_0in = 0;
    5195     i1_0ie = floor((2) - (1));
    5196     for (i1_0i = 1; i1_0in <= i1_0ie; i1_0i = 1 + (++i1_0in)) {
    5197         jmi_array_ref_1(o1_a, i1_0i) = jmi_array_val_1(temp_1_a, i1_0i);
    5198     }
     5137    JMI_ASG(GEN_ARR, o1_a, temp_1_a)
    51995138    o2_v = 3;
    52005139    JMI_RET(GEN, o2_o, o2_v)
     
    52695208    JMI_ARR(STACK, jmi_real_t, jmi_array_t, o1_an, 2, 1)
    52705209    JMI_DEF(REA, o2_v)
    5271     jmi_real_t i1_0i;
    5272     jmi_int_t i1_0ie;
    5273     jmi_int_t i1_0in;
    52745210    if (o1_a == NULL) {
    52755211        JMI_ARRAY_INIT_1(STACK, jmi_real_t, jmi_array_t, o1_an, 2, 1, 2)
    52765212        o1_a = o1_an;
    52775213    }
    5278     i1_0in = 0;
    5279     i1_0ie = floor((2) - (1));
    5280     for (i1_0i = 1; i1_0in <= i1_0ie; i1_0i = 1 + (++i1_0in)) {
    5281         jmi_array_ref_1(o1_a, i1_0i) = jmi_array_val_1(i_a, i1_0i);
    5282     }
     5214    JMI_ASG(GEN_ARR, o1_a, i_a)
    52835215    o2_v = 3;
    52845216    JMI_RET(GEN, o2_o, o2_v)
     
    54005332    jmi_int_t i3_4ie;
    54015333    jmi_int_t i3_4in;
    5402     jmi_real_t i1_5i;
    5403     jmi_int_t i1_5ie;
    5404     jmi_int_t i1_5in;
    5405     jmi_real_t i2_6i;
    5406     jmi_int_t i2_6ie;
    5407     jmi_int_t i2_6in;
    54085334    if (y_a == NULL) {
    54095335        JMI_ARRAY_INIT_2(HEAP, jmi_real_t, jmi_array_t, y_an, jmi_array_size(x_a, 0) * 2, 2, jmi_array_size(x_a, 0), 2)
     
    54435369        }
    54445370    }
    5445     i1_5in = 0;
    5446     i1_5ie = floor((jmi_array_size(x_a, 0)) - (1));
    5447     for (i1_5i = 1; i1_5in <= i1_5ie; i1_5i = 1 + (++i1_5in)) {
    5448         i2_6in = 0;
    5449         i2_6ie = floor((2) - (1));
    5450         for (i2_6i = 1; i2_6in <= i2_6ie; i2_6i = 1 + (++i2_6in)) {
    5451             jmi_array_ref_2(y_a, i1_5i, i2_6i) = jmi_array_val_2(temp_1_a, i1_5i, i2_6i);
    5452         }
    5453     }
     5371    JMI_ASG(GEN_ARR, y_a, temp_1_a)
    54545372    JMI_DYNAMIC_FREE()
    54555373    return;
     
    55395457    JMI_DYNAMIC_INIT()
    55405458    JMI_ARR(HEAP, jmi_real_t, jmi_array_t, y2_an, -1, 1)
    5541     jmi_real_t i1_1i;
    5542     jmi_int_t i1_1ie;
    5543     jmi_int_t i1_1in;
    55445459    if (y2_a == NULL) {
    55455460        JMI_ARRAY_INIT_1(HEAP, jmi_real_t, jmi_array_t, y2_an, jmi_array_size(x2_a, 0), 1, jmi_array_size(x2_a, 0))
    55465461        y2_a = y2_an;
    55475462    }
    5548     i1_1in = 0;
    5549     i1_1ie = floor((jmi_array_size(x2_a, 0)) - (1));
    5550     for (i1_1i = 1; i1_1in <= i1_1ie; i1_1i = 1 + (++i1_1in)) {
    5551         jmi_array_ref_1(y2_a, i1_1i) = jmi_array_val_1(x2_a, i1_1i);
    5552     }
     5463    JMI_ASG(GEN_ARR, y2_a, x2_a)
    55535464    JMI_DYNAMIC_FREE()
    55545465    return;
     
    56455556    JMI_ARR(HEAP, jmi_real_t, jmi_array_t, o_an, -1, 1)
    56465557    JMI_DEF(REA, dummy_v)
    5647     jmi_real_t i1_3i;
    5648     jmi_int_t i1_3ie;
    5649     jmi_int_t i1_3in;
    56505558    if (o_a == NULL) {
    56515559        JMI_ARRAY_INIT_1(HEAP, jmi_real_t, jmi_array_t, o_an, jmi_array_size(i_a, 0), 1, jmi_array_size(i_a, 0))
     
    56535561    }
    56545562    dummy_v = 1;
    5655     i1_3in = 0;
    5656     i1_3ie = floor((jmi_array_size(i_a, 0)) - (1));
    5657     for (i1_3i = 1; i1_3in <= i1_3ie; i1_3i = 1 + (++i1_3in)) {
    5658         jmi_array_ref_1(o_a, i1_3i) = jmi_array_val_1(i_a, i1_3i);
    5659     }
     5563    JMI_ASG(GEN_ARR, o_a, i_a)
    56605564    JMI_RET(GEN, dummy_o, dummy_v)
    56615565    JMI_DYNAMIC_FREE()
     
    60575961    jmi_int_t i1_0ie;
    60585962    jmi_int_t i1_0in;
    6059     jmi_real_t i1_1i;
    6060     jmi_int_t i1_1ie;
    6061     jmi_int_t i1_1in;
    60625963    if (ba_a == NULL) {
    60635964        JMI_ARRAY_INIT_1(HEAP, jmi_real_t, jmi_array_t, ba_an, n_v, 1, n_v)
     
    60735974        jmi_array_ref_1(ba_a, i1_0i) = 1;
    60745975    }
    6075     i1_1in = 0;
    6076     i1_1ie = floor((jmi_array_size(ba_a, 0)) - (1));
    6077     for (i1_1i = 1; i1_1in <= i1_1ie; i1_1i = 1 + (++i1_1in)) {
    6078         jmi_array_ref_1(ab_a, i1_1i) = jmi_array_val_1(ba_a, i1_1i);
    6079     }
     5976    JMI_ASG(GEN_ARR, ab_a, ba_a)
    60805977    JMI_DYNAMIC_FREE()
    60815978    return;
     
    65606457    JMI_ARR(STACK, jmi_real_t, jmi_array_t, tmp_1, 2, 1)
    65616458    JMI_ARR(STACK, jmi_real_t, jmi_array_t, temp_1_a, 2, 1)
    6562     jmi_real_t i1_0i;
    6563     jmi_int_t i1_0ie;
    6564     jmi_int_t i1_0in;
    65656459    JMI_ARRAY_INIT_1(STACK, jmi_real_t, jmi_array_t, tmp_1, 2, 1, 2)
    65666460    x_v->a = tmp_1;
     
    65686462    jmi_array_ref_1(temp_1_a, 1) = 1;
    65696463    jmi_array_ref_1(temp_1_a, 2) = 2;
    6570     i1_0in = 0;
    6571     i1_0ie = floor((2) - (1));
    6572     for (i1_0i = 1; i1_0in <= i1_0ie; i1_0i = 1 + (++i1_0in)) {
    6573         jmi_array_ref_1(x_v->a, i1_0i) = jmi_array_val_1(temp_1_a, i1_0i);
    6574     }
     6464    JMI_ASG(GEN_ARR, x_v->a, temp_1_a)
    65756465    o_v = jmi_array_val_1(x_v->a, 1);
    65766466    JMI_RET(GEN, o_o, o_v)
     
    66476537    jmi_array_rec_1(temp_2_a, 2)->c = 3;
    66486538    jmi_array_rec_1(temp_1_a, 1)->a = 1;
    6649     jmi_array_rec_1(temp_1_a, 1)->b = temp_2_a;
     6539    JMI_ASG(REF, jmi_array_rec_1(temp_1_a, 1)->b, temp_2_a)
    66506540    JMI_ARRAY_INIT_1(STACK, B_0_r, B_0_ra, temp_3_a, 2, 1, 2)
    66516541    jmi_array_rec_1(temp_3_a, 1)->c = 5;
    66526542    jmi_array_rec_1(temp_3_a, 2)->c = 6;
    66536543    jmi_array_rec_1(temp_1_a, 2)->a = 4;
    6654     jmi_array_rec_1(temp_1_a, 2)->b = temp_3_a;
     6544    JMI_ASG(REF, jmi_array_rec_1(temp_1_a, 2)->b, temp_3_a)
    66556545    JMI_ARRAY_INIT_1(STACK, B_0_r, B_0_ra, temp_4_a, 2, 1, 2)
    66566546    jmi_array_rec_1(temp_4_a, 1)->c = 8;
    66576547    jmi_array_rec_1(temp_4_a, 2)->c = 9;
    66586548    jmi_array_rec_1(temp_1_a, 3)->a = 7;
    6659     jmi_array_rec_1(temp_1_a, 3)->b = temp_4_a;
     6549    JMI_ASG(REF, jmi_array_rec_1(temp_1_a, 3)->b, temp_4_a)
    66606550    i1_0in = 0;
    66616551    i1_0ie = floor((3) - (1));
     
    68046694 A x = f();
    68056695
    6806     annotation(__JModelica(UnitTesting(tests={
    6807         CCodeGenTestCase(
    6808             name="CRecordDecl11",
    6809             description="C code generation for records: outputs: array in record",
    6810             variability_propagation=false,
    6811             inline_functions="none",
    6812             generate_ode=false,
    6813             generate_dae=true,
    6814             template="
     6696annotation(__JModelica(UnitTesting(tests={
     6697    CCodeGenTestCase(
     6698        name="CRecordDecl11",
     6699        description="C code generation for records: outputs: array in record",
     6700        variability_propagation=false,
     6701        inline_functions="none",
     6702        generate_ode=false,
     6703        generate_dae=true,
     6704        template="
    68156705$C_function_headers$
    68166706$C_functions$
    68176707$C_DAE_equation_residuals$
    68186708",
    6819             generatedCode="
     6709        generatedCode="
    68206710void func_CCodeGenTests_CRecordDecl11_f_def0(A_0_r* x_v);
    68216711
     
    68256715    JMI_ARR(STACK, jmi_real_t, jmi_array_t, tmp_1, 2, 1)
    68266716    JMI_ARR(STACK, jmi_real_t, jmi_array_t, temp_1_a, 2, 1)
    6827     jmi_real_t i1_0i;
    6828     jmi_int_t i1_0ie;
    6829     jmi_int_t i1_0in;
    68306717    if (x_v == NULL) {
    68316718        JMI_ARRAY_INIT_1(STACK, jmi_real_t, jmi_array_t, tmp_1, 2, 1, 2)
     
    68366723    jmi_array_ref_1(temp_1_a, 1) = 1;
    68376724    jmi_array_ref_1(temp_1_a, 2) = 2;
    6838     i1_0in = 0;
    6839     i1_0ie = floor((2) - (1));
    6840     for (i1_0i = 1; i1_0in <= i1_0ie; i1_0i = 1 + (++i1_0in)) {
    6841         jmi_array_ref_1(x_v->a, i1_0i) = jmi_array_val_1(temp_1_a, i1_0i);
    6842     }
     6725    JMI_ASG(GEN_ARR, x_v->a, temp_1_a)
    68436726    JMI_DYNAMIC_FREE()
    68446727    return;
     
    68746757 A x[3] = f();
    68756758
    6876     annotation(__JModelica(UnitTesting(tests={
    6877         CCodeGenTestCase(
    6878             name="CRecordDecl12",
    6879             description="C code generation for records: outputs: array of records",
    6880             variability_propagation=false,
    6881             inline_functions="none",
    6882             generate_ode=false,
    6883             generate_dae=true,
    6884             template="
     6759annotation(__JModelica(UnitTesting(tests={
     6760    CCodeGenTestCase(
     6761        name="CRecordDecl12",
     6762        description="C code generation for records: outputs: array of records",
     6763        variability_propagation=false,
     6764        inline_functions="none",
     6765        generate_ode=false,
     6766        generate_dae=true,
     6767        template="
    68856768$C_function_headers$
    68866769$C_functions$
    68876770$C_DAE_equation_residuals$
    68886771",
    6889             generatedCode="
     6772        generatedCode="
    68906773void func_CCodeGenTests_CRecordDecl12_f_def0(A_1_ra* x_a);
    68916774
     
    69216804    jmi_array_rec_1(temp_2_a, 2)->c = 3;
    69226805    jmi_array_rec_1(temp_1_a, 1)->a = 1;
    6923     jmi_array_rec_1(temp_1_a, 1)->b = temp_2_a;
     6806    JMI_ASG(REF, jmi_array_rec_1(temp_1_a, 1)->b, temp_2_a)
    69246807    JMI_ARRAY_INIT_1(STACK, B_0_r, B_0_ra, temp_3_a, 2, 1, 2)
    69256808    jmi_array_rec_1(temp_3_a, 1)->c = 5;
    69266809    jmi_array_rec_1(temp_3_a, 2)->c = 6;
    69276810    jmi_array_rec_1(temp_1_a, 2)->a = 4;
    6928     jmi_array_rec_1(temp_1_a, 2)->b = temp_3_a;
     6811    JMI_ASG(REF, jmi_array_rec_1(temp_1_a, 2)->b, temp_3_a)
    69296812    JMI_ARRAY_INIT_1(STACK, B_0_r, B_0_ra, temp_4_a, 2, 1, 2)
    69306813    jmi_array_rec_1(temp_4_a, 1)->c = 8;
    69316814    jmi_array_rec_1(temp_4_a, 2)->c = 9;
    69326815    jmi_array_rec_1(temp_1_a, 3)->a = 7;
    6933     jmi_array_rec_1(temp_1_a, 3)->b = temp_4_a;
     6816    JMI_ASG(REF, jmi_array_rec_1(temp_1_a, 3)->b, temp_4_a)
    69346817    i1_0in = 0;
    69356818    i1_0ie = floor((3) - (1));
     
    1382413707    JMI_DEF(INT, ldb_v)
    1382513708    JMI_ARR(HEAP, jmi_real_t, jmi_array_t, ipiv_a, -1, 1)
    13826     jmi_real_t i1_0i;
    13827     jmi_int_t i1_0ie;
    13828     jmi_int_t i1_0in;
    13829     jmi_real_t i1_1i;
    13830     jmi_int_t i1_1ie;
    13831     jmi_int_t i1_1in;
    13832     jmi_real_t i2_2i;
    13833     jmi_int_t i2_2ie;
    13834     jmi_int_t i2_2in;
    1383513709    JMI_DEF(INT_EXT, tmp_1)
    1383613710    JMI_ARR(HEAP, jmi_real_t, jmi_array_t, tmp_2, -1, 2)
     
    1384413718        x_a = x_an;
    1384513719    }
    13846     i1_0in = 0;
    13847     i1_0ie = floor((jmi_array_size(A_a, 0)) - (1));
    13848     for (i1_0i = 1; i1_0in <= i1_0ie; i1_0i = 1 + (++i1_0in)) {
    13849         jmi_array_ref_1(x_a, i1_0i) = jmi_array_val_1(b_a, i1_0i);
    13850     }
     13720    JMI_ASG(GEN_ARR, x_a, b_a)
    1385113721    JMI_ARRAY_INIT_2(HEAP, jmi_real_t, jmi_array_t, Awork_a, jmi_array_size(A_a, 0) * jmi_array_size(A_a, 0), 2, jmi_array_size(A_a, 0), jmi_array_size(A_a, 0))
    13852     i1_1in = 0;
    13853     i1_1ie = floor((jmi_array_size(A_a, 0)) - (1));
    13854     for (i1_1i = 1; i1_1in <= i1_1ie; i1_1i = 1 + (++i1_1in)) {
    13855         i2_2in = 0;
    13856         i2_2ie = floor((jmi_array_size(A_a, 0)) - (1));
    13857         for (i2_2i = 1; i2_2in <= i2_2ie; i2_2i = 1 + (++i2_2in)) {
    13858             jmi_array_ref_2(Awork_a, i1_1i, i2_2i) = jmi_array_val_2(A_a, i1_1i, i2_2i);
    13859         }
    13860     }
     13722    JMI_ASG(GEN_ARR, Awork_a, A_a)
    1386113723    lda_v = JMI_MAX_EQUATION(1.0, jmi_array_size(A_a, 0));
    1386213724    ldb_v = JMI_MAX_EQUATION(1.0, jmi_array_size(b_a, 0));
     
    1392613788    JMI_DEF(INT, ldb_v)
    1392713789    JMI_ARR(HEAP, jmi_real_t, jmi_array_t, ipiv_a, -1, 1)
    13928     jmi_real_t i1_0i;
    13929     jmi_int_t i1_0ie;
    13930     jmi_int_t i1_0in;
    13931     jmi_real_t i2_1i;
    13932     jmi_int_t i2_1ie;
    13933     jmi_int_t i2_1in;
    13934     jmi_real_t i1_2i;
    13935     jmi_int_t i1_2ie;
    13936     jmi_int_t i1_2in;
    13937     jmi_real_t i2_3i;
    13938     jmi_int_t i2_3ie;
    13939     jmi_int_t i2_3in;
    1394013790    JMI_ARR(HEAP, jmi_real_t, jmi_array_t, tmp_1, -1, 2)
    1394113791    JMI_DEF(INT_EXT, tmp_2)
     
    1394913799        X_a = X_an;
    1395013800    }
    13951     i1_0in = 0;
    13952     i1_0ie = floor((jmi_array_size(A_a, 0)) - (1));
    13953     for (i1_0i = 1; i1_0in <= i1_0ie; i1_0i = 1 + (++i1_0in)) {
    13954         i2_1in = 0;
    13955         i2_1ie = floor((jmi_array_size(B_a, 1)) - (1));
    13956         for (i2_1i = 1; i2_1in <= i2_1ie; i2_1i = 1 + (++i2_1in)) {
    13957             jmi_array_ref_2(X_a, i1_0i, i2_1i) = jmi_array_val_2(B_a, i1_0i, i2_1i);
    13958         }
    13959     }
     13801    JMI_ASG(GEN_ARR, X_a, B_a)
    1396013802    JMI_ARRAY_INIT_2(HEAP, jmi_real_t, jmi_array_t, Awork_a, jmi_array_size(A_a, 0) * jmi_array_size(A_a, 0), 2, jmi_array_size(A_a, 0), jmi_array_size(A_a, 0))
    13961     i1_2in = 0;
    13962     i1_2ie = floor((jmi_array_size(A_a, 0)) - (1));
    13963     for (i1_2i = 1; i1_2in <= i1_2ie; i1_2i = 1 + (++i1_2in)) {
    13964         i2_3in = 0;
    13965         i2_3ie = floor((jmi_array_size(A_a, 0)) - (1));
    13966         for (i2_3i = 1; i2_3in <= i2_3ie; i2_3i = 1 + (++i2_3in)) {
    13967             jmi_array_ref_2(Awork_a, i1_2i, i2_3i) = jmi_array_val_2(A_a, i1_2i, i2_3i);
    13968         }
    13969     }
     13803    JMI_ASG(GEN_ARR, Awork_a, A_a)
    1397013804    lda_v = JMI_MAX_EQUATION(1.0, jmi_array_size(A_a, 0));
    1397113805    ldb_v = JMI_MAX_EQUATION(1.0, jmi_array_size(B_a, 0));
     
    1627116105    JMI_ARR(STACK, jmi_string_t, jmi_string_array_t, s_a, 2, 1)
    1627216106    JMI_ARR(STACK, jmi_string_t, jmi_string_array_t, temp_1_a, 2, 1)
    16273     jmi_real_t i1_0i;
    16274     jmi_int_t i1_0ie;
    16275     jmi_int_t i1_0in;
    1627616107    JMI_ARR(STACK, jmi_string_t, jmi_string_array_t, tmp_1, 2, 1)
    1627716108    JMI_ARRAY_INIT_1(STACK, jmi_string_t, jmi_string_array_t, s_a, 2, 1, 2)
     
    1628016111    JMI_ASG(STR, jmi_array_ref_1(temp_1_a, 1), \"str\")
    1628116112    JMI_ASG(STR, jmi_array_ref_1(temp_1_a, 2), \"str\")
    16282     i1_0in = 0;
    16283     i1_0ie = floor((2) - (1));
    16284     for (i1_0i = 1; i1_0in <= i1_0ie; i1_0i = 1 + (++i1_0in)) {
    16285         JMI_ASG(STR, jmi_array_ref_1(s_a, i1_0i), jmi_array_val_1(temp_1_a, i1_0i))
    16286     }
     16113    JMI_ASG(STR_ARR, s_a, temp_1_a)
    1628716114    JMI_ARRAY_INIT_1(STACK, jmi_string_t, jmi_string_array_t, tmp_1, 2, 1, 2)
    1628816115    func_CCodeGenTests_StringOperations10_f1_def1(s_a, tmp_1);
     
    1630116128    JMI_DYNAMIC_INIT()
    1630216129    JMI_ARR(HEAP, jmi_string_t, jmi_string_array_t, o_a, -1, 1)
    16303     jmi_real_t i1_1i;
    16304     jmi_int_t i1_1ie;
    16305     jmi_int_t i1_1in;
    1630616130    JMI_ARRAY_INIT_1(HEAP, jmi_string_t, jmi_string_array_t, o_a, jmi_array_size(s_a, 0), 1, jmi_array_size(s_a, 0))
    16307     i1_1in = 0;
    16308     i1_1ie = floor((jmi_array_size(s_a, 0)) - (1));
    16309     for (i1_1i = 1; i1_1in <= i1_1ie; i1_1i = 1 + (++i1_1in)) {
    16310         JMI_ASG(STR, jmi_array_ref_1(o_a, i1_1i), jmi_array_val_1(s_a, i1_1i))
    16311     }
     16131    JMI_ASG(STR_ARR, o_a, s_a)
    1631216132    JMI_RET(STR_ARR, o_o, o_a)
    1631316133    JMI_DYNAMIC_FREE()
     
    1635516175    jmi_int_t i1_0ie;
    1635616176    jmi_int_t i1_0in;
    16357     jmi_real_t i1_1i;
    16358     jmi_int_t i1_1ie;
    16359     jmi_int_t i1_1in;
    1636016177    JMI_ARR(HEAP, jmi_string_t, jmi_string_array_t, tmp_1, -1, 1)
    1636116178    JMI_ARRAY_INIT_1(HEAP, jmi_string_t, jmi_string_array_t, s_a, n_v, 1, n_v)
     
    1636716184        JMI_ASG(STR, jmi_array_ref_1(temp_1_a, i1_0i), \"str\")
    1636816185    }
    16369     i1_1in = 0;
    16370     i1_1ie = floor((n_v) - (1));
    16371     for (i1_1i = 1; i1_1in <= i1_1ie; i1_1i = 1 + (++i1_1in)) {
    16372         JMI_ASG(STR, jmi_array_ref_1(s_a, i1_1i), jmi_array_val_1(temp_1_a, i1_1i))
    16373     }
     16186    JMI_ASG(STR_ARR, s_a, temp_1_a)
    1637416187    JMI_ARRAY_INIT_1(HEAP, jmi_string_t, jmi_string_array_t, tmp_1, n_v, 1, n_v)
    1637516188    func_CCodeGenTests_StringOperations11_f1_def1(s_a, tmp_1);
     
    1638816201    JMI_DYNAMIC_INIT()
    1638916202    JMI_ARR(HEAP, jmi_string_t, jmi_string_array_t, o_a, -1, 1)
    16390     jmi_real_t i1_2i;
    16391     jmi_int_t i1_2ie;
    16392     jmi_int_t i1_2in;
    1639316203    JMI_ARRAY_INIT_1(HEAP, jmi_string_t, jmi_string_array_t, o_a, jmi_array_size(s_a, 0), 1, jmi_array_size(s_a, 0))
    16394     i1_2in = 0;
    16395     i1_2ie = floor((jmi_array_size(s_a, 0)) - (1));
    16396     for (i1_2i = 1; i1_2in <= i1_2ie; i1_2i = 1 + (++i1_2in)) {
    16397         JMI_ASG(STR, jmi_array_ref_1(o_a, i1_2i), jmi_array_val_1(s_a, i1_2i))
    16398     }
     16204    JMI_ASG(STR_ARR, o_a, s_a)
    1639916205    JMI_RET(STR_ARR, o_o, o_a)
    1640016206    JMI_DYNAMIC_FREE()
  • trunk/Compiler/ModelicaFlatTree/src/jastadd/ConstantEvaluation/ConstantEvaluation.jrag

    r13897 r14204  
    26962696        if (var != null && !var.isUnknown()) {
    26972697            Index i = Index.NULL;
    2698             if (var.ndims() > 0 && hasFArraySubscripts()) {
     2698            /* Slices have been delegated to cevalArray. */
     2699            /* Non-slice arrays do not have subscripts. */
     2700            if (hasFArraySubscripts()) {
    26992701                i = getFArraySubscripts().createIndex(evaluator);
    27002702            }
  • trunk/Compiler/ModelicaFlatTree/test/modelica/EvaluationTests.mo

    r13897 r14204  
    535535    Real y = x;
    536536
    537     annotation(__JModelica(UnitTesting(tests={
    538         FlatteningTestCase(
    539             name="FunctionEval15",
    540             description="",
    541             flatModel="
     537annotation(__JModelica(UnitTesting(tests={
     538    FlatteningTestCase(
     539        name="FunctionEval15",
     540        description="",
     541        flatModel="
    542542fclass EvaluationTests.FunctionEval15
    543543 constant Real x = 50.0;
     
    573573  for i in 1:2 loop
    574574   for j in 1:2 loop
    575     x[i].a[j].b[1:3] := {1, 1, 1};
    576     x[i].b[1:3].a[j] := x[i].a[j].b[1:3];
     575    x[i].a[j].b := {1, 1, 1};
     576    x[i].b[1:3].a[j] := x[i].a[j].b;
    577577   end for;
    578578  end for;
     
    11921192    Real x2[n2] = 1:n2;
    11931193
    1194     annotation(__JModelica(UnitTesting(tests={
    1195         FlatteningTestCase(
    1196             name="FunctionEval33",
    1197             description="Evaluation of function with non-input with binding expression depending on unknown size",
    1198             flatModel="
     1194annotation(__JModelica(UnitTesting(tests={
     1195    FlatteningTestCase(
     1196        name="FunctionEval33",
     1197        description="Evaluation of function with non-input with binding expression depending on unknown size",
     1198        flatModel="
    11991199fclass EvaluationTests.FunctionEval33
    12001200 structural parameter Integer n1 = 3 /* 3 */;
     
    12081208  output Integer y;
    12091209 algorithm
    1210   y := sum(x[:]);
     1210  y := sum(x);
    12111211  return;
    12121212 end EvaluationTests.FunctionEval33.f;
     
    14471447    parameter Real b = F({2,1});
    14481448
    1449     annotation(__JModelica(UnitTesting(tests={
    1450         FlatteningTestCase(
    1451             name="FunctionEval41",
    1452             description="Evaluation of non-slice use",
    1453             flatModel="
     1449annotation(__JModelica(UnitTesting(tests={
     1450    FlatteningTestCase(
     1451        name="FunctionEval41",
     1452        description="Evaluation of non-slice use",
     1453        flatModel="
    14541454fclass EvaluationTests.FunctionEval41
    1455  parameter Real a = EvaluationTests.FunctionEval41.F({1, 2}) /* evaluation error */;
    1456  parameter Real b = EvaluationTests.FunctionEval41.F({2, 1}) /* evaluation error */;
     1455 parameter Real a = EvaluationTests.FunctionEval41.F({1, 2}) /* 2.23606797749979 */;
     1456 parameter Real b = EvaluationTests.FunctionEval41.F({2, 1}) /* 2.23606797749979 */;
    14571457
    14581458public
     
    14611461  output Real o;
    14621462 algorithm
    1463   o := sqrt(i[:] * i[:]);
     1463  o := sqrt(i * i);
    14641464  return;
    14651465 end EvaluationTests.FunctionEval41.F;
     
    15201520    parameter Real[2] a1 = F(p1) + F(p2);
    15211521
    1522     annotation(__JModelica(UnitTesting(tests={
    1523         FlatteningTestCase(
    1524             name="FunctionEval43",
    1525             description="Test array caching bug #5118",
    1526             flatModel="
     1522annotation(__JModelica(UnitTesting(tests={
     1523    FlatteningTestCase(
     1524        name="FunctionEval43",
     1525        description="Test array caching bug #5118",
     1526        flatModel="
    15271527fclass EvaluationTests.FunctionEval43
    15281528 structural parameter Integer p1[2] = {1, 1} /* { 1, 1 } */;
     
    15351535  output Real[:] y;
    15361536 algorithm
    1537   init y as Real[sum(x[:])];
    1538   for i in 1:sum(x[:]) loop
    1539    y[i] := i + sum(x[:]);
     1537  init y as Real[sum(x)];
     1538  for i in 1:sum(x) loop
     1539   y[i] := i + sum(x);
    15401540  end for;
    15411541  return;
     
    29812981    annotation(__JModelica(UnitTesting(tests={
    29822982        TransformCanonicalTestCase(
    2983             name="IfStmt1",
     2983            name="Partial_IfStmt1",
    29842984            description="Partial evaluation of if stmt. All branches known.",
    29852985            inline_functions="none",
     
    29982998 algorithm
    29992999  init y as Real[size(x, 1)];
    3000   for i1 in 1:size(x, 1) loop
    3001    y[i1] := x[i1];
    3002   end for;
     3000  y := x;
    30033001  if x[1] < x[2] then
    30043002   for i1 in 1:size(x, 1) loop
     
    30893087    annotation(__JModelica(UnitTesting(tests={
    30903088        TransformCanonicalTestCase(
    3091             name="IfStmt4",
     3089            name="Partial_IfStmt4",
    30923090            description="Partial evaluation of if stmt. Unknown branch.",
    30933091            inline_functions="none",
     
    31113109   end for;
    31123110  else
    3113    for i1 in 1:size(x, 1) loop
    3114     y[i1] := x[i1];
    3115    end for;
     3111   y := x;
    31163112  end if;
    31173113  return;
     
    31393135    annotation(__JModelica(UnitTesting(tests={
    31403136        TransformCanonicalTestCase(
    3141             name="IfStmt5",
     3137            name="Partial_IfStmt5",
    31423138            description="Partial evaluation of if stmt. Unknown branch.",
    31433139            inline_functions="none",
     
    31563152 algorithm
    31573153  init y as Real[size(x, 1)];
    3158   for i1 in 1:size(x, 1) loop
    3159    y[i1] := x[i1];
    3160   end for;
     3154  y := x;
    31613155  if x[1] < x[2] then
    3162    for i1 in 1:size(x, 1) loop
    3163     y[i1] := x[i1];
    3164    end for;
     3156   y := x;
    31653157  else
    31663158   for i1 in 1:size(x, 1) loop
     
    32293221    annotation(__JModelica(UnitTesting(tests={
    32303222        TransformCanonicalTestCase(
    3231             name="IfStmt7",
     3223            name="Partial_IfStmt7",
    32323224            description="Partial evaluation of if stmt. Partially known array.",
    32333225            inline_functions="none",
     
    32463238 algorithm
    32473239  init y as Real[size(x, 1)];
    3248   for i1 in 1:size(x, 1) loop
    3249    y[i1] := x[i1];
    3250   end for;
     3240  y := x;
    32513241  if x[1] < x[2] then
    32523242   for i1 in 1:size(x, 1) loop
     
    32553245   y[1] := x[1];
    32563246  else
    3257    for i1 in 1:size(x, 1) loop
    3258     y[i1] := x[i1];
    3259    end for;
     3247   y := x;
    32603248   y[2] := 0;
    32613249  end if;
     
    33913379    annotation(__JModelica(UnitTesting(tests={
    33923380        TransformCanonicalTestCase(
    3393             name="IfStmt10",
     3381            name="Partial_IfStmt10",
    33943382            description="Partial evaluation of if stmt. Break.",
    33953383            inline_functions="none",
     
    34103398 algorithm
    34113399  init y as Real[size(x, 1)];
    3412   for i1 in 1:size(x, 1) loop
    3413    y[i1] := x[i1];
    3414   end for;
     3400  y := x;
    34153401  for i in 1:size(x, 1) loop
    34163402   if x[i] > 1 then
     
    34873473    annotation(__JModelica(UnitTesting(tests={
    34883474        TransformCanonicalTestCase(
    3489             name="IfStmt12",
     3475            name="Partial_IfStmt12",
    34903476            description="Partial evaluation of if stmt. Assigned in only one branch.",
    34913477            inline_functions="none",
     
    35103496 algorithm
    35113497  init y1 as Real[size(x, 1)];
    3512   for i1 in 1:size(x, 1) loop
    3513    y1[i1] := x[i1];
    3514   end for;
     3498  y1 := x;
    35153499  if x[1] < x[2] then
    35163500   for i1 in 1:size(x, 1) loop
     
    35193503   y2 := 3;
    35203504  else
    3521    for i1 in 1:size(x, 1) loop
    3522     y1[i1] := x[i1];
    3523    end for;
     3505   y1 := x;
    35243506   y1[2] := 0;
    35253507   y3 := 3;
     
    37303712    constant Real[2] y2 = f(y1);
    37313713   
    3732     annotation(__JModelica(UnitTesting(tests={
    3733         FlatteningTestCase(
    3734             name="AssigningCached2",
    3735             description="",
    3736             flatModel="
     3714annotation(__JModelica(UnitTesting(tests={
     3715    FlatteningTestCase(
     3716        name="AssigningCached2",
     3717        description="",
     3718        flatModel="
    37373719fclass EvaluationTests.AssigningCached2
    37383720 constant Real y1[2] = {1, 2};
     
    37453727 algorithm
    37463728  init y as Real[size(x, 1)];
    3747   y := x[:];
     3729  y := x;
    37483730  y[2] := 3;
    37493731  return;
     
    38133795    constant R y2 = f(y1);
    38143796   
    3815     annotation(__JModelica(UnitTesting(tests={
    3816         FlatteningTestCase(
    3817             name="AssigningCached4",
    3818             description="",
    3819             flatModel="
     3797annotation(__JModelica(UnitTesting(tests={
     3798    FlatteningTestCase(
     3799        name="AssigningCached4",
     3800        description="",
     3801        flatModel="
    38203802fclass EvaluationTests.AssigningCached4
    38213803 constant Real y1[3] = {1, 2, 3};
     
    38303812  assert(3 == size(x, 1), \"Mismatching sizes in function 'EvaluationTests.AssigningCached4.f', component 'x', dimension '1'\");
    38313813  init t as Real[3];
    3832   t[1:3] := x[1:3];
     3814  t := x;
    38333815  y1 := EvaluationTests.AssigningCached4.R(t);
    38343816  t[1] := 0;
     
    39403922    Real[integer(n)] x = 1:size(x,1);
    39413923
    3942     annotation(__JModelica(UnitTesting(tests={
    3943         FlatteningTestCase(
    3944             name="ParameterMinMax5",
    3945             description="Constricting evaluation of parameters without binding expression to min-max range",
    3946             flatModel="
     3924annotation(__JModelica(UnitTesting(tests={
     3925    FlatteningTestCase(
     3926        name="ParameterMinMax5",
     3927        description="Constricting evaluation of parameters without binding expression to min-max range",
     3928        flatModel="
    39473929fclass EvaluationTests.ParameterMinMax5
    39483930 structural parameter Real n = 1.2 /* 1.2 */;
     
    39573939    Real[integer(-n)] x = 1:size(x,1);
    39583940
    3959     annotation(__JModelica(UnitTesting(tests={
    3960         FlatteningTestCase(
    3961             name="ParameterMinMax6",
    3962             description="Constricting evaluation of parameters without binding expression to min-max range",
    3963             flatModel="
     3941annotation(__JModelica(UnitTesting(tests={
     3942    FlatteningTestCase(
     3943        name="ParameterMinMax6",
     3944        description="Constricting evaluation of parameters without binding expression to min-max range",
     3945        flatModel="
    39643946fclass EvaluationTests.ParameterMinMax6
    39653947 structural parameter Real n = -1.2 /* -1.2 */;
     
    39763958    Real[Integer(n)] x = 1:size(x,1);
    39773959
    3978     annotation(__JModelica(UnitTesting(tests={
    3979         FlatteningTestCase(
    3980             name="ParameterMinMax7",
    3981             description="Constricting evaluation of parameters without binding expression to min-max range",
    3982             flatModel="
     3960annotation(__JModelica(UnitTesting(tests={
     3961    FlatteningTestCase(
     3962        name="ParameterMinMax7",
     3963        description="Constricting evaluation of parameters without binding expression to min-max range",
     3964        flatModel="
    39833965fclass EvaluationTests.ParameterMinMax7
    39843966 structural parameter EvaluationTests.ParameterMinMax7.B n = EvaluationTests.ParameterMinMax7.A.d /* EvaluationTests.ParameterMinMax7.A.d */;
     
    40013983    Real[Integer(n)] x = 1:size(x,1);
    40023984
    4003     annotation(__JModelica(UnitTesting(tests={
    4004         FlatteningTestCase(
    4005             name="ParameterMinMax8",
    4006             description="Constricting evaluation of parameters without binding expression to min-max range",
    4007             flatModel="
     3985annotation(__JModelica(UnitTesting(tests={
     3986    FlatteningTestCase(
     3987        name="ParameterMinMax8",
     3988        description="Constricting evaluation of parameters without binding expression to min-max range",
     3989        flatModel="
    40083990fclass EvaluationTests.ParameterMinMax8
    40093991 structural parameter EvaluationTests.ParameterMinMax8.B n = EvaluationTests.ParameterMinMax8.A.b /* EvaluationTests.ParameterMinMax8.A.b */;
  • trunk/Compiler/ModelicaFrontEnd/src/jastadd/flattening/Flattening.jrag

    r14123 r14204  
    928928            FAssignableExp left = setLocationOf(new FAccessExp(expandedFAccessCalc()));
    929929            FStatement stmt;
    930             if (scalarizedAsFFunctionCallStmt()) {
     930            if (flattenAsFFunctionCallStmt()) {
    931931                List<FFunctionCallLeft> lefts = new List<FFunctionCallLeft>();
    932932                lefts.add(new FFunctionCallLeft(new Opt<FExp>(left)));
  • trunk/Compiler/ModelicaFrontEnd/src/jastadd/flattening/FlatteningAccess.jrag

    r13103 r14204  
    159159   
    160160    inh boolean InstAccess.flattenFASContext();
    161     inh boolean FExp.flattenFASContext();
    162161    eq BaseNode.getChild().flattenFASContext()             = true;
    163162    eq FUnknownSizeExp.getFExp().flattenFASContext()       = false;
    164163    eq FExternalStmt.getChild().flattenFASContext()        = false;
    165164    eq InstDot.getInstAccess(int i).flattenFASContext()    = i != getNumInstAccess() - 1 || flattenFASContext();
    166     eq FIfExp.getChild().flattenFASContext()               = flattenFASContext();
    167     eq CommonAccessExp.getChild().flattenFASContext()            = flattenFASContext() || isSlice();
    168    
    169     eq InstFunctionArgument.getChild().flattenFASContext() = !inFunction();
    170     eq FFunctionCallLeft.getFExp().flattenFASContext()     = !inFunction();
    171     eq InstForIndex.getChild().flattenFASContext()         = !inFunction();
    172     eq FSizeExp.getFExp().flattenFASContext()              = !getFExp().isCircular() && !inFunction();
    173     eq FAssignStmt.getLeft().flattenFASContext()           = !scalarizedAsFFunctionCallStmt();
     165    eq CommonAccessExp.getChild().flattenFASContext()      = isSlice() || !inFunction();
    174166
    175167}
  • trunk/Compiler/ModelicaFrontEnd/src/jastadd/flattening/FlatteningStatements.jrag

    r13456 r14204  
    6666    public boolean FAssignStmt.flatten(Flattener f, List<FStatement> sl) {
    6767        addForIndexRangeAsserts(f, sl);
    68         if (scalarizedAsFFunctionCallStmt()) {
     68        if (flattenAsFFunctionCallStmt()) {
    6969            List<FFunctionCallLeft> lefts = new List<FFunctionCallLeft>();
    7070            lefts.add(new FFunctionCallLeft(new Opt<FExp>(getLeft().flatten(f))));
     
    7676    }
    7777
    78     syn boolean FAssignStmt.scalarizedAsFFunctionCallStmt() =
     78    syn boolean FAssignStmt.flattenAsFFunctionCallStmt() =
    7979            getRight().isNonVectorizedFunctionCall() && getLeft().type().isComposite() &&
    8080            inFunction() && !getLeft().isSlice();
    81     syn boolean InstAssignable.scalarizedAsFFunctionCallStmt() =
     81    syn boolean InstAssignable.flattenAsFFunctionCallStmt() =
    8282            getBindingFExp().isNonVectorizedFunctionCall() && type().isComposite();
    8383   
  • trunk/Compiler/ModelicaFrontEnd/src/java/org/jmodelica/util/streams/NotNullCodeStream.java

    r12940 r14204  
    3535    @Override
    3636    public void print(String s) {
    37         if (s == null)
     37        if (s == null) {
    3838            throw new NullPointerException();
     39        }
    3940        super.print(s);
    4041    }
     
    4243    @Override
    4344    public void print(Object o) {
    44         if (o == null)
     45        if (o == null) {
    4546            throw new NullPointerException();
     47        }
    4648        super.print(o);
    4749    }
     
    4951    @Override
    5052    public void format(String format, Object... args) {
    51         for (Object obj : args)
    52             if (obj == null)
     53        for (Object obj : args) {
     54            if (obj == null) {
    5355                throw new NullPointerException();
     56            }
     57        }
    5458        super.format(format, args);
    5559    }
  • trunk/Compiler/ModelicaFrontEnd/test/modelica/ArrayBuiltins.mo

    r12553 r14204  
    217217    A[2] y = fill(A(1), size(y, 1));
    218218
    219     annotation(__JModelica(UnitTesting(tests={
    220         FlatteningTestCase(
    221             name="Size_SizeExp12",
    222             description="Size operator: array of records",
    223             flatModel="
     219annotation(__JModelica(UnitTesting(tests={
     220    FlatteningTestCase(
     221        name="Size_SizeExp12",
     222        description="Size operator: array of records",
     223        flatModel="
    224224fclass ArrayBuiltins.Size.SizeExp12
    225225 ArrayBuiltins.Size.SizeExp12.A y[2] = fill(ArrayBuiltins.Size.SizeExp12.A(1), size(y[1:2], 1));
     
    243243    parameter Integer p4 = 1;
    244244
    245     annotation(__JModelica(UnitTesting(tests={
    246         FlatteningTestCase(
    247             name="Size_SizeStructural1",
    248             description="Using parameter as first arg of size() expression that is used as structural parameter should not make that parameter a structural parameter",
    249             flatModel="
     245annotation(__JModelica(UnitTesting(tests={
     246    FlatteningTestCase(
     247        name="Size_SizeStructural1",
     248        description="Using parameter as first arg of size() expression that is used as structural parameter should not make that parameter a structural parameter",
     249        flatModel="
    250250fclass ArrayBuiltins.Size.SizeStructural1
    251251 Real x[1,1];
     
    14671467    Real[2,3] x = f({{1,3},{5,7},{9,11}});
    14681468
    1469     annotation(__JModelica(UnitTesting(tests={
    1470         TransformCanonicalTestCase(
    1471             name="Transpose_Transpose11",
    1472             description="Scalarization of transpose operator: unknown size",
    1473             inline_functions="none",
    1474             variability_propagation=false,
    1475             flatModel="
     1469annotation(__JModelica(UnitTesting(tests={
     1470    TransformCanonicalTestCase(
     1471        name="Transpose_Transpose11",
     1472        description="Scalarization of transpose operator: unknown size",
     1473        inline_functions="none",
     1474        variability_propagation=false,
     1475        flatModel="
    14761476fclass ArrayBuiltins.Transpose.Transpose11
    14771477 Real x[1,1];
     
    15021502   end for;
    15031503  end for;
    1504   for i1 in 1:size(a, 2) loop
    1505    for i2 in 1:size(a, 1) loop
    1506     b[i1,i2] := temp_1[i1,i2];
    1507    end for;
    1508   end for;
     1504  b := temp_1;
    15091505  return;
    15101506 end ArrayBuiltins.Transpose.Transpose11.f;
     
    22262222    A a3[5](x = 1:5) = cat(1, a1, a2);
    22272223
    2228     annotation(__JModelica(UnitTesting(tests={
    2229         FlatteningTestCase(
    2230             name="Cat_ArrayCat11",
    2231             description="",
    2232             flatModel="
     2224annotation(__JModelica(UnitTesting(tests={
     2225    FlatteningTestCase(
     2226        name="Cat_ArrayCat11",
     2227        description="",
     2228        flatModel="
    22332229fclass ArrayBuiltins.Cat.ArrayCat11
    22342230 ArrayBuiltins.Cat.ArrayCat11.A a1[2];
     
    22592255    Real[:] d = f({time,time});
    22602256
    2261     annotation(__JModelica(UnitTesting(tests={
    2262         TransformCanonicalTestCase(
    2263             name="Cat_ArrayCat12",
    2264             description="Single argument cat",
    2265             eliminate_linear_equations=false,
    2266             flatModel="
     2257annotation(__JModelica(UnitTesting(tests={
     2258    TransformCanonicalTestCase(
     2259        name="Cat_ArrayCat12",
     2260        description="Single argument cat",
     2261        eliminate_linear_equations=false,
     2262        flatModel="
    22672263fclass ArrayBuiltins.Cat.ArrayCat12
    22682264 constant Real k[1] = 1;
     
    22882284   temp_1[i1] := x[i1];
    22892285  end for;
    2290   for i1 in 1:size(x, 1) loop
    2291    y[i1] := temp_1[i1];
    2292   end for;
     2286  y := temp_1;
    22932287  return;
    22942288 annotation(Inline = false);
     
    28882882    parameter Real p3[1] = {2};
    28892883
    2890     annotation(__JModelica(UnitTesting(tests={
    2891         FlatteningTestCase(
    2892             name="NdimsStructural1",
    2893             description="Using parameter in ndims() expression that is used as structural parameter should not make that parameter a structural parameter",
    2894             flatModel="
     2884annotation(__JModelica(UnitTesting(tests={
     2885    FlatteningTestCase(
     2886        name="NdimsStructural1",
     2887        description="Using parameter in ndims() expression that is used as structural parameter should not make that parameter a structural parameter",
     2888        flatModel="
    28952889fclass ArrayBuiltins.NdimsStructural1
    28962890 Real x[1,1];
  • trunk/Compiler/ModelicaFrontEnd/test/modelica/ArrayTests.mo

    r13103 r14204  
    66906690   temp_1[i1] := i1 ^ 2;
    66916691  end for;
    6692   for i1 in 1:max(integer(a / 2), 0) loop
    6693    x[i1] := temp_1[i1];
    6694   end for;
     6692  x := temp_1;
    66956693  return;
    66966694 annotation(Inline = false);
     
    67406738   temp_1[i1] := (2 + (i1 - 1) * 0.5) ^ 2;
    67416739  end for;
    6742   for i1 in 1:max(integer((a / 2 - 2) / 0.5) + 1, 0) loop
    6743    x1[i1] := temp_1[i1];
    6744   end for;
     6740  x1 := temp_1;
    67456741  init x2 as Real[max(integer((a / 2 - 2) / 0.5) + 1, 0)];
    67466742  init temp_2 as Integer[max(integer((a / 2 - 2) / 0.5) + 1, 0)];
     
    67486744   temp_2[i1] := 2 + (i1 - 1) * 0.5;
    67496745  end for;
    6750   for i1 in 1:max(integer((a / 2 - 2) / 0.5) + 1, 0) loop
    6751    x2[i1] := temp_2[i1];
    6752   end for;
     6746  x2 := temp_2;
    67536747  init x3 as Real[max(integer((a / 2 - 2) / 0.5) + 1, 0)];
    67546748  for i1 in 1:max(integer((a / 2 - 2) / 0.5) + 1, 0) loop
     
    72757269    x = { (i + j) * y[i, j] for j, i };
    72767270
    7277     annotation(__JModelica(UnitTesting(tests={
    7278         FlatteningTestCase(
    7279             name="For_ForNoRange10",
    7280             description="",
    7281             flatModel="
     7271annotation(__JModelica(UnitTesting(tests={
     7272    FlatteningTestCase(
     7273        name="For_ForNoRange10",
     7274        description="",
     7275        flatModel="
    72827276fclass ArrayTests.For.ForNoRange10
    72837277 structural parameter Integer m = 2 /* 2 */;
     
    74507444    x[3] = x[1] + x[2];
    74517445
    7452     annotation(__JModelica(UnitTesting(tests={
    7453         FlatteningTestCase(
    7454             name="For_ForNoRange17",
    7455             description="",
    7456             flatModel="
     7446annotation(__JModelica(UnitTesting(tests={
     7447    FlatteningTestCase(
     7448        name="For_ForNoRange17",
     7449        description="",
     7450        flatModel="
    74577451fclass ArrayTests.For.ForNoRange17
    74587452 Real x[4];
     
    75207514    Real x[2] = f((1:2) * time, (3:4) * time);
    75217515
    7522     annotation(__JModelica(UnitTesting(tests={
    7523         FlatteningTestCase(
    7524             name="For_ForNoRange19",
    7525             description="",
    7526             flatModel="
     7516annotation(__JModelica(UnitTesting(tests={
     7517    FlatteningTestCase(
     7518        name="For_ForNoRange19",
     7519        description="",
     7520        flatModel="
    75277521fclass ArrayTests.For.ForNoRange19
    75287522 Real x[2] = ArrayTests.For.ForNoRange19.f((1:2) * time, (3:4) * time);
     
    75367530  init x as Real[size(y, 1)];
    75377531  assert(size(z, 1) == size(y, 1), \"For index with implicit iteration range used for inconsistent sizes, i used for different sizes in z[i] and y[i]\");
    7538   x[:] := {y[i] + z[i] + 1 for i in 1:size(y, 1)};
     7532  x := {y[i] + z[i] + 1 for i in 1:size(y, 1)};
    75397533  return;
    75407534 end ArrayTests.For.ForNoRange19.f;
     
    76017595    Real x[2] = f(y, y, y);
    76027596
    7603     annotation(__JModelica(UnitTesting(tests={
    7604         FlatteningTestCase(
    7605             name="For_ForNoRange21",
    7606             description="",
    7607             flatModel="
     7597annotation(__JModelica(UnitTesting(tests={
     7598    FlatteningTestCase(
     7599        name="For_ForNoRange21",
     7600        description="",
     7601        flatModel="
    76087602fclass ArrayTests.For.ForNoRange21
    76097603 Real y[2] = (1:2) * time;
     
    77497743    (ae[{5,4,3,2,1}],) = fw();
    77507744
    7751     annotation(__JModelica(UnitTesting(tests={
    7752         TransformCanonicalTestCase(
    7753             name="Slices_SliceTest4",
    7754             description="Slice operations: test with vector indices",
    7755             eliminate_alias_variables=false,
    7756             variability_propagation=false,
    7757             flatModel="
     7745annotation(__JModelica(UnitTesting(tests={
     7746    TransformCanonicalTestCase(
     7747        name="Slices_SliceTest4",
     7748        description="Slice operations: test with vector indices",
     7749        eliminate_alias_variables=false,
     7750        variability_propagation=false,
     7751        flatModel="
    77587752fclass ArrayTests.Slices.SliceTest4
    77597753 Real a[1];
     
    78227816  init o as Real[2];
    78237817  dummy := 1;
    7824   for i1 in 1:2 loop
    7825    o[i1] := i[i1];
    7826   end for;
     7818  o := i;
    78277819  return;
    78287820 end ArrayTests.Slices.SliceTest4.f;
     
    89198911    a[2] = time;
    89208912
    8921     annotation(__JModelica(UnitTesting(tests={
    8922         TransformCanonicalTestCase(
    8923             name="VariableIndex_Slice6",
    8924             description="Using variable index in slice over models, complex example",
    8925             variability_propagation=false,
    8926             flatModel="
     8913annotation(__JModelica(UnitTesting(tests={
     8914    TransformCanonicalTestCase(
     8915        name="VariableIndex_Slice6",
     8916        description="Using variable index in slice over models, complex example",
     8917        variability_propagation=false,
     8918        flatModel="
    89278919fclass ArrayTests.VariableIndex.Slice6
    89288920 Real a[1];
     
    89338925 Real temp_1[1];
    89348926 Real temp_1[2];
    8935 initial equation 
     8927initial equation
    89368928 pre(b[1]) = 0;
    89378929 pre(b[2]) = 0;
     
    89548946  temp_1[1] := x;
    89558947  temp_1[2] := x;
    8956   for i1 in 1:2 loop
    8957    y[i1] := temp_1[i1];
    8958   end for;
     8948  y := temp_1;
    89598949  return;
    89608950 annotation(Inline = false);
     
    90068996    Integer[2] x = {1,2};
    90078997    Integer y = pre(x[i]);
    9008     annotation(__JModelica(UnitTesting(tests={
    9009         FlatteningTestCase(
    9010             name="VariableIndex_Slice8",
    9011             description="Variable index in pre",
    9012             flatModel="
     8998annotation(__JModelica(UnitTesting(tests={
     8999    FlatteningTestCase(
     9000        name="VariableIndex_Slice8",
     9001        description="Variable index in pre",
     9002        flatModel="
    90139003fclass ArrayTests.VariableIndex.Slice8
    90149004 discrete Integer i = integer(time);
     
    90249014    Integer[2] x = {1,2};
    90259015    Integer y = pre(x[c[i]]);
    9026     annotation(__JModelica(UnitTesting(tests={
    9027         FlatteningTestCase(
    9028             name="VariableIndex_Slice9",
    9029             description="Variable index in pre",
    9030             flatModel="
     9016annotation(__JModelica(UnitTesting(tests={
     9017    FlatteningTestCase(
     9018        name="VariableIndex_Slice9",
     9019        description="Variable index in pre",
     9020        flatModel="
    90319021fclass ArrayTests.VariableIndex.Slice9
    90329022 constant Integer c[2] = {1, 2};
     
    90439033    Integer[2] x = {1,2};
    90449034    Integer y = pre(c[x[i]]);
    9045     annotation(__JModelica(UnitTesting(tests={
    9046         FlatteningTestCase(
    9047             name="VariableIndex_Slice10",
    9048             description="Variable index in pre",
    9049             flatModel="
     9035annotation(__JModelica(UnitTesting(tests={
     9036    FlatteningTestCase(
     9037        name="VariableIndex_Slice10",
     9038        description="Variable index in pre",
     9039        flatModel="
    90509040fclass ArrayTests.VariableIndex.Slice10
    90519041 constant Integer c[2] = {1, 2};
     
    92829272    end f;
    92839273    Real[:] y = f(2,1:3);
    9284     annotation(__JModelica(UnitTesting(tests={
    9285         FlatteningTestCase(
    9286             name="Other_ArraySize5",
    9287             description="",
    9288             flatModel="
     9274annotation(__JModelica(UnitTesting(tests={
     9275    FlatteningTestCase(
     9276        name="Other_ArraySize5",
     9277        description="",
     9278        flatModel="
    92899279fclass ArrayTests.Other.ArraySize5
    92909280 Real y[2] = ArrayTests.Other.ArraySize5.f(2, 1:3, (1:3)[1:2]);
     
    92989288 algorithm
    92999289  init z as Real[size(y, 1)];
    9300   z := y[:];
     9290  z := y;
    93019291  return;
    93029292 end ArrayTests.Other.ArraySize5.f;
     
    96799669    Real y = if sum(f(time))>0 then sum(f(time)) else sum(f(time+1));
    96809670   
    9681     annotation(__JModelica(UnitTesting(tests={
    9682         TransformCanonicalTestCase(
    9683             name="IfExprTemp1",
    9684             description="",
    9685             inline_functions="none",
    9686             flatModel="
     9671annotation(__JModelica(UnitTesting(tests={
     9672    TransformCanonicalTestCase(
     9673        name="IfExprTemp1",
     9674        description="",
     9675        inline_functions="none",
     9676        flatModel="
    96879677fclass ArrayTests.IfExprTemp1
    96889678 Real y;
     
    97199709  temp_1[1] := x;
    97209710  temp_1[2] := x + 1;
    9721   for i1 in 1:2 loop
    9722    y[i1] := temp_1[i1];
    9723   end for;
     9711  y := temp_1;
    97249712  return;
    97259713 end ArrayTests.IfExprTemp1.f;
     
    97409728    y := if sum(f(time)) > 0 then sum(f(time)) else sum(f(time + 1));
    97419729
    9742     annotation(__JModelica(UnitTesting(tests={
    9743         TransformCanonicalTestCase(
    9744             name="IfExprTemp2",
    9745             description="",
    9746             inline_functions="none",
    9747             flatModel="
     9730annotation(__JModelica(UnitTesting(tests={
     9731    TransformCanonicalTestCase(
     9732        name="IfExprTemp2",
     9733        description="",
     9734        inline_functions="none",
     9735        flatModel="
    97489736fclass ArrayTests.IfExprTemp2
    97499737 Real y;
     
    97779765  temp_1[1] := x;
    97789766  temp_1[2] := x + 1;
    9779   for i1 in 1:2 loop
    9780    y[i1] := temp_1[i1];
    9781   end for;
     9767  y := temp_1;
    97829768  return;
    97839769 end ArrayTests.IfExprTemp2.f;
     
    98009786      y = if der(x) > x then 1 else if der(x) > x then 1 else sum(f(x));
    98019787   
    9802     annotation(__JModelica(UnitTesting(tests={
    9803         TransformCanonicalTestCase(
    9804             name="IfExprTemp3",
    9805             description="",
    9806             inline_functions="none",
    9807             flatModel="
     9788annotation(__JModelica(UnitTesting(tests={
     9789    TransformCanonicalTestCase(
     9790        name="IfExprTemp3",
     9791        description="",
     9792        inline_functions="none",
     9793        flatModel="
    98089794fclass ArrayTests.IfExprTemp3
    98099795 Real x;
     
    98119797 Real temp_1[1];
    98129798 Real temp_1[2];
    9813 initial equation 
     9799initial equation
    98149800 x = 0.0;
    98159801equation
     
    98339819  temp_1[1] := x;
    98349820  temp_1[2] := x + 1;
    9835   for i1 in 1:2 loop
    9836    y[i1] := temp_1[i1];
    9837   end for;
     9821  y := temp_1;
    98389822  return;
    98399823 end ArrayTests.IfExprTemp3.f;
  • trunk/Compiler/ModelicaFrontEnd/test/modelica/CheckTests.mo

    r13948 r14204  
    15721572        y = {time};
    15731573    end if;
    1574     annotation(__JModelica(UnitTesting(tests={
    1575         FlatteningTestCase(
    1576             name="NegativeFill2",
    1577             description="",
    1578             flatModel="
     1574annotation(__JModelica(UnitTesting(tests={
     1575    FlatteningTestCase(
     1576        name="NegativeFill2",
     1577        description="",
     1578        flatModel="
    15791579fclass CheckTests.NegativeFill2
    15801580 structural parameter Integer n = 2 /* 2 */;
  • trunk/Compiler/ModelicaFrontEnd/test/modelica/ConnectTests.mo

    r13948 r14204  
    11101110    end for;
    11111111
    1112     annotation(__JModelica(UnitTesting(tests={
    1113         FlatteningTestCase(
    1114             name="ConnectTest23",
    1115             description="Connect clauses in if with parameter test",
    1116             flatModel="
     1112annotation(__JModelica(UnitTesting(tests={
     1113    FlatteningTestCase(
     1114        name="ConnectTest23",
     1115        description="Connect clauses in if with parameter test",
     1116        flatModel="
    11171117fclass ConnectTests.ConnectTest23
    11181118 Real x[4];
  • trunk/Compiler/ModelicaFrontEnd/test/modelica/FlatteningAccessGlobal.mo

    r12754 r14204  
    7070    Real[:] y = f();
    7171
    72     annotation(__JModelica(UnitTesting(tests={
    73         FlatteningTestCase(
    74             name="CompositeAccessArray1",
    75             description="Composite constants in functions should be flattened as global variables and uses not folded",
    76             flatModel="
     72annotation(__JModelica(UnitTesting(tests={
     73    FlatteningTestCase(
     74        name="CompositeAccessArray1",
     75        description="Composite constants in functions should be flattened as global variables and uses not folded",
     76        flatModel="
    7777fclass FlatteningAccessGlobal.CompositeAccessArray1
    7878 Real y[3] = FlatteningAccessGlobal.CompositeAccessArray1.f();
     
    8585 algorithm
    8686  init y as Real[3];
    87   y := global(FlatteningAccessGlobal.CompositeAccessArray1.P.is[1:3]);
     87  y := global(FlatteningAccessGlobal.CompositeAccessArray1.P.is);
    8888  return;
    8989 end FlatteningAccessGlobal.CompositeAccessArray1.f;
  • trunk/Compiler/ModelicaFrontEnd/test/modelica/FunctionTests.mo

    r12766 r14204  
    26912691    Real x[:] = f2(e = 2);
    26922692
    2693     annotation(__JModelica(UnitTesting(tests={
    2694         FlatteningTestCase(
    2695             name="FunctionType18",
    2696             description="",
    2697             flatModel="
     2693annotation(__JModelica(UnitTesting(tests={
     2694    FlatteningTestCase(
     2695        name="FunctionType18",
     2696        description="",
     2697        flatModel="
    26982698fclass FunctionTests.FunctionType18
    26992699 Real x[5] = FunctionTests.FunctionType18.f2(2 * 2, 2, 2 * 2 - 1);
     
    27072707 algorithm
    27082708  init g as Real[FunctionTests.FunctionType18.f1(f, e)];
    2709   g[:] := (1:size(g, 1)) .+ d;
     2709  g := (1:size(g, 1)) .+ d;
    27102710  return;
    27112711 end FunctionTests.FunctionType18.f2;
     
    44784478 Real x = f();
    44794479
    4480     annotation(__JModelica(UnitTesting(tests={
    4481         TransformCanonicalTestCase(
    4482             name="ArrayExpInFunc1",
    4483             description="Scalarization of functions: assign from array",
    4484             variability_propagation=false,
    4485             flatModel="
     4480annotation(__JModelica(UnitTesting(tests={
     4481    TransformCanonicalTestCase(
     4482        name="ArrayExpInFunc1",
     4483        description="Scalarization of functions: assign from array",
     4484        variability_propagation=false,
     4485        flatModel="
    44864486fclass FunctionTests.ArrayExpInFunc1
    44874487 Real x;
     
    45014501  temp_1[2] := 2;
    45024502  temp_1[3] := 3;
    4503   for i1 in 1:3 loop
    4504    x[i1] := temp_1[i1];
    4505   end for;
     4503  x := temp_1;
    45064504  return;
    45074505 end FunctionTests.ArrayExpInFunc1.f;
     
    45224520 Real x = f();
    45234521
    4524     annotation(__JModelica(UnitTesting(tests={
    4525         TransformCanonicalTestCase(
    4526             name="ArrayExpInFunc2",
    4527             description="Scalarization of functions: assign from array exp",
    4528             variability_propagation=false,
    4529             flatModel="
     4522annotation(__JModelica(UnitTesting(tests={
     4523    TransformCanonicalTestCase(
     4524        name="ArrayExpInFunc2",
     4525        description="Scalarization of functions: assign from array exp",
     4526        variability_propagation=false,
     4527        flatModel="
    45304528fclass FunctionTests.ArrayExpInFunc2
    45314529 Real x;
     
    45844582   end for;
    45854583  end for;
    4586   for i1 in 1:2 loop
    4587    for i2 in 1:2 loop
    4588     x[i1,i2] := temp_1[i1,i2];
    4589    end for;
    4590   end for;
     4584  x := temp_1;
    45914585  return;
    45924586 end FunctionTests.ArrayExpInFunc2.f;
     
    46574651 Real x = f();
    46584652
    4659     annotation(__JModelica(UnitTesting(tests={
    4660         TransformCanonicalTestCase(
    4661             name="ArrayExpInFunc4",
    4662             description="Scalarization of functions: binding exp to array var",
    4663             variability_propagation=false,
    4664             flatModel="
     4653annotation(__JModelica(UnitTesting(tests={
     4654    TransformCanonicalTestCase(
     4655        name="ArrayExpInFunc4",
     4656        description="Scalarization of functions: binding exp to array var",
     4657        variability_propagation=false,
     4658        flatModel="
    46654659fclass FunctionTests.ArrayExpInFunc4
    46664660 Real x;
     
    47194713   end for;
    47204714  end for;
    4721   for i1 in 1:2 loop
    4722    for i2 in 1:2 loop
    4723     x[i1,i2] := temp_1[i1,i2];
    4724    end for;
    4725   end for;
     4715  x := temp_1;
    47264716  return;
    47274717 end FunctionTests.ArrayExpInFunc4.f;
     
    48234813 Real x = f();
    48244814
    4825     annotation(__JModelica(UnitTesting(tests={
    4826         TransformCanonicalTestCase(
    4827             name="ArrayExpInFunc6",
    4828             description="Scalarization of functions: if statements",
    4829             variability_propagation=false,
    4830             flatModel="
     4815annotation(__JModelica(UnitTesting(tests={
     4816    TransformCanonicalTestCase(
     4817        name="ArrayExpInFunc6",
     4818        description="Scalarization of functions: if statements",
     4819        variability_propagation=false,
     4820        flatModel="
    48314821fclass FunctionTests.ArrayExpInFunc6
    48324822 Real x;
     
    48494839   temp_1[2] := 2;
    48504840   temp_1[3] := 3;
    4851    for i1 in 1:3 loop
    4852     x[i1] := temp_1[i1];
    4853    end for;
     4841   x := temp_1;
    48544842  elseif o < 1.5 then
    48554843   init temp_2 as Integer[3];
     
    48574845   temp_2[2] := 5;
    48584846   temp_2[3] := 6;
    4859    for i1 in 1:3 loop
    4860     x[i1] := temp_2[i1];
    4861    end for;
     4847   x := temp_2;
    48624848  else
    48634849   init temp_3 as Integer[3];
     
    48654851   temp_3[2] := 8;
    48664852   temp_3[3] := 9;
    4867    for i1 in 1:3 loop
    4868     x[i1] := temp_3[i1];
    4869    end for;
     4853   x := temp_3;
    48704854  end if;
    48714855  return;
     
    51395123    r = f2();
    51405124
    5141     annotation(__JModelica(UnitTesting(tests={
    5142         TransformCanonicalTestCase(
    5143             name="ArrayExpInFunc12",
    5144             description="Scalarization of functions: temp in record constructor",
    5145             variability_propagation=false,
    5146             inline_functions="none",
    5147             flatModel="
     5125annotation(__JModelica(UnitTesting(tests={
     5126    TransformCanonicalTestCase(
     5127        name="ArrayExpInFunc12",
     5128        description="Scalarization of functions: temp in record constructor",
     5129        variability_propagation=false,
     5130        inline_functions="none",
     5131        flatModel="
    51485132fclass FunctionTests.ArrayExpInFunc12
    51495133 Real r.x[1];
     
    51595143  init temp_1 as Real[2];
    51605144  (temp_1) := FunctionTests.ArrayExpInFunc12.f1();
    5161   for i1 in 1:2 loop
    5162    b.x[i1] := temp_1[i1];
    5163   end for;
     5145  b.x := temp_1;
    51645146  return;
    51655147 end FunctionTests.ArrayExpInFunc12.f2;
     
    51735155  temp_1[1] := 1;
    51745156  temp_1[2] := 2;
    5175   for i1 in 1:2 loop
    5176    o[i1] := temp_1[i1];
    5177   end for;
     5157  o := temp_1;
    51785158  return;
    51795159 end FunctionTests.ArrayExpInFunc12.f1;
     
    54105390Real[3,3] x = f(1,3,3,{{1,2,3},{4,5,6}});
    54115391
    5412     annotation(__JModelica(UnitTesting(tests={
    5413         TransformCanonicalTestCase(
    5414             name="ArrayExpInFunc17",
    5415             description="Scalarization of functions: unknown size range exp as slice",
    5416             variability_propagation=false,
    5417             inline_functions="none",
    5418             flatModel="
     5392annotation(__JModelica(UnitTesting(tests={
     5393    TransformCanonicalTestCase(
     5394        name="ArrayExpInFunc17",
     5395        description="Scalarization of functions: unknown size range exp as slice",
     5396        variability_propagation=false,
     5397        inline_functions="none",
     5398        flatModel="
    54195399fclass FunctionTests.ArrayExpInFunc17
    54205400 Real x[1,1];
     
    54405420  init y as Real[n, size(x, 2)];
    54415421  for i1 in 1:n loop
    5442    y[i1] := x[is1 + (i1 - 1)];
     5422   for i2 in 1:size(x, 2) loop
     5423    y[i1,i2] := x[is1 + (i1 - 1)];
     5424   end for;
    54435425  end for;
    54445426  return;
     
    54725454    (ae[{3,2,1}],) = fw({1,2,3});
    54735455
    5474     annotation(__JModelica(UnitTesting(tests={
    5475         TransformCanonicalTestCase(
    5476             name="ArrayExpInFunc18",
    5477             description="Scalarization of functions: unknown size slice in function call stmt",
    5478             variability_propagation=false,
    5479             inline_functions="none",
    5480             flatModel="
     5456annotation(__JModelica(UnitTesting(tests={
     5457    TransformCanonicalTestCase(
     5458        name="ArrayExpInFunc18",
     5459        description="Scalarization of functions: unknown size slice in function call stmt",
     5460        variability_propagation=false,
     5461        inline_functions="none",
     5462        flatModel="
    54815463fclass FunctionTests.ArrayExpInFunc18
    54825464 Real ae[1];
     
    55285510  init o as Real[size(i, 1)];
    55295511  dummy := 1;
    5530   for i1 in 1:size(i, 1) loop
    5531    o[i1] := i[i1];
    5532   end for;
     5512  o := i;
    55335513  return;
    55345514 end FunctionTests.ArrayExpInFunc18.f;
     
    55505530Real[2,2,2] ae = f({{1,2},{3,4}},{{1,2},{3,4}});
    55515531
    5552     annotation(__JModelica(UnitTesting(tests={
    5553         TransformCanonicalTestCase(
    5554             name="ArrayExpInFunc19",
    5555             description="Scalarization of functions: unknown size array expression",
    5556             variability_propagation=false,
    5557             inline_functions="none",
    5558             flatModel="
     5532annotation(__JModelica(UnitTesting(tests={
     5533    TransformCanonicalTestCase(
     5534        name="ArrayExpInFunc19",
     5535        description="Scalarization of functions: unknown size array expression",
     5536        variability_propagation=false,
     5537        inline_functions="none",
     5538        flatModel="
    55595539fclass FunctionTests.ArrayExpInFunc19
    55605540 Real ae[1,1,1];
     
    55885568   end for;
    55895569  end for;
    5590   for i1 in 1:2 loop
    5591    for i2 in 1:size(x1, 1) loop
    5592     for i3 in 1:size(x1, 2) loop
    5593      y[i1,i2,i3] := temp_1[i1,i2,i3];
    5594     end for;
    5595    end for;
    5596   end for;
     5570  y := temp_1;
    55975571  return;
    55985572 end FunctionTests.ArrayExpInFunc19.f;
     
    56135587Real[2,4] ae = f({1,2});
    56145588
    5615     annotation(__JModelica(UnitTesting(tests={
    5616         TransformCanonicalTestCase(
    5617             name="ArrayExpInFunc20",
    5618             description="Scalarization of functions: unknown size matrix expression",
    5619             variability_propagation=false,
    5620             inline_functions="none",
    5621             flatModel="
     5589annotation(__JModelica(UnitTesting(tests={
     5590    TransformCanonicalTestCase(
     5591        name="ArrayExpInFunc20",
     5592        description="Scalarization of functions: unknown size matrix expression",
     5593        variability_propagation=false,
     5594        inline_functions="none",
     5595        flatModel="
    56225596fclass FunctionTests.ArrayExpInFunc20
    56235597 Real ae[1,1];
     
    56435617 algorithm
    56445618  init o as Real[2, size(x1, 1) + 2];
    5645   assert(size(x1, 1) + 1 + 1 == 1 + size(x1, 1) + 1, \"Mismatching size in dimension 2 of expression [{x1[:]}, 1, 2; 3, {x1[:]}, 4] in function FunctionTests.ArrayExpInFunc20.f\");
     5619  assert(size(x1, 1) + 1 + 1 == 1 + size(x1, 1) + 1, \"Mismatching size in dimension 2 of expression [{x1}, 1, 2; 3, {x1}, 4] in function FunctionTests.ArrayExpInFunc20.f\");
    56465620  init temp_1 as Real[2, size(x1, 1) + 1 + 1];
    56475621  init temp_2 as Real[1, size(x1, 1) + 1 + 1];
     
    56795653   end for;
    56805654  end for;
    5681   for i1 in 1:2 loop
    5682    for i2 in 1:size(x1, 1) + 2 loop
    5683     o[i1,i2] := temp_1[i1,i2];
    5684    end for;
    5685   end for;
     5655  o := temp_1;
    56865656  return;
    56875657 end FunctionTests.ArrayExpInFunc20.f;
     
    57365706Real[5,3] ae = f({1,2},{{3,4},{5,6}},{{10,11,12}});
    57375707
    5738     annotation(__JModelica(UnitTesting(tests={
    5739         TransformCanonicalTestCase(
    5740             name="ArrayExpInFunc21",
    5741             description="Scalarization of functions: unknown size matrix expression",
    5742             variability_propagation=false,
    5743             inline_functions="none",
    5744             flatModel="
     5708annotation(__JModelica(UnitTesting(tests={
     5709    TransformCanonicalTestCase(
     5710        name="ArrayExpInFunc21",
     5711        description="Scalarization of functions: unknown size matrix expression",
     5712        variability_propagation=false,
     5713        inline_functions="none",
     5714        flatModel="
    57455715fclass FunctionTests.ArrayExpInFunc21
    57465716 Real ae[1,1];
     
    57745744 algorithm
    57755745  init y as Real[size(x1, 1) * 2 + size(x3, 1), size(x2, 2) + 1];
    5776   assert(1 + size(x2, 2) == size(x2, 2) + 1, \"Mismatching size in dimension 2 of expression [x1[:], x2[:,:]; x2[:,:], x1[:]; x3[:,:]] in function FunctionTests.ArrayExpInFunc21.f\");
    5777   assert(1 + size(x2, 2) == size(x3, 2), \"Mismatching size in dimension 2 of expression [x1[:], x2[:,:]; x2[:,:], x1[:]; x3[:,:]] in function FunctionTests.ArrayExpInFunc21.f\");
    5778   assert(size(x1, 1) == size(x2, 1), \"Mismatching size in dimension 1 of expression x1[:], x2[:,:] in function FunctionTests.ArrayExpInFunc21.f\");
    5779   assert(size(x2, 1) == size(x1, 1), \"Mismatching size in dimension 1 of expression x2[:,:], x1[:] in function FunctionTests.ArrayExpInFunc21.f\");
     5746  assert(1 + size(x2, 2) == size(x2, 2) + 1, \"Mismatching size in dimension 2 of expression [x1, x2; x2, x1; x3] in function FunctionTests.ArrayExpInFunc21.f\");
     5747  assert(1 + size(x2, 2) == size(x3, 2), \"Mismatching size in dimension 2 of expression [x1, x2; x2, x1; x3] in function FunctionTests.ArrayExpInFunc21.f\");
     5748  assert(size(x1, 1) == size(x2, 1), \"Mismatching size in dimension 1 of expression x1, x2 in function FunctionTests.ArrayExpInFunc21.f\");
     5749  assert(size(x2, 1) == size(x1, 1), \"Mismatching size in dimension 1 of expression x2, x1 in function FunctionTests.ArrayExpInFunc21.f\");
    57805750  init temp_1 as Real[size(x1, 1) + size(x2, 1) + size(x3, 1), 1 + size(x2, 2)];
    57815751  init temp_2 as Real[size(x1, 1), 1 + size(x2, 2)];
     
    58185788   end for;
    58195789  end for;
    5820   for i1 in 1:size(x1, 1) * 2 + size(x3, 1) loop
    5821    for i2 in 1:size(x2, 2) + 1 loop
    5822     y[i1,i2] := temp_1[i1,i2];
    5823    end for;
    5824   end for;
     5790  y := temp_1;
    58255791  return;
    58265792 end FunctionTests.ArrayExpInFunc21.f;
     
    61436109equation
    61446110
    6145     annotation(__JModelica(UnitTesting(tests={
    6146         TransformCanonicalTestCase(
    6147             name="ArrayExpInFunc27",
    6148             description="Scalarization of functions: unknown size matrix expression",
    6149             variability_propagation=false,
    6150             inline_functions="none",
    6151             flatModel="
     6111annotation(__JModelica(UnitTesting(tests={
     6112    TransformCanonicalTestCase(
     6113        name="ArrayExpInFunc27",
     6114        description="Scalarization of functions: unknown size matrix expression",
     6115        variability_propagation=false,
     6116        inline_functions="none",
     6117        flatModel="
    61526118fclass FunctionTests.ArrayExpInFunc27
    61536119 Real x[1,1];
     
    61846150   end for;
    61856151  end for;
    6186   for i1 in 1:size(a, 1) loop
    6187    for i2 in 1:size(b, 2) loop
    6188     o[i1,i2] := temp_1[i1,i2];
    6189    end for;
    6190   end for;
     6152  o := temp_1;
    61916153  return;
    61926154 end FunctionTests.ArrayExpInFunc27.f;
     
    62076169equation
    62086170
    6209     annotation(__JModelica(UnitTesting(tests={
    6210         TransformCanonicalTestCase(
    6211             name="ArrayExpInFunc28",
    6212             description="Scalarization of functions: unknown size matrix expression",
    6213             variability_propagation=false,
    6214             inline_functions="none",
    6215             flatModel="
     6171annotation(__JModelica(UnitTesting(tests={
     6172    TransformCanonicalTestCase(
     6173        name="ArrayExpInFunc28",
     6174        description="Scalarization of functions: unknown size matrix expression",
     6175        variability_propagation=false,
     6176        inline_functions="none",
     6177        flatModel="
    62166178fclass FunctionTests.ArrayExpInFunc28
    62176179 Real x[1,1];
     
    62486210   end for;
    62496211  end for;
    6250   for i1 in 1:size(a, 1) loop
    6251    for i2 in 1:size(b, 2) loop
    6252     o[i1,i2] := temp_1[i1,i2];
    6253    end for;
    6254   end for;
     6212  o := temp_1;
    62556213  return;
    62566214 end FunctionTests.ArrayExpInFunc28.f;
     
    62706228    Real y[2,1] = f({{1}},{{1}});
    62716229
    6272     annotation(__JModelica(UnitTesting(tests={
    6273         TransformCanonicalTestCase(
    6274             name="ArrayExpInFunc29",
    6275             description="Scalarization of functions: unknown size cat expression",
    6276             variability_propagation=false,
    6277             inline_functions="none",
    6278             flatModel="
     6230annotation(__JModelica(UnitTesting(tests={
     6231    TransformCanonicalTestCase(
     6232        name="ArrayExpInFunc29",
     6233        description="Scalarization of functions: unknown size cat expression",
     6234        variability_propagation=false,
     6235        inline_functions="none",
     6236        flatModel="
    62796237fclass FunctionTests.ArrayExpInFunc29
    62806238 Real y[1,1];
     
    62916249 algorithm
    62926250  init o as Real[size(a, 1) + size(b, 1), size(b, 2)];
    6293   assert(size(a, 2) == size(b, 2), \"Mismatching size in dimension 2 of expression cat(1, a[:,:], b[:,:]) in function FunctionTests.ArrayExpInFunc29.f\");
     6251  assert(size(a, 2) == size(b, 2), \"Mismatching size in dimension 2 of expression cat(1, a, b) in function FunctionTests.ArrayExpInFunc29.f\");
    62946252  init temp_1 as Real[size(a, 1) + size(b, 1), size(a, 2)];
    62956253  for i1 in 1:size(a, 1) loop
     
    63036261   end for;
    63046262  end for;
    6305   for i1 in 1:size(a, 1) + size(b, 1) loop
    6306    for i2 in 1:size(b, 2) loop
    6307     o[i1,i2] := temp_1[i1,i2];
    6308    end for;
    6309   end for;
     6263  o := temp_1;
    63106264  return;
    63116265 end FunctionTests.ArrayExpInFunc29.f;
     
    63266280    Real y[1,3,3] = f({{{0,1,2},{10,11,12}}},{{{3,4}}},{{{5}}});
    63276281
    6328     annotation(__JModelica(UnitTesting(tests={
    6329         TransformCanonicalTestCase(
    6330             name="ArrayExpInFunc30",
    6331             description="Scalarization of functions: unknown size cat expression",
    6332             variability_propagation=false,
    6333             inline_functions="none",
    6334             flatModel="
     6282annotation(__JModelica(UnitTesting(tests={
     6283    TransformCanonicalTestCase(
     6284        name="ArrayExpInFunc30",
     6285        description="Scalarization of functions: unknown size cat expression",
     6286        variability_propagation=false,
     6287        inline_functions="none",
     6288        flatModel="
    63356289fclass FunctionTests.ArrayExpInFunc30
    63366290 Real y[1,1,1];
     
    63566310 algorithm
    63576311  init o as Real[size(a, 1), size(a, 2) + size(b, 2), size(a, 3)];
    6358   assert(size(a, 1) == size(b, 1), \"Mismatching size in dimension 1 of expression cat(2, a[:,:,:], cat(3, b[:,:,:], c[:,:,:])) in function FunctionTests.ArrayExpInFunc30.f\");
    6359   assert(size(a, 3) == size(b, 3) + size(c, 3), \"Mismatching size in dimension 3 of expression cat(2, a[:,:,:], cat(3, b[:,:,:], c[:,:,:])) in function FunctionTests.ArrayExpInFunc30.f\");
    6360   assert(size(b, 1) == size(c, 1), \"Mismatching size in dimension 1 of expression cat(3, b[:,:,:], c[:,:,:]) in function FunctionTests.ArrayExpInFunc30.f\");
    6361   assert(size(b, 2) == size(c, 2), \"Mismatching size in dimension 2 of expression cat(3, b[:,:,:], c[:,:,:]) in function FunctionTests.ArrayExpInFunc30.f\");
     6312  assert(size(a, 1) == size(b, 1), \"Mismatching size in dimension 1 of expression cat(2, a, cat(3, b, c)) in function FunctionTests.ArrayExpInFunc30.f\");
     6313  assert(size(a, 3) == size(b, 3) + size(c, 3), \"Mismatching size in dimension 3 of expression cat(2, a, cat(3, b, c)) in function FunctionTests.ArrayExpInFunc30.f\");
     6314  assert(size(b, 1) == size(c, 1), \"Mismatching size in dimension 1 of expression cat(3, b, c) in function FunctionTests.ArrayExpInFunc30.f\");
     6315  assert(size(b, 2) == size(c, 2), \"Mismatching size in dimension 2 of expression cat(3, b, c) in function FunctionTests.ArrayExpInFunc30.f\");
    63626316  init temp_1 as Real[size(a, 1), size(a, 2) + size(b, 2), size(a, 3)];
    63636317  for i1 in 1:size(a, 1) loop
     
    63906344   end for;
    63916345  end for;
    6392   for i1 in 1:size(a, 1) loop
    6393    for i2 in 1:size(a, 2) + size(b, 2) loop
    6394     for i3 in 1:size(a, 3) loop
    6395      o[i1,i2,i3] := temp_1[i1,i2,i3];
    6396     end for;
    6397    end for;
    6398   end for;
     6346  o := temp_1;
    63996347  return;
    64006348 end FunctionTests.ArrayExpInFunc30.f;
     
    66546602    Real[1,1] y = f(1);
    66556603
    6656     annotation(__JModelica(UnitTesting(tests={
    6657         TransformCanonicalTestCase(
    6658             name="ArrayExpInFunc34",
    6659             description="Scalarization of functions: unknown size identity expression",
    6660             variability_propagation=false,
    6661             inline_functions="none",
    6662             flatModel="
     6604annotation(__JModelica(UnitTesting(tests={
     6605    TransformCanonicalTestCase(
     6606        name="ArrayExpInFunc34",
     6607        description="Scalarization of functions: unknown size identity expression",
     6608        variability_propagation=false,
     6609        inline_functions="none",
     6610        flatModel="
    66636611fclass FunctionTests.ArrayExpInFunc34
    66646612 Real y[1,1];
     
    66796627   end for;
    66806628  end for;
    6681   for i1 in 1:n loop
    6682    for i2 in 1:n loop
    6683     o[i1,i2] := temp_1[i1,i2];
    6684    end for;
    6685   end for;
     6629  o := temp_1;
    66866630  return;
    66876631 end FunctionTests.ArrayExpInFunc34.f;
     
    67496693    Real[1] y = f({1});
    67506694   
    6751     annotation(__JModelica(UnitTesting(tests={
    6752         TransformCanonicalTestCase(
    6753             name="ArrayExpInFunc36",
    6754             description="Scalarization of functions: unknown size vector operator",
    6755             variability_propagation=false,
    6756             inline_functions="none",
    6757             flatModel="
     6695annotation(__JModelica(UnitTesting(tests={
     6696    TransformCanonicalTestCase(
     6697        name="ArrayExpInFunc36",
     6698        description="Scalarization of functions: unknown size vector operator",
     6699        variability_propagation=false,
     6700        inline_functions="none",
     6701        flatModel="
    67586702fclass FunctionTests.ArrayExpInFunc36
    67596703 Real y[1];
     
    67726716   temp_1[i1 - 1 + 1] := a[i1];
    67736717  end for;
    6774   for i1 in 1:size(a, 1) loop
    6775    b[i1] := temp_1[i1];
    6776   end for;
     6718  b := temp_1;
    67776719  return;
    67786720 end FunctionTests.ArrayExpInFunc36.f;
     
    67926734    Real[1,1] y = f({{3}});
    67936735
    6794     annotation(__JModelica(UnitTesting(tests={
    6795         TransformCanonicalTestCase(
    6796             name="ArrayExpInFunc39",
    6797             description="Scalarization of functions: unknown size vector operator, matrix input",
    6798             variability_propagation=false,
    6799             inline_functions="none",
    6800             flatModel="
     6736annotation(__JModelica(UnitTesting(tests={
     6737    TransformCanonicalTestCase(
     6738        name="ArrayExpInFunc39",
     6739        description="Scalarization of functions: unknown size vector operator, matrix input",
     6740        variability_propagation=false,
     6741        inline_functions="none",
     6742        flatModel="
    68016743fclass FunctionTests.ArrayExpInFunc39
    68026744 Real y[1,1];
     
    68176759   end for;
    68186760  end for;
    6819   for i1 in 1:size(a, 1) loop
    6820    for i2 in 1:size(a, 2) loop
    6821     b[i1,i2] := temp_1[i1,i2];
    6822    end for;
    6823   end for;
     6761  b := temp_1;
    68246762  return;
    68256763 end FunctionTests.ArrayExpInFunc39.f;
     
    68396777    Real[1,1] y = f({{{3}}});
    68406778
    6841     annotation(__JModelica(UnitTesting(tests={
    6842         TransformCanonicalTestCase(
    6843             name="ArrayExpInFunc40",
    6844             description="Scalarization of functions: unknown size vector operator, many dims input",
    6845             variability_propagation=false,
    6846             inline_functions="none",
    6847             flatModel="
     6779annotation(__JModelica(UnitTesting(tests={
     6780    TransformCanonicalTestCase(
     6781        name="ArrayExpInFunc40",
     6782        description="Scalarization of functions: unknown size vector operator, many dims input",
     6783        variability_propagation=false,
     6784        inline_functions="none",
     6785        flatModel="
    68486786fclass FunctionTests.ArrayExpInFunc40
    68496787 Real y[1,1];
     
    68586796 algorithm
    68596797  init b as Real[size(a, 1), size(a, 2)];
    6860   assert(size(a, 3) == 1, \"Mismatching size in dimension 3 of expression matrix(a[:,:,:]) in function FunctionTests.ArrayExpInFunc40.f\");
     6798  assert(size(a, 3) == 1, \"Mismatching size in dimension 3 of expression matrix(a) in function FunctionTests.ArrayExpInFunc40.f\");
    68616799  init temp_1 as Real[size(a, 1), size(a, 2)];
    68626800  for i1 in 1:size(a, 1) loop
     
    68676805   end for;
    68686806  end for;
    6869   for i1 in 1:size(a, 1) loop
    6870    for i2 in 1:size(a, 2) loop
    6871     b[i1,i2] := temp_1[i1,i2];
    6872    end for;
    6873   end for;
     6807  b := temp_1;
    68746808  return;
    68756809 end FunctionTests.ArrayExpInFunc40.f;
     
    68896823    Real y = f({{{1}}});
    68906824
    6891     annotation(__JModelica(UnitTesting(tests={
    6892         TransformCanonicalTestCase(
    6893             name="ArrayExpInFunc41",
    6894             description="Scalarization of functions: unknown size in scalar operator",
    6895             variability_propagation=false,
    6896             inline_functions="none",
    6897             flatModel="
     6825annotation(__JModelica(UnitTesting(tests={
     6826    TransformCanonicalTestCase(
     6827        name="ArrayExpInFunc41",
     6828        description="Scalarization of functions: unknown size in scalar operator",
     6829        variability_propagation=false,
     6830        inline_functions="none",
     6831        flatModel="
    68986832fclass FunctionTests.ArrayExpInFunc41
    68996833 Real y;
     
    69066840  output Real b;
    69076841 algorithm
    6908   assert(size(a, 1) == 1, \"Mismatching size in dimension 1 of expression scalar(a[:,:,:] + a[:,:,:]) in function FunctionTests.ArrayExpInFunc41.f\");
    6909   assert(size(a, 2) == 1, \"Mismatching size in dimension 2 of expression scalar(a[:,:,:] + a[:,:,:]) in function FunctionTests.ArrayExpInFunc41.f\");
    6910   assert(size(a, 3) == 1, \"Mismatching size in dimension 3 of expression scalar(a[:,:,:] + a[:,:,:]) in function FunctionTests.ArrayExpInFunc41.f\");
     6842  assert(size(a, 1) == 1, \"Mismatching size in dimension 1 of expression scalar(a + a) in function FunctionTests.ArrayExpInFunc41.f\");
     6843  assert(size(a, 2) == 1, \"Mismatching size in dimension 2 of expression scalar(a + a) in function FunctionTests.ArrayExpInFunc41.f\");
     6844  assert(size(a, 3) == 1, \"Mismatching size in dimension 3 of expression scalar(a + a) in function FunctionTests.ArrayExpInFunc41.f\");
    69116845  b := a[1,1,1] + a[1,1,1];
    69126846  return;
     
    70396973        Real x[2,2] = F({1,2});
    70406974
    7041     annotation(__JModelica(UnitTesting(tests={
    7042         TransformCanonicalTestCase(
    7043             name="ArrayExpInFunc44",
    7044             description="Scalarization of functions: unknown size in scalar operator",
    7045             variability_propagation=false,
    7046             flatModel="
     6975annotation(__JModelica(UnitTesting(tests={
     6976    TransformCanonicalTestCase(
     6977        name="ArrayExpInFunc44",
     6978        description="Scalarization of functions: unknown size in scalar operator",
     6979        variability_propagation=false,
     6980        flatModel="
    70476981fclass FunctionTests.ArrayExpInFunc44
    70486982 Real x[1,1];
     
    70667000   end for;
    70677001  end for;
    7068   for i1 in 1:size(a, 1) loop
    7069    for i2 in 1:size(a, 1) loop
    7070     b[i1,i2] := temp_1[i1,i2];
    7071    end for;
    7072   end for;
     7002  b := temp_1;
    70737003  return;
    70747004 annotation(Inline = false);
     
    70937023    Real y = f2(3);
    70947024
    7095     annotation(__JModelica(UnitTesting(tests={
    7096         TransformCanonicalTestCase(
    7097             name="ArrayExpInFunc45",
    7098             description="Scalarization of functions: unknown size in scalar operator",
    7099             variability_propagation=false,
    7100             flatModel="
     7025annotation(__JModelica(UnitTesting(tests={
     7026    TransformCanonicalTestCase(
     7027        name="ArrayExpInFunc45",
     7028        description="Scalarization of functions: unknown size in scalar operator",
     7029        variability_propagation=false,
     7030        flatModel="
    71017031fclass FunctionTests.ArrayExpInFunc45
    71027032 Real y;
     
    71327062 algorithm
    71337063  init y as Real[size(x, 1)];
    7134   for i1 in 1:size(x, 1) loop
    7135    y[i1] := x[i1];
    7136   end for;
     7064  y := x;
    71377065  return;
    71387066 end FunctionTests.ArrayExpInFunc45.f1;
     
    71567084    parameter Real[:] x2 = f({6,7,8}) annotation(Evaluate=true);
    71577085
    7158     annotation(__JModelica(UnitTesting(tests={
    7159         FlatteningTestCase(
    7160             name="ArrayExpInFunc46",
    7161             description="Check that we don't crash due to cached size for range expression in for loop in function",
    7162             flatModel="
     7086annotation(__JModelica(UnitTesting(tests={
     7087    FlatteningTestCase(
     7088        name="ArrayExpInFunc46",
     7089        description="Check that we don't crash due to cached size for range expression in for loop in function",
     7090        flatModel="
    71637091fclass FunctionTests.ArrayExpInFunc46
    71647092 eval parameter Real x1[4] = {2, 3, 4, 5} /* { 2, 3, 4, 5 } */;
     
    71727100  init y as Real[size(x, 1) - 1];
    71737101  for i in 1:2 loop
    7174    y[:] := x[2:size(x, 1)];
     7102   y := x[2:size(x, 1)];
    71757103  end for;
    71767104  return;
     
    75197447    Real[:] y = f({R({1})});
    75207448
    7521     annotation(__JModelica(UnitTesting(tests={
    7522         TransformCanonicalTestCase(
    7523             name="ArrayExpInFunc52",
    7524             description="Scalarizing temporary in size expression",
    7525             variability_propagation=false,
    7526             flatModel="
     7449annotation(__JModelica(UnitTesting(tests={
     7450    TransformCanonicalTestCase(
     7451        name="ArrayExpInFunc52",
     7452        description="Scalarizing temporary in size expression",
     7453        variability_propagation=false,
     7454        flatModel="
    75277455fclass FunctionTests.ArrayExpInFunc52
    75287456 Real y[1];
     
    75447472  (temp_2) := FunctionTests.ArrayExpInFunc52.g(r[1].x);
    75457473  temp_1[2] := size(r[temp_2[1]].x, 1);
    7546   for i1 in 1:2 loop
    7547    y[i1] := temp_1[i1];
    7548   end for;
     7474  y := temp_1;
    75497475  return;
    75507476 annotation(Inline = false);
     
    75567482 algorithm
    75577483  init y as Integer[size(x, 1)];
    7558   for i1 in 1:size(x, 1) loop
    7559    y[i1] := x[i1];
    7560   end for;
     7484  y := x;
    75617485  return;
    75627486 end FunctionTests.ArrayExpInFunc52.g;
     
    75837507 (x,y) = f();
    75847508
    7585     annotation(__JModelica(UnitTesting(tests={
    7586         TransformCanonicalTestCase(
    7587             name="ArrayOutputScalarization1",
    7588             description="Scalarization of array function outputs: function call equation",
    7589             variability_propagation=false,
    7590             inline_functions="none",
    7591             flatModel="
     7509annotation(__JModelica(UnitTesting(tests={
     7510    TransformCanonicalTestCase(
     7511        name="ArrayOutputScalarization1",
     7512        description="Scalarization of array function outputs: function call equation",
     7513        variability_propagation=false,
     7514        inline_functions="none",
     7515        flatModel="
    75927516fclass FunctionTests.ArrayOutputScalarization1
    75937517 Real x[1];
     
    76097533  temp_1[1] := 1;
    76107534  temp_1[2] := 2;
    7611   for i1 in 1:2 loop
    7612    x[i1] := temp_1[i1];
    7613   end for;
     7535  x := temp_1;
    76147536  init y as Real[2];
    76157537  init temp_2 as Integer[2];
    76167538  temp_2[1] := 1;
    76177539  temp_2[2] := 2;
    7618   for i1 in 1:2 loop
    7619    y[i1] := temp_2[i1];
    7620   end for;
     7540  y := temp_2;
    76217541  return;
    76227542 end FunctionTests.ArrayOutputScalarization1.f;
     
    76377557 x = {3,4} + f();
    76387558
    7639     annotation(__JModelica(UnitTesting(tests={
    7640         TransformCanonicalTestCase(
    7641             name="ArrayOutputScalarization2",
    7642             description="Scalarization of array function outputs: expression with func call",
    7643             variability_propagation=false,
    7644             inline_functions="none",
    7645             flatModel="
     7559annotation(__JModelica(UnitTesting(tests={
     7560    TransformCanonicalTestCase(
     7561        name="ArrayOutputScalarization2",
     7562        description="Scalarization of array function outputs: expression with func call",
     7563        variability_propagation=false,
     7564        inline_functions="none",
     7565        flatModel="
    76467566fclass FunctionTests.ArrayOutputScalarization2
    76477567 Real x[1];
     
    76637583  temp_1[1] := 1;
    76647584  temp_1[2] := 2;
    7665   for i1 in 1:2 loop
    7666    x[i1] := temp_1[i1];
    7667   end for;
     7585  x := temp_1;
    76687586  return;
    76697587 end FunctionTests.ArrayOutputScalarization2.f;
     
    76877605 x = {1,2} + f();
    76887606
    7689     annotation(__JModelica(UnitTesting(tests={
    7690         TransformCanonicalTestCase(
    7691             name="ArrayOutputScalarization3",
    7692             description="Scalarization of array function outputs: finding free temp name",
    7693             variability_propagation=false,
    7694             inline_functions="none",
    7695             flatModel="
     7607annotation(__JModelica(UnitTesting(tests={
     7608    TransformCanonicalTestCase(
     7609        name="ArrayOutputScalarization3",
     7610        description="Scalarization of array function outputs: finding free temp name",
     7611        variability_propagation=false,
     7612        inline_functions="none",
     7613        flatModel="
    76967614fclass FunctionTests.ArrayOutputScalarization3
    76977615 Real x[1];
     
    77197637  temp_1[1] := 1;
    77207638  temp_1[2] := 2;
    7721   for i1 in 1:2 loop
    7722    x[i1] := temp_1[i1];
    7723   end for;
     7639  x := temp_1;
    77247640  return;
    77257641 end FunctionTests.ArrayOutputScalarization3.f;
     
    77487664 Real x = f2();
    77497665
    7750     annotation(__JModelica(UnitTesting(tests={
    7751         TransformCanonicalTestCase(
    7752             name="ArrayOutputScalarization4",
    7753             description="Scalarization of array function outputs: function call statement",
    7754             variability_propagation=false,
    7755             flatModel="
     7666annotation(__JModelica(UnitTesting(tests={
     7667    TransformCanonicalTestCase(
     7668        name="ArrayOutputScalarization4",
     7669        description="Scalarization of array function outputs: function call statement",
     7670        variability_propagation=false,
     7671        flatModel="
    77567672fclass FunctionTests.ArrayOutputScalarization4
    77577673 Real x;
     
    77827698  temp_1[1] := 1;
    77837699  temp_1[2] := 2;
    7784   for i1 in 1:2 loop
    7785    x[i1] := temp_1[i1];
    7786   end for;
     7700  x := temp_1;
    77877701  init y as Real[2];
    77887702  init temp_2 as Integer[2];
    77897703  temp_2[1] := 1;
    77907704  temp_2[2] := 2;
    7791   for i1 in 1:2 loop
    7792    y[i1] := temp_2[i1];
    7793   end for;
     7705  y := temp_2;
    77947706  return;
    77957707 end FunctionTests.ArrayOutputScalarization4.f1;
     
    78167728 Real x = f2();
    78177729
    7818     annotation(__JModelica(UnitTesting(tests={
    7819         TransformCanonicalTestCase(
    7820             name="ArrayOutputScalarization5",
    7821             description="Scalarization of array function outputs: assign statement with expression",
    7822             variability_propagation=false,
    7823             flatModel="
     7730annotation(__JModelica(UnitTesting(tests={
     7731    TransformCanonicalTestCase(
     7732        name="ArrayOutputScalarization5",
     7733        description="Scalarization of array function outputs: assign statement with expression",
     7734        variability_propagation=false,
     7735        flatModel="
    78247736fclass FunctionTests.ArrayOutputScalarization5
    78257737 Real x;
     
    78557767  temp_1[1] := 1;
    78567768  temp_1[2] := 2;
    7857   for i1 in 1:2 loop
    7858    x[i1] := temp_1[i1];
    7859   end for;
     7769  x := temp_1;
    78607770  return;
    78617771 end FunctionTests.ArrayOutputScalarization5.f1;
     
    78847794 Real x = f2();
    78857795
    7886     annotation(__JModelica(UnitTesting(tests={
    7887         TransformCanonicalTestCase(
    7888             name="ArrayOutputScalarization6",
    7889             description="Scalarization of array function outputs: finding free temp name",
    7890             variability_propagation=false,
    7891             flatModel="
     7796annotation(__JModelica(UnitTesting(tests={
     7797    TransformCanonicalTestCase(
     7798        name="ArrayOutputScalarization6",
     7799        description="Scalarization of array function outputs: finding free temp name",
     7800        variability_propagation=false,
     7801        flatModel="
    78927802fclass FunctionTests.ArrayOutputScalarization6
    78937803 Real x;
     
    79157825  temp_1[1] := 1;
    79167826  temp_1[2] := 2;
    7917   for i1 in 1:2 loop
    7918    x[i1] := temp_1[i1];
    7919   end for;
     7827  x := temp_1;
    79207828  return;
    79217829 end FunctionTests.ArrayOutputScalarization6.f1;
     
    79527860 Real x = f2(1);
    79537861
    7954     annotation(__JModelica(UnitTesting(tests={
    7955         TransformCanonicalTestCase(
    7956             name="ArrayOutputScalarization7",
    7957             description="Scalarization of array function outputs: if statement",
    7958             variability_propagation=false,
    7959             flatModel="
     7862annotation(__JModelica(UnitTesting(tests={
     7863    TransformCanonicalTestCase(
     7864        name="ArrayOutputScalarization7",
     7865        description="Scalarization of array function outputs: if statement",
     7866        variability_propagation=false,
     7867        flatModel="
    79607868fclass FunctionTests.ArrayOutputScalarization7
    79617869 Real x;
     
    80037911   temp_7[1] := 3;
    80047912   temp_7[2] := 4;
    8005    for i1 in 1:2 loop
    8006     y[i1] := temp_7[i1];
    8007    end for;
     7913   y := temp_7;
    80087914  else
    80097915   x := 1;
     
    80237929  temp_1[1] := 1;
    80247930  temp_1[2] := 2;
    8025   for i1 in 1:2 loop
    8026    x[i1] := temp_1[i1];
    8027   end for;
     7931  x := temp_1;
    80287932  return;
    80297933 end FunctionTests.ArrayOutputScalarization7.f1;
     
    80537957 Real x = f2();
    80547958
    8055     annotation(__JModelica(UnitTesting(tests={
    8056         TransformCanonicalTestCase(
    8057             name="ArrayOutputScalarization8",
    8058             description="Scalarization of array function outputs: for statement",
    8059             variability_propagation=false,
    8060             flatModel="
     7959annotation(__JModelica(UnitTesting(tests={
     7960    TransformCanonicalTestCase(
     7961        name="ArrayOutputScalarization8",
     7962        description="Scalarization of array function outputs: for statement",
     7963        variability_propagation=false,
     7964        flatModel="
    80617965fclass FunctionTests.ArrayOutputScalarization8
    80627966 Real x;
     
    80897993  temp_1[1] := 1;
    80907994  temp_1[2] := 2;
    8091   for i1 in 1:2 loop
    8092    x[i1] := temp_1[i1];
    8093   end for;
     7995  x := temp_1;
    80947996  return;
    80957997 end FunctionTests.ArrayOutputScalarization8.f1;
     
    81108012 x = f();
    81118013
    8112     annotation(__JModelica(UnitTesting(tests={
    8113         TransformCanonicalTestCase(
    8114             name="ArrayOutputScalarization9",
    8115             description="Scalarization of array function outputs: equation without expression",
    8116             variability_propagation=false,
    8117             inline_functions="none",
    8118             eliminate_alias_variables=false,
    8119             flatModel="
     8014annotation(__JModelica(UnitTesting(tests={
     8015    TransformCanonicalTestCase(
     8016        name="ArrayOutputScalarization9",
     8017        description="Scalarization of array function outputs: equation without expression",
     8018        variability_propagation=false,
     8019        inline_functions="none",
     8020        eliminate_alias_variables=false,
     8021        flatModel="
    81208022fclass FunctionTests.ArrayOutputScalarization9
    81218023 Real x[1];
     
    81338035  temp_1[1] := 1;
    81348036  temp_1[2] := 2;
    8135   for i1 in 1:2 loop
    8136    x[i1] := temp_1[i1];
    8137   end for;
     8037  x := temp_1;
    81388038  return;
    81398039 end FunctionTests.ArrayOutputScalarization9.f;
     
    81608060 Real x = f2();
    81618061
    8162     annotation(__JModelica(UnitTesting(tests={
    8163         TransformCanonicalTestCase(
    8164             name="ArrayOutputScalarization10",
    8165             description="Scalarization of array function outputs: while statement",
    8166             variability_propagation=false,
    8167             flatModel="
     8062annotation(__JModelica(UnitTesting(tests={
     8063    TransformCanonicalTestCase(
     8064        name="ArrayOutputScalarization10",
     8065        description="Scalarization of array function outputs: while statement",
     8066        variability_propagation=false,
     8067        flatModel="
    81688068fclass FunctionTests.ArrayOutputScalarization10
    81698069 Real x;
     
    82048104  temp_1[1] := 1;
    82058105  temp_1[2] := 2;
    8206   for i1 in 1:2 loop
    8207    x[i1] := temp_1[i1];
    8208   end for;
     8106  x := temp_1;
    82098107  return;
    82108108 end FunctionTests.ArrayOutputScalarization10.f1;
     
    82308128 Real x = f2();
    82318129
    8232     annotation(__JModelica(UnitTesting(tests={
    8233         TransformCanonicalTestCase(
    8234             name="ArrayOutputScalarization11",
    8235             description="Scalarization of array function outputs: binding expression",
    8236             variability_propagation=false,
    8237             flatModel="
     8130annotation(__JModelica(UnitTesting(tests={
     8131    TransformCanonicalTestCase(
     8132        name="ArrayOutputScalarization11",
     8133        description="Scalarization of array function outputs: binding expression",
     8134        variability_propagation=false,
     8135        flatModel="
    82388136fclass FunctionTests.ArrayOutputScalarization11
    82398137 Real x;
     
    82608158  temp_1[1] := 1;
    82618159  temp_1[2] := 2;
    8262   for i1 in 1:2 loop
    8263    x[i1] := temp_1[i1];
    8264   end for;
     8160  x := temp_1;
    82658161  return;
    82668162 end FunctionTests.ArrayOutputScalarization11.f1;
     
    82868182 Real x = f2();
    82878183
    8288     annotation(__JModelica(UnitTesting(tests={
    8289         TransformCanonicalTestCase(
    8290             name="ArrayOutputScalarization12",
    8291             description="Scalarization of array function outputs: part of binding expression",
    8292             variability_propagation=false,
    8293             flatModel="
     8184annotation(__JModelica(UnitTesting(tests={
     8185    TransformCanonicalTestCase(
     8186        name="ArrayOutputScalarization12",
     8187        description="Scalarization of array function outputs: part of binding expression",
     8188        variability_propagation=false,
     8189        flatModel="
    82948190fclass FunctionTests.ArrayOutputScalarization12
    82958191 Real x;
     
    83258221  temp_1[1] := 1;
    83268222  temp_1[2] := 2;
    8327   for i1 in 1:2 loop
    8328    x[i1] := temp_1[i1];
    8329   end for;
     8223  x := temp_1;
    83308224  return;
    83318225 end FunctionTests.ArrayOutputScalarization12.f1;
     
    83518245 Real x = f2();
    83528246
    8353     annotation(__JModelica(UnitTesting(tests={
    8354         TransformCanonicalTestCase(
    8355             name="ArrayOutputScalarization13",
    8356             description="Scalarization of array function outputs: part of scalar binding exp",
    8357             variability_propagation=false,
    8358             flatModel="
     8247annotation(__JModelica(UnitTesting(tests={
     8248    TransformCanonicalTestCase(
     8249        name="ArrayOutputScalarization13",
     8250        description="Scalarization of array function outputs: part of scalar binding exp",
     8251        variability_propagation=false,
     8252        flatModel="
    83598253fclass FunctionTests.ArrayOutputScalarization13
    83608254 Real x;
     
    83888282  temp_1[1] := 1;
    83898283  temp_1[2] := 2;
    8390   for i1 in 1:2 loop
    8391    x[i1] := temp_1[i1];
    8392   end for;
     8284  x := temp_1;
    83938285  return;
    83948286 end FunctionTests.ArrayOutputScalarization13.f1;
     
    84078299 Real x = f() * {3, 4};
    84088300
    8409     annotation(__JModelica(UnitTesting(tests={
    8410         TransformCanonicalTestCase(
    8411             name="ArrayOutputScalarization14",
    8412             description="Scalarization of array function outputs: part of scalar expression",
    8413             variability_propagation=false,
    8414             inline_functions="none",
    8415             flatModel="
     8301annotation(__JModelica(UnitTesting(tests={
     8302    TransformCanonicalTestCase(
     8303        name="ArrayOutputScalarization14",
     8304        description="Scalarization of array function outputs: part of scalar expression",
     8305        variability_propagation=false,
     8306        inline_functions="none",
     8307        flatModel="
    84168308fclass FunctionTests.ArrayOutputScalarization14
    84178309 Real x;
     
    84318323  temp_1[1] := 1;
    84328324  temp_1[2] := 2;
    8433   for i1 in 1:2 loop
    8434    x[i1] := temp_1[i1];
    8435   end for;
     8325  x := temp_1;
    84368326  return;
    84378327 end FunctionTests.ArrayOutputScalarization14.f;
     
    84828372 Real x = f1();
    84838373
    8484     annotation(__JModelica(UnitTesting(tests={
    8485         TransformCanonicalTestCase(
    8486             name="ArrayOutputScalarization16",
    8487             description="Scalarization of array function outputs: using original arrays",
    8488             variability_propagation=false,
    8489             flatModel="
     8374annotation(__JModelica(UnitTesting(tests={
     8375    TransformCanonicalTestCase(
     8376        name="ArrayOutputScalarization16",
     8377        description="Scalarization of array function outputs: using original arrays",
     8378        variability_propagation=false,
     8379        flatModel="
    84908380fclass FunctionTests.ArrayOutputScalarization16
    84918381 Real x;
     
    85058395  temp_1[1] := 1;
    85068396  temp_1[2] := 2;
    8507   for i1 in 1:2 loop
    8508    x[i1] := temp_1[i1];
    8509   end for;
     8397  x := temp_1;
    85108398  init y as Real[2];
    85118399  (y) := FunctionTests.ArrayOutputScalarization16.f2(x);
     
    85188406 algorithm
    85198407  init y as Real[2];
    8520   for i1 in 1:2 loop
    8521    y[i1] := x[i1];
    8522   end for;
     8408  y := x;
    85238409  return;
    85248410 end FunctionTests.ArrayOutputScalarization16.f2;
     
    85458431 Real x = f1();
    85468432
    8547     annotation(__JModelica(UnitTesting(tests={
    8548         TransformCanonicalTestCase(
    8549             name="ArrayOutputScalarization17",
    8550             description="Scalarization of array function outputs: using original arrays",
    8551             variability_propagation=false,
    8552             flatModel="
     8433annotation(__JModelica(UnitTesting(tests={
     8434    TransformCanonicalTestCase(
     8435        name="ArrayOutputScalarization17",
     8436        description="Scalarization of array function outputs: using original arrays",
     8437        variability_propagation=false,
     8438        flatModel="
    85538439fclass FunctionTests.ArrayOutputScalarization17
    85548440 Real x;
     
    85728458 algorithm
    85738459  init y as Real[2];
    8574   for i1 in 1:2 loop
    8575    y[i1] := x[i1];
    8576   end for;
     8460  y := x;
    85778461  return;
    85788462 end FunctionTests.ArrayOutputScalarization17.f2;
     
    87328616    R x = f1(1);
    87338617
    8734     annotation(__JModelica(UnitTesting(tests={
    8735         TransformCanonicalTestCase(
    8736             name="ArrayOutputScalarization20",
    8737             description="Checks for bug in #1895",
    8738             variability_propagation=false,
    8739             inline_functions="none",
    8740             flatModel="
     8618annotation(__JModelica(UnitTesting(tests={
     8619    TransformCanonicalTestCase(
     8620        name="ArrayOutputScalarization20",
     8621        description="Checks for bug in #1895",
     8622        variability_propagation=false,
     8623        inline_functions="none",
     8624        flatModel="
    87418625fclass FunctionTests.ArrayOutputScalarization20
    87428626 Real x.a;
     
    87648648  temp_1[2] := 2;
    87658649  f.a := e;
    8766   for i1 in 1:2 loop
    8767    f.b[i1] := temp_1[i1];
    8768   end for;
     8650  f.b := temp_1;
    87698651  return;
    87708652 end FunctionTests.ArrayOutputScalarization20.f2;
     
    87948676    R z = f(time);
    87958677
    8796     annotation(__JModelica(UnitTesting(tests={
    8797         TransformCanonicalTestCase(
    8798             name="ArrayOutputScalarization21",
    8799             description="Scalarization of matrix in record as output of function",
    8800             inline_functions="none",
    8801             flatModel="
     8678annotation(__JModelica(UnitTesting(tests={
     8679    TransformCanonicalTestCase(
     8680        name="ArrayOutputScalarization21",
     8681        description="Scalarization of matrix in record as output of function",
     8682        inline_functions="none",
     8683        flatModel="
    88028684fclass FunctionTests.ArrayOutputScalarization21
    88038685 Real z.x[1,1];
     
    88298711   temp_1[2,i1] := temp_3[i1];
    88308712  end for;
    8831   for i1 in 1:2 loop
    8832    for i2 in 1:2 loop
    8833     y.x[i1,i2] := temp_1[i1,i2];
    8834    end for;
    8835   end for;
     8713  y.x := temp_1;
    88368714  return;
    88378715 end FunctionTests.ArrayOutputScalarization21.f;
     
    88578735    Real[n,2] c = { f(i) for i in 1:n };
    88588736
    8859     annotation(__JModelica(UnitTesting(tests={
    8860         TransformCanonicalTestCase(
    8861             name="ArrayOutputScalarization22",
    8862             description="Iteration expression with function call",
    8863             inline_functions="none",
    8864             variability_propagation=false,
    8865             flatModel="
     8737annotation(__JModelica(UnitTesting(tests={
     8738    TransformCanonicalTestCase(
     8739        name="ArrayOutputScalarization22",
     8740        description="Iteration expression with function call",
     8741        inline_functions="none",
     8742        variability_propagation=false,
     8743        flatModel="
    88668744fclass FunctionTests.ArrayOutputScalarization22
    88678745 structural parameter Integer n = 3 /* 3 */;
     
    88878765  temp_1[1] := a;
    88888766  temp_1[2] := a * a;
    8889   for i1 in 1:2 loop
    8890    b[i1] := temp_1[i1];
    8891   end for;
     8767  b := temp_1;
    88928768  return;
    88938769 end FunctionTests.ArrayOutputScalarization22.f;
     
    89138789    end for;
    89148790
    8915     annotation(__JModelica(UnitTesting(tests={
    8916         TransformCanonicalTestCase(
    8917             name="ArrayOutputScalarization23",
    8918             description="Function returning array in for loop",
    8919             inline_functions="none",
    8920             variability_propagation=false,
    8921             flatModel="
     8791annotation(__JModelica(UnitTesting(tests={
     8792    TransformCanonicalTestCase(
     8793        name="ArrayOutputScalarization23",
     8794        description="Function returning array in for loop",
     8795        inline_functions="none",
     8796        variability_propagation=false,
     8797        flatModel="
    89228798fclass FunctionTests.ArrayOutputScalarization23
    89238799 structural parameter Integer n = 3 /* 3 */;
     
    89438819  temp_1[1] := a;
    89448820  temp_1[2] := a * a;
    8945   for i1 in 1:2 loop
    8946    b[i1] := temp_1[i1];
    8947   end for;
     8821  b := temp_1;
    89488822  return;
    89498823 end FunctionTests.ArrayOutputScalarization23.f;
     
    89738847    der(z) = { -x, -y };
    89748848
    8975     annotation(__JModelica(UnitTesting(tests={
    8976         TransformCanonicalTestCase(
    8977             name="ArrayOutputScalarization24",
    8978             description="Scalarize use of function returning array in initial equations",
    8979             inline_functions="none",
    8980             flatModel="
     8849annotation(__JModelica(UnitTesting(tests={
     8850    TransformCanonicalTestCase(
     8851        name="ArrayOutputScalarization24",
     8852        description="Scalarize use of function returning array in initial equations",
     8853        inline_functions="none",
     8854        flatModel="
    89818855fclass FunctionTests.ArrayOutputScalarization24
    89828856 Real x(start = 1);
     
    90088882  temp_1[1] := a;
    90098883  temp_1[2] := a * a;
    9010   for i1 in 1:2 loop
    9011    b[i1] := temp_1[i1];
    9012   end for;
     8884  b := temp_1;
    90138885  return;
    90148886 end FunctionTests.ArrayOutputScalarization24.f;
     
    90448916    a := fwrap({R({1,1},{1,1}),R({1,1},{1,1})});
    90458917
    9046     annotation(__JModelica(UnitTesting(tests={
    9047         TransformCanonicalTestCase(
    9048             name="ArrayOutputScalarization25",
    9049             description="Scalarize function call statements.",
    9050             variability_propagation=false,
    9051             inline_functions="none",
    9052             flatModel="
     8918annotation(__JModelica(UnitTesting(tests={
     8919    TransformCanonicalTestCase(
     8920        name="ArrayOutputScalarization25",
     8921        description="Scalarize function call statements.",
     8922        variability_propagation=false,
     8923        inline_functions="none",
     8924        flatModel="
    90538925fclass FunctionTests.ArrayOutputScalarization25
    90548926 Real a[1].x[1];
     
    91058977  end for;
    91068978  for i1 in 1:2 loop
    9107    for i2 in 1:2 loop
    9108     o[i1].x[i2] := i[i1].x[i2];
    9109    end for;
    9110    for i2 in 1:2 loop
    9111     o[i1].y[i2] := i[i1].y[i2];
    9112    end for;
     8979   o[i1].x := i[i1].x;
     8980   o[i1].y := i[i1].y;
    91138981  end for;
    91148982  return;
     
    94009268 Real y[2] = f({4,5});
    94019269
    9402     annotation(__JModelica(UnitTesting(tests={
    9403         FlatteningTestCase(
    9404             name="UnknownArray1",
    9405             description="Using functions with unknown array sizes: basic type test",
    9406             variability_propagation=false,
    9407             flatModel="
     9270annotation(__JModelica(UnitTesting(tests={
     9271    FlatteningTestCase(
     9272        name="UnknownArray1",
     9273        description="Using functions with unknown array sizes: basic type test",
     9274        variability_propagation=false,
     9275        flatModel="
    94089276fclass FunctionTests.UnknownArray1
    94099277 Real x[3] = FunctionTests.UnknownArray1.f({1, 2, 3});
     
    94169284 algorithm
    94179285  init b as Real[size(a, 1)];
    9418   b[:] := a[:];
     9286  b := a;
    94199287  return;
    94209288 end FunctionTests.UnknownArray1.f;
     
    94359303 Real y[2] = f({4,5});
    94369304
    9437     annotation(__JModelica(UnitTesting(tests={
    9438         FlatteningTestCase(
    9439             name="UnknownArray2",
    9440             description="Using functions with unknown array sizes: size from binding exp",
    9441             variability_propagation=false,
    9442             flatModel="
     9305annotation(__JModelica(UnitTesting(tests={
     9306    FlatteningTestCase(
     9307        name="UnknownArray2",
     9308        description="Using functions with unknown array sizes: size from binding exp",
     9309        variability_propagation=false,
     9310        flatModel="
    94439311fclass FunctionTests.UnknownArray2
    94449312 Real x[3] = FunctionTests.UnknownArray2.f({1, 2, 3});
     
    94519319 algorithm
    94529320  init b as Real[size(a, 1)];
    9453   b := a[:];
     9321  b := a;
    94549322  return;
    94559323 end FunctionTests.UnknownArray2.f;
     
    94729340 Real y[2] = f({4,5});
    94739341
    9474     annotation(__JModelica(UnitTesting(tests={
    9475         FlatteningTestCase(
    9476             name="UnknownArray3",
    9477             description="Using functions with unknown array sizes: indirect dependency",
    9478             variability_propagation=false,
    9479             flatModel="
     9342annotation(__JModelica(UnitTesting(tests={
     9343    FlatteningTestCase(
     9344        name="UnknownArray3",
     9345        description="Using functions with unknown array sizes: indirect dependency",
     9346        variability_propagation=false,
     9347        flatModel="
    94809348fclass FunctionTests.UnknownArray3
    94819349 Real x[3] = FunctionTests.UnknownArray3.f({1, 2, 3});
     
    94909358  init b as Real[size(c, 1)];
    94919359  init c as Real[size(a, 1)];
    9492   b[:] := a[:];
     9360  b := a;
    94939361  return;
    94949362 end FunctionTests.UnknownArray3.f;
     
    95109378 Real y[2] = f({4,5});
    95119379
    9512     annotation(__JModelica(UnitTesting(tests={
    9513         FlatteningTestCase(
    9514             name="UnknownArray4",
    9515             description="Using functions with unknown array sizes: indirect dependency from binding exp",
    9516             variability_propagation=false,
    9517             flatModel="
     9380annotation(__JModelica(UnitTesting(tests={
     9381    FlatteningTestCase(
     9382        name="UnknownArray4",
     9383        description="Using functions with unknown array sizes: indirect dependency from binding exp",
     9384        variability_propagation=false,
     9385        flatModel="
    95189386fclass FunctionTests.UnknownArray4
    95199387 Real x[3] = FunctionTests.UnknownArray4.f({1, 2, 3});
     
    95279395 algorithm
    95289396  init b as Real[size(a, 1)];
    9529   b := c[:];
     9397  b := c;
    95309398  init c as Real[size(a, 1)];
    9531   c := a[:];
     9399  c := a;
    95329400  return;
    95339401 end FunctionTests.UnknownArray4.f;
     
    95519419 (x, y) = f({1,2,3});
    95529420
    9553     annotation(__JModelica(UnitTesting(tests={
    9554         FlatteningTestCase(
    9555             name="UnknownArray5",
    9556             description="Using functions with unknown array sizes: multiple outputs",
    9557             variability_propagation=false,
    9558             flatModel="
     9421annotation(__JModelica(UnitTesting(tests={
     9422    FlatteningTestCase(
     9423        name="UnknownArray5",
     9424        description="Using functions with unknown array sizes: multiple outputs",
     9425        variability_propagation=false,
     9426        flatModel="
    95599427fclass FunctionTests.UnknownArray5
    95609428 Real x[3];
     
    95709438 algorithm
    95719439  init b as Real[size(a, 1)];
    9572   b := c[:];
     9440  b := c;
    95739441  init c as Real[size(a, 1)];
    9574   c := a[:];
     9442  c := a;
    95759443  return;
    95769444 end FunctionTests.UnknownArray5.f;
     
    96729540 Real x[5,2] = f({{1,2},{3,4}}, {{5,6},{7,8},{9,0}});
    96739541
    9674     annotation(__JModelica(UnitTesting(tests={
    9675         FlatteningTestCase(
    9676             name="UnknownArray9",
    9677             description="Unknown size calculated by adding sizes",
    9678             variability_propagation=false,
    9679             flatModel="
     9542annotation(__JModelica(UnitTesting(tests={
     9543    FlatteningTestCase(
     9544        name="UnknownArray9",
     9545        description="Unknown size calculated by adding sizes",
     9546        variability_propagation=false,
     9547        flatModel="
    96809548fclass FunctionTests.UnknownArray9
    96819549 Real x[5,2] = FunctionTests.UnknownArray9.f({{1, 2}, {3, 4}}, {{5, 6}, {7, 8}, {9, 0}});
     
    96929560  init c as Real[size(d, 1), size(d, 2)];
    96939561  init d as Real[size(a, 1) + size(b, 1), size(a, 2)];
    9694   d := cat(1, a[:,:], b[:,:]);
     9562  d := cat(1, a, b);
    96959563  init e as Real[size(a, 1) + size(b, 1), size(a, 2)];
    9696   e := [a[:,:]; b[:,:]];
    9697   c[:,:] := d[:,:];
     9564  e := [a; b];
     9565  c := d;
    96989566  return;
    96999567 end FunctionTests.UnknownArray9.f;
     
    97149582 Real x[2] = f({1,2});
    97159583
    9716     annotation(__JModelica(UnitTesting(tests={
    9717         TransformCanonicalTestCase(
    9718             name="UnknownArray10",
    9719             description="Scalarization of operations on arrays of unknown size: assignment",
    9720             variability_propagation=false,
    9721             inline_functions="none",
    9722             flatModel="
     9584annotation(__JModelica(UnitTesting(tests={
     9585    TransformCanonicalTestCase(
     9586        name="UnknownArray10",
     9587        description="Scalarization of operations on arrays of unknown size: assignment",
     9588        variability_propagation=false,
     9589        inline_functions="none",
     9590        flatModel="
    97239591fclass FunctionTests.UnknownArray10
    97249592 Real x[1];
     
    97339601 algorithm
    97349602  init b as Real[size(a, 1)];
    9735   for i1 in 1:size(a, 1) loop
    9736    b[i1] := a[i1];
    9737   end for;
     9603  b := a;
    97389604  return;
    97399605 end FunctionTests.UnknownArray10.f;
     
    97539619 Real x[2] = f({1,2});
    97549620
    9755     annotation(__JModelica(UnitTesting(tests={
    9756         TransformCanonicalTestCase(
    9757             name="UnknownArray11",
    9758             description="Scalarization of operations on arrays of unknown size: binding expression",
    9759             variability_propagation=false,
    9760             inline_functions="none",
    9761             flatModel="
     9621annotation(__JModelica(UnitTesting(tests={
     9622    TransformCanonicalTestCase(
     9623        name="UnknownArray11",
     9624        description="Scalarization of operations on arrays of unknown size: binding expression",
     9625        variability_propagation=false,
     9626        inline_functions="none",
     9627        flatModel="
    97629628fclass FunctionTests.UnknownArray11
    97639629 Real x[1];
     
    97729638 algorithm
    97739639  init b as Real[size(a, 1)];
    9774   for i1 in 1:size(a, 1) loop
    9775    b[i1] := a[i1];
    9776   end for;
     9640  b := a;
    97779641  return;
    97789642 end FunctionTests.UnknownArray11.f;
     
    98809744 Real x[2,2] = f({{1,2},{3,4}}, {{5,6},{7,8}});
    98819745
    9882     annotation(__JModelica(UnitTesting(tests={
    9883         TransformCanonicalTestCase(
    9884             name="UnknownArray14",
    9885             description="Scalarization of operations on arrays of unknown size: matrix multiplication",
    9886             variability_propagation=false,
    9887             flatModel="
     9746annotation(__JModelica(UnitTesting(tests={
     9747    TransformCanonicalTestCase(
     9748        name="UnknownArray14",
     9749        description="Scalarization of operations on arrays of unknown size: matrix multiplication",
     9750        variability_propagation=false,
     9751        flatModel="
    98889752fclass FunctionTests.UnknownArray14
    98899753 Real x[1,1];
     
    99139777   end for;
    99149778  end for;
    9915   for i1 in 1:size(a, 1) loop
    9916    for i2 in 1:size(b, 2) loop
    9917     o[i1,i2] := temp_1[i1,i2];
    9918    end for;
    9919   end for;
     9779  o := temp_1;
    99209780  return;
    99219781 end FunctionTests.UnknownArray14.f;
     
    100309890 Real x[2,2] = f(y, y, y);
    100319891
    10032     annotation(__JModelica(UnitTesting(tests={
    10033         TransformCanonicalTestCase(
    10034             name="UnknownArray17",
    10035             description="Scalarization of operations on arrays of unknown size: nestled multiplications",
    10036             variability_propagation=false,
    10037             flatModel="
     9892annotation(__JModelica(UnitTesting(tests={
     9893    TransformCanonicalTestCase(
     9894        name="UnknownArray17",
     9895        description="Scalarization of operations on arrays of unknown size: nestled multiplications",
     9896        variability_propagation=false,
     9897        flatModel="
    100389898fclass FunctionTests.UnknownArray17
    100399899 Real y[1,1];
     
    100849944   end for;
    100859945  end for;
    10086   for i1 in 1:size(a, 1) loop
    10087    for i2 in 1:size(c, 2) loop
    10088     o[i1,i2] := temp_1[i1,i2];
    10089    end for;
    10090   end for;
     9946  o := temp_1;
    100919947  return;
    100929948 end FunctionTests.UnknownArray17.f;
     
    1035010206    Real x[3,2] = f({{5,6},{7,8},{9,0}});
    1035110207
    10352     annotation(__JModelica(UnitTesting(tests={
    10353         TransformCanonicalTestCase(
    10354             name="UnknownArray24",
    10355             description="Using array constructors with inputs of unknown size",
    10356             variability_propagation=false,
    10357             flatModel="
     10208annotation(__JModelica(UnitTesting(tests={
     10209    TransformCanonicalTestCase(
     10210        name="UnknownArray24",
     10211        description="Using array constructors with inputs of unknown size",
     10212        variability_propagation=false,
     10213        flatModel="
    1035810214fclass FunctionTests.UnknownArray24
    1035910215 Real x[1,1];
     
    1040010256   end for;
    1040110257  end for;
    10402   for i1 in 1:size(x, 1) loop
    10403    for i2 in 1:2 loop
    10404     y[i1,i2] := temp_1[i1,i2];
    10405    end for;
    10406   end for;
     10258  y := temp_1;
    1040710259  return;
    1040810260 end FunctionTests.UnknownArray24.f;
     
    1068310535    Real[2] x = f2({1,2});
    1068410536
    10685     annotation(__JModelica(UnitTesting(tests={
    10686         TransformCanonicalTestCase(
    10687             name="UnknownArray31",
    10688             description="Assignstatement with right hand side function call.",
    10689             variability_propagation=false,
    10690             flatModel="
     10537annotation(__JModelica(UnitTesting(tests={
     10538    TransformCanonicalTestCase(
     10539        name="UnknownArray31",
     10540        description="Assignstatement with right hand side function call.",
     10541        variability_propagation=false,
     10542        flatModel="
    1069110543fclass FunctionTests.UnknownArray31
    1069210544 Real x[1];
    1069310545 Real x[2];
    1069410546equation
    10695  ({x[1], x[2]}) = FunctionTests.UnknownArray31.f2({1, 2});
    10696 
    10697 public
    10698  function FunctionTests.UnknownArray31.f2
    10699   input Real[:] c;
    10700   output Real[:] d;
    10701  algorithm
    10702   init d as Real[size(c, 1)];
    10703   (d) := FunctionTests.UnknownArray31.f1(c);
    10704   return;
    10705  end FunctionTests.UnknownArray31.f2;
    10706 
    10707  function FunctionTests.UnknownArray31.f1
    10708   input Real[:] a;
    10709   output Real[:] b;
    10710  algorithm
    10711   init b as Real[size(a, 1)];
    10712   for i1 in 1:size(a, 1) loop
    10713    b[i1] := 2 * a[i1];
    10714   end for;
    10715   return;
    10716  end FunctionTests.UnknownArray31.f1;
    10717 
     10547 x[1] = 2.0;
     10548 x[2] = 4.0;
    1071810549end FunctionTests.UnknownArray31;
    1071910550")})));
     
    1079410625    (x,y) = f(f2(f2({time,time*2})));
    1079510626
    10796     annotation(__JModelica(UnitTesting(tests={
    10797         TransformCanonicalTestCase(
    10798             name="UnknownArray33",
    10799             description="Check extraction of function calls in function call equations",
    10800             variability_propagation=false,
    10801             inline_functions="none",
    10802             flatModel="
     10627annotation(__JModelica(UnitTesting(tests={
     10628    TransformCanonicalTestCase(
     10629        name="UnknownArray33",
     10630        description="Check extraction of function calls in function call equations",
     10631        variability_propagation=false,
     10632        inline_functions="none",
     10633        flatModel="
    1080310634fclass FunctionTests.UnknownArray33
    1080410635 Real x;
     
    1081810649  init temp_1 as Real[2];
    1081910650  (temp_1) := FunctionTests.UnknownArray33.f2(FunctionTests.UnknownArray33.f2(a));
    10820   for i1 in 1:2 loop
    10821    c.x[i1] := temp_1[i1];
    10822   end for;
     10651  c.x := temp_1;
    1082310652  return;
    1082410653 end FunctionTests.UnknownArray33.f;
     
    1082910658 algorithm
    1083010659  init b as Real[size(a, 1)];
    10831   for i1 in 1:size(a, 1) loop
    10832    b[i1] := a[i1];
    10833   end for;
     10660  b := a;
    1083410661  return;
    1083510662 end FunctionTests.UnknownArray33.f2;
     
    1085810685    Real x = f(3);
    1085910686   
    10860     annotation(__JModelica(UnitTesting(tests={
    10861         TransformCanonicalTestCase(
    10862             name="UnknownArray34",
    10863             description="Known to unknown size assignment",
    10864             variability_propagation=false,
    10865             inline_functions="none",
    10866             flatModel="
     10687annotation(__JModelica(UnitTesting(tests={
     10688    TransformCanonicalTestCase(
     10689        name="UnknownArray34",
     10690        description="Known to unknown size assignment",
     10691        variability_propagation=false,
     10692        inline_functions="none",
     10693        flatModel="
    1086710694fclass FunctionTests.UnknownArray34
    1086810695 Real x;
     
    1088510712  temp_1[2] := 2;
    1088610713  temp_1[3] := 3;
    10887   for i1 in 1:n loop
    10888    d[i1] := temp_1[i1];
    10889   end for;
     10714  d := temp_1;
    1089010715  assert(n == 3, \"Mismatching sizes in FunctionTests.UnknownArray34.f\");
    10891   for i1 in 1:3 loop
    10892    c[i1] := d[i1];
    10893   end for;
     10716  c := d;
    1089410717  b := 1;
    1089510718  return;
     
    1091410737    Real x = f(3, {1,2,3});
    1091510738   
    10916     annotation(__JModelica(UnitTesting(tests={
    10917         TransformCanonicalTestCase(
    10918             name="UnknownArray35",
    10919             description="Known to unknown size assignment",
    10920             variability_propagation=false,
    10921             inline_functions="none",
    10922             flatModel="
     10739annotation(__JModelica(UnitTesting(tests={
     10740    TransformCanonicalTestCase(
     10741        name="UnknownArray35",
     10742        description="Known to unknown size assignment",
     10743        variability_propagation=false,
     10744        inline_functions="none",
     10745        flatModel="
    1092310746fclass FunctionTests.UnknownArray35
    1092410747 Real x;
     
    1094710770   temp_1[3,i1] := d[i1];
    1094810771  end for;
    10949   for i1 in 1:n loop
    10950    for i2 in 1:3 loop
    10951     e[i1,i2] := temp_1[i1,i2];
    10952    end for;
    10953   end for;
     10772  e := temp_1;
    1095410773  b := 1;
    1095510774  return;
     
    1098410803    Real x = f1(2);
    1098510804   
    10986     annotation(__JModelica(UnitTesting(tests={
    10987         TransformCanonicalTestCase(
    10988             name="UnknownArray36",
    10989             description="Known to unknown size assignment",
    10990             variability_propagation=false,
    10991             inline_functions="none",
    10992             flatModel="
     10805annotation(__JModelica(UnitTesting(tests={
     10806    TransformCanonicalTestCase(
     10807        name="UnknownArray36",
     10808        description="Known to unknown size assignment",
     10809        variability_propagation=false,
     10810        inline_functions="none",
     10811        flatModel="
    1099310812fclass FunctionTests.UnknownArray36
    1099410813 Real x;
     
    1101310832  end for;
    1101410833  assert(n == 2, \"Mismatching sizes in FunctionTests.UnknownArray36.f1\");
    11015   for i1 in 1:2 loop
    11016    c[i1] := d[i1];
    11017   end for;
     10834  c := d;
    1101810835  assert(n == 2, \"Mismatching sizes in FunctionTests.UnknownArray36.f1\");
    1101910836  (c, d) := FunctionTests.UnknownArray36.f2(c, d);
     
    1103010847  init xout as Real[size(xin, 1)];
    1103110848  assert(size(xin, 1) == 2, \"Mismatching sizes in FunctionTests.UnknownArray36.f2\");
    11032   for i1 in 1:size(xin, 1) loop
    11033    xout[i1] := yin[i1];
    11034   end for;
     10849  xout := yin;
    1103510850  init yout as Real[2];
    1103610851  assert(size(xin, 1) == 2, \"Mismatching sizes in FunctionTests.UnknownArray36.f2\");
    11037   for i1 in 1:2 loop
    11038    yout[i1] := xin[i1];
    11039   end for;
     10852  yout := xin;
    1104010853  return;
    1104110854 end FunctionTests.UnknownArray36.f2;
     
    1106810881    Real x = f1(2, {{1,2},{3,4}});
    1106910882   
    11070     annotation(__JModelica(UnitTesting(tests={
    11071         TransformCanonicalTestCase(
    11072             name="UnknownArray37",
    11073             description="Known to unknown size assignment",
    11074             variability_propagation=false,
    11075             inline_functions="none",
    11076             flatModel="
     10883annotation(__JModelica(UnitTesting(tests={
     10884    TransformCanonicalTestCase(
     10885        name="UnknownArray37",
     10886        description="Known to unknown size assignment",
     10887        variability_propagation=false,
     10888        inline_functions="none",
     10889        flatModel="
    1107710890fclass FunctionTests.UnknownArray37
    1107810891 Real x;
     
    1108910902  init c as Real[2, n];
    1109010903  assert(size(d, 1) == 2, \"Mismatching sizes in FunctionTests.UnknownArray37.f1\");
    11091   for i1 in 1:2 loop
    11092    for i2 in 1:n loop
    11093     c[i1,i2] := d[i1,i2];
    11094    end for;
    11095   end for;
     10904  c := d;
    1109610905  assert(size(d, 1) == 2, \"Mismatching sizes in FunctionTests.UnknownArray37.f1\");
    1109710906  assert(size(d, 2) == 2, \"Mismatching sizes in FunctionTests.UnknownArray37.f1\");
     
    1110910918  init xout as Real[size(xin, 1), size(xin, 2)];
    1111010919  assert(size(xin, 1) == 2, \"Mismatching sizes in FunctionTests.UnknownArray37.f2\");
    11111   for i1 in 1:size(xin, 1) loop
    11112    for i2 in 1:size(xin, 2) loop
    11113     xout[i1,i2] := yin[i1,i2];
    11114    end for;
    11115   end for;
     10920  xout := yin;
    1111610921  init yout as Real[2, 2];
    1111710922  assert(size(xin, 1) == 2, \"Mismatching sizes in FunctionTests.UnknownArray37.f2\");
    1111810923  assert(size(xin, 2) == 2, \"Mismatching sizes in FunctionTests.UnknownArray37.f2\");
    11119   for i1 in 1:2 loop
    11120    for i2 in 1:2 loop
    11121     yout[i1,i2] := xin[i1,i2];
    11122    end for;
    11123   end for;
     10924  yout := xin;
    1112410925  return;
    1112510926 end FunctionTests.UnknownArray37.f2;
     
    1114410945    Real x = f(3, {1,2,3});
    1114510946   
    11146     annotation(__JModelica(UnitTesting(tests={
    11147         TransformCanonicalTestCase(
    11148             name="UnknownArray38",
    11149             description="Checks a more complex combination of known/unknown sizes",
    11150             variability_propagation=false,
    11151             inline_functions="none",
    11152             flatModel="
     10947annotation(__JModelica(UnitTesting(tests={
     10948    TransformCanonicalTestCase(
     10949        name="UnknownArray38",
     10950        description="Checks a more complex combination of known/unknown sizes",
     10951        variability_propagation=false,
     10952        inline_functions="none",
     10953        flatModel="
    1115310954fclass FunctionTests.UnknownArray38
    1115410955 Real x;
     
    1118910990   temp_1[3,i1] := d[i1];
    1119010991  end for;
    11191   for i1 in 1:n loop
    11192    for i2 in 1:3 loop
    11193     e[i1,i2] := temp_1[i1,i2];
    11194    end for;
    11195   end for;
     10992  e := temp_1;
    1119610993  assert(n == 1, \"Mismatching sizes in FunctionTests.UnknownArray38.f\");
    1119710994  init temp_2 as Real[n, 1];
     
    1124211039   end for;
    1124311040  end for;
    11244   for i1 in 1:1 loop
    11245    for i2 in 1:1 loop
    11246     c[i1,i2] := temp_2[i1,i2];
    11247    end for;
    11248   end for;
     11041  c := temp_2;
    1124911042  b := 1;
    1125011043  return;
     
    1132511118    R[1] r = f({R({2,3})});
    1132611119   
    11327     annotation(__JModelica(UnitTesting(tests={
    11328         TransformCanonicalTestCase(
    11329             name="UnknownArray40",
    11330             description="Unknown size record array",
    11331             variability_propagation=false,
    11332             inline_functions="none",
    11333             flatModel="
     11120annotation(__JModelica(UnitTesting(tests={
     11121    TransformCanonicalTestCase(
     11122        name="UnknownArray40",
     11123        description="Unknown size record array",
     11124        variability_propagation=false,
     11125        inline_functions="none",
     11126        flatModel="
    1133411127fclass FunctionTests.UnknownArray40
    1133511128 Real r[1].y[1];
     
    1134811141  end for;
    1134911142  for i1 in 1:size(i, 1) loop
    11350    for i2 in 1:2 loop
    11351     o[i1].y[i2] := i[i1].y[i2];
    11352    end for;
     11143   o[i1].y := i[i1].y;
    1135311144  end for;
    1135411145  for i1 in 1:size(i, 1) loop
    11355    for i2 in 1:2 loop
    11356     o[i1].y[i2] := i[i1].y[i2];
    11357    end for;
     11146   o[i1].y := i[i1].y;
    1135811147  end for;
    1135911148  for i1 in 1:size(i, 1) loop
    11360    for i2 in 1:2 loop
    11361     o[i1].y[i2] := i[i1].y[i2];
    11362    end for;
     11149   o[i1].y := i[i1].y;
    1136311150  end for;
    1136411151  for i1 in 1:size(i, 1) loop
    11365    for i2 in 1:2 loop
    11366     o[i1].y[i2] := i[i1].y[i2];
    11367    end for;
     11152   o[i1].y := i[i1].y;
    1136811153  end for;
    1136911154  return;
     
    1147011255    R1[1] c = f(1);
    1147111256   
    11472     annotation(__JModelica(UnitTesting(tests={
    11473         TransformCanonicalTestCase(
    11474             name="UnknownArray42",
    11475             description="Unknown size record array",
    11476             variability_propagation=false,
    11477             inline_functions="none",
    11478             flatModel="
     11257annotation(__JModelica(UnitTesting(tests={
     11258    TransformCanonicalTestCase(
     11259        name="UnknownArray42",
     11260        description="Unknown size record array",
     11261        variability_propagation=false,
     11262        inline_functions="none",
     11263        flatModel="
    1147911264fclass FunctionTests.UnknownArray42
    1148011265 Real c[1].y[1].p1[1];
     
    1150611291  for i1 in 1:m loop
    1150711292   for i2 in 1:1 loop
    11508     for i3 in 1:1 loop
    11509      o[i1].y[i2].p1[i3] := temp_1[i1].y[i2].p1[i3];
    11510     end for;
     11293    o[i1].y[i2].p1 := temp_1[i1].y[i2].p1;
    1151111294    o[i1].y[i2].p2 := temp_1[i1].y[i2].p2;
    1151211295   end for;
    11513    for i2 in 1:1 loop
    11514     o[i1].z.p1[i2] := temp_1[i1].z.p1[i2];
    11515    end for;
     11296   o[i1].z.p1 := temp_1[i1].z.p1;
    1151611297   o[i1].z.p2 := temp_1[i1].z.p2;
    1151711298  end for;
     
    1155611337    R1 r = f({3,4});
    1155711338   
    11558     annotation(__JModelica(UnitTesting(tests={
    11559         TransformCanonicalTestCase(
    11560             name="UnknownArray43",
    11561             description="Unknown size array in record constructor",
    11562             variability_propagation=false,
    11563             inline_functions="none",
    11564             flatModel="
     11339annotation(__JModelica(UnitTesting(tests={
     11340    TransformCanonicalTestCase(
     11341        name="UnknownArray43",
     11342        description="Unknown size array in record constructor",
     11343        variability_propagation=false,
     11344        inline_functions="none",
     11345        flatModel="
    1156511346fclass FunctionTests.UnknownArray43
    1156611347 Real r.x[1];
     
    1157511356 algorithm
    1157611357  assert(size(x, 1) == 2, \"Mismatching sizes in FunctionTests.UnknownArray43.f\");
    11577   for i1 in 1:2 loop
    11578    r.x[i1] := x[i1];
    11579   end for;
     11358  r.x := x;
    1158011359  return;
    1158111360 end FunctionTests.UnknownArray43.f;
     
    1160411383    R2 r = f({R1({3}),R1({4})});
    1160511384   
    11606     annotation(__JModelica(UnitTesting(tests={
    11607         TransformCanonicalTestCase(
    11608             name="UnknownArray44",
    11609             description="Unknown size record array in record constructor",
    11610             variability_propagation=false,
    11611             inline_functions="none",
    11612             flatModel="
     11385annotation(__JModelica(UnitTesting(tests={
     11386    TransformCanonicalTestCase(
     11387        name="UnknownArray44",
     11388        description="Unknown size record array in record constructor",
     11389        variability_propagation=false,
     11390        inline_functions="none",
     11391        flatModel="
    1161311392fclass FunctionTests.UnknownArray44
    1161411393 Real r.y[1].x[1];
     
    1162611405  assert(size(r1, 1) == 1, \"Mismatching sizes in FunctionTests.UnknownArray44.f\");
    1162711406  for i1 in 1:1 loop
    11628    for i2 in 1:1 loop
    11629     r2.y[i1].x[i2] := r1[i1].x[i2];
    11630    end for;
     11407   r2.y[i1].x := r1[i1].x;
    1163111408  end for;
    1163211409  return;
     
    1171711494    Real[1] y = f1({1});
    1171811495   
    11719     annotation(__JModelica(UnitTesting(tests={
    11720         TransformCanonicalTestCase(
    11721             name="UnknownArray46",
    11722             description="Unknown size if exp as function call arg",
    11723             variability_propagation=false,
    11724             inline_functions="none",
    11725             flatModel="
     11496annotation(__JModelica(UnitTesting(tests={
     11497    TransformCanonicalTestCase(
     11498        name="UnknownArray46",
     11499        description="Unknown size if exp as function call arg",
     11500        variability_propagation=false,
     11501        inline_functions="none",
     11502        flatModel="
    1172611503fclass FunctionTests.UnknownArray46
    1172711504 Real y[1];
     
    1175211529 algorithm
    1175311530  init y as Real[size(x, 1)];
    11754   for i1 in 1:size(x, 1) loop
    11755    y[i1] := x[i1];
    11756   end for;
     11531  y := x;
    1175711532  return;
    1175811533 end FunctionTests.UnknownArray46.f2;
     
    1177811553    Real[1] y = f1({time});
    1177911554   
    11780     annotation(__JModelica(UnitTesting(tests={
    11781         TransformCanonicalTestCase(
    11782             name="UnknownArray47",
    11783             description="Test flattening of function call sizes with unknown size args #3806",
    11784             flatModel="
     11555annotation(__JModelica(UnitTesting(tests={
     11556    TransformCanonicalTestCase(
     11557        name="UnknownArray47",
     11558        description="Test flattening of function call sizes with unknown size args #3806",
     11559        flatModel="
    1178511560fclass FunctionTests.UnknownArray47
    1178611561 Real y[1];
     
    1181411589 algorithm
    1181511590  init b as Real[size(a, 1)];
    11816   for i1 in 1:size(a, 1) loop
    11817    b[i1] := a[i1];
    11818   end for;
     11591  b := a;
    1181911592  return;
    1182011593 end FunctionTests.UnknownArray47.f2;
     
    1183511608    Real[1,1] y = f({{time}});
    1183611609   
    11837     annotation(__JModelica(UnitTesting(tests={
    11838         TransformCanonicalTestCase(
    11839             name="UnknownArray48",
    11840             description="Scalarizing known size mul exp with unknown size parts as rhs of assigment. #3788",
    11841             flatModel="
     11610annotation(__JModelica(UnitTesting(tests={
     11611    TransformCanonicalTestCase(
     11612        name="UnknownArray48",
     11613        description="Scalarizing known size mul exp with unknown size parts as rhs of assigment. #3788",
     11614        flatModel="
    1184211615fclass FunctionTests.UnknownArray48
    1184311616 Real y[1,1];
     
    1186311636   end for;
    1186411637  end for;
    11865   for i1 in 1:1 loop
    11866    for i2 in 1:1 loop
    11867     y[i1,i2] := temp_1[i1,i2];
    11868    end for;
    11869   end for;
     11638  y := temp_1;
    1187011639  return;
    1187111640 annotation(Inline = false);
     
    1202811797    end F;
    1202911798    R r = F({(sin(time) + 1) / 2});
    12030     annotation(__JModelica(UnitTesting(tests={
    12031         TransformCanonicalTestCase(
    12032             name="UnknownArray53",
    12033             description="Bug in #5272",
    12034             inline_functions="none",
    12035             flatModel="
     11799annotation(__JModelica(UnitTesting(tests={
     11800    TransformCanonicalTestCase(
     11801        name="UnknownArray53",
     11802        description="Bug in #5272",
     11803        inline_functions="none",
     11804        flatModel="
    1203611805fclass FunctionTests.UnknownArray53
    1203711806 Real r.a[1];
     
    1206211831   temp_1[i1 + size(X, 1)] := temp_2[i1];
    1206311832  end for;
    12064   for i1 in 1:2 loop
    12065    r.a[i1] := temp_1[i1];
    12066   end for;
     11833  r.a := temp_1;
    1206711834  return;
    1206811835 end FunctionTests.UnknownArray53.F;
     
    1285312620    Real x[2](start = f()) = {3, 4};
    1285412621
    12855     annotation(__JModelica(UnitTesting(tests={
    12856         TransformCanonicalTestCase(
    12857             name="AttributeTemp1",
    12858             description="Temporary variable for attribute",
    12859             variability_propagation=false,
    12860             inline_functions="none",
    12861             flatModel="
     12622annotation(__JModelica(UnitTesting(tests={
     12623    TransformCanonicalTestCase(
     12624        name="AttributeTemp1",
     12625        description="Temporary variable for attribute",
     12626        variability_propagation=false,
     12627        inline_functions="none",
     12628        flatModel="
    1286212629fclass FunctionTests.AttributeTemp1
    1286312630 Real x[1](start = temp_1[1]);
     
    1288012647  temp_1[1] := 1;
    1288112648  temp_1[2] := 2;
    12882   for i1 in 1:2 loop
    12883    o[i1] := temp_1[i1];
    12884   end for;
     12649  o := temp_1;
    1288512650  return;
    1288612651 end FunctionTests.AttributeTemp1.f;
     
    1325813023    Real x = sum(f(p));
    1325913024
    13260     annotation(__JModelica(UnitTesting(tests={
    13261         FlatteningTestCase(
    13262             name="InputAsArraySize13",
    13263             description="Parameters that decide size of array expression should be structural",
    13264             flatModel="
     13025annotation(__JModelica(UnitTesting(tests={
     13026    FlatteningTestCase(
     13027        name="InputAsArraySize13",
     13028        description="Parameters that decide size of array expression should be structural",
     13029        flatModel="
    1326513030fclass FunctionTests.InputAsArraySize13
    1326613031 structural parameter Integer p = 3 /* 3 */;
     
    1327313038 algorithm
    1327413039  init y as Real[n];
    13275   y[:] := 1:n;
     13040  y := 1:n;
    1327613041  return;
    1327713042 end FunctionTests.InputAsArraySize13.f;
     
    1330013065    (x, y) = f(p1, p2);
    1330113066
    13302     annotation(__JModelica(UnitTesting(tests={
    13303         FlatteningTestCase(
    13304             name="InputAsArraySize14",
    13305             description="Parameters that decide size of array expression should be structural",
    13306             flatModel="
     13067annotation(__JModelica(UnitTesting(tests={
     13068    FlatteningTestCase(
     13069        name="InputAsArraySize14",
     13070        description="Parameters that decide size of array expression should be structural",
     13071        flatModel="
    1330713072fclass FunctionTests.InputAsArraySize14
    1330813073 structural parameter Integer p1 = 2 /* 2 */;
     
    1332213087  init y as Real[n];
    1332313088  init z as Real[m];
    13324   y[:] := 1:n;
    13325   y[:] := 1:m;
     13089  y := 1:n;
     13090  y := 1:m;
    1332613091  return;
    1332713092 end FunctionTests.InputAsArraySize14.f;
     
    1334713112    Real x = sum(f(p1, p2));
    1334813113
    13349     annotation(__JModelica(UnitTesting(tests={
    13350         FlatteningTestCase(
    13351             name="InputAsArraySize15",
    13352             description="Parameters that decide size of array expression should be structural",
    13353             flatModel="
     13114annotation(__JModelica(UnitTesting(tests={
     13115    FlatteningTestCase(
     13116        name="InputAsArraySize15",
     13117        description="Parameters that decide size of array expression should be structural",
     13118        flatModel="
    1335413119fclass FunctionTests.InputAsArraySize15
    1335513120 structural parameter Integer p1 = 2 /* 2 */;
     
    1336613131  init y as Real[n];
    1336713132  init z as Real[m];
    13368   y[:] := 1:n;
    13369   y[:] := 1:m;
     13133  y := 1:n;
     13134  y := 1:m;
    1337013135  return;
    1337113136 end FunctionTests.InputAsArraySize15.f;
     
    1359313358  (QR,tau,) = Modelica.Math.Matrices.LAPACK.dgeqpf(A);
    1359413359
    13595     annotation(__JModelica(UnitTesting(tests={
    13596         TransformCanonicalTestCase(
    13597             name="Lapack_dgeqpf",
    13598             description="Test scalarization of LAPACK function that has had some issues",
    13599             variability_propagation=false,
    13600             flatModel="
     13360annotation(__JModelica(UnitTesting(tests={
     13361    TransformCanonicalTestCase(
     13362        name="Lapack_dgeqpf",
     13363        description="Test scalarization of LAPACK function that has had some issues",
     13364        variability_propagation=false,
     13365        flatModel="
    1360113366fclass FunctionTests.Lapack_dgeqpf
    1360213367 Real A[1,1];
     
    1362913394 algorithm
    1363013395  init QR as Real[size(A, 1), size(A, 2)];
    13631   for i1 in 1:size(A, 1) loop
    13632    for i2 in 1:size(A, 2) loop
    13633     QR[i1,i2] := A[i1,i2];
    13634    end for;
    13635   end for;
     13396  QR := A;
    1363613397  init tau as Real[min(size(A, 1), size(A, 2))];
    1363713398  init p as Integer[size(A, 2)];
     
    1365813419 (Q,R,) = Modelica.Math.Matrices.QR(A);
    1365913420
    13660     annotation(__JModelica(UnitTesting(tests={
    13661         TransformCanonicalTestCase(
    13662             name="Lapack_QR",
    13663             description="",
    13664             variability_propagation=false,
    13665             flatModel="
     13421annotation(__JModelica(UnitTesting(tests={
     13422    TransformCanonicalTestCase(
     13423        name="Lapack_QR",
     13424        description="",
     13425        variability_propagation=false,
     13426        flatModel="
    1366613427fclass FunctionTests.Lapack_QR
    1366713428 Real A[1,1];
     
    1373613497 algorithm
    1373713498  init QR as Real[size(A, 1), size(A, 2)];
    13738   for i1 in 1:size(A, 1) loop
    13739    for i2 in 1:size(A, 2) loop
    13740     QR[i1,i2] := A[i1,i2];
    13741    end for;
    13742   end for;
     13499  QR := A;
    1374313500  init tau as Real[min(size(A, 1), size(A, 2))];
    1374413501  init p as Integer[size(A, 2)];
     
    1376513522 algorithm
    1376613523  init Aout as Real[size(A, 1), size(A, 2)];
    13767   for i1 in 1:size(A, 1) loop
    13768    for i2 in 1:size(A, 2) loop
    13769     Aout[i1,i2] := A[i1,i2];
    13770    end for;
    13771   end for;
     13524  Aout := A;
    1377213525  init tau as Real[min(size(A, 1), size(A, 2))];
    1377313526  init work as Real[3 * max(1, size(A, 2))];
     
    1379013543 algorithm
    1379113544  init Q as Real[size(QR, 1), size(QR, 2)];
    13792   for i1 in 1:size(QR, 1) loop
    13793    for i2 in 1:size(QR, 2) loop
    13794     Q[i1,i2] := QR[i1,i2];
    13795    end for;
    13796   end for;
     13545  Q := QR;
    1379713546  lda := max(1, size(Q, 1));
    1379813547  lwork := max(1, min(10, size(QR, 2)) * size(QR, 2));
     
    1446614215  temp_1 := temp_2;
    1446714216  init y as Real[temp_1];
    14468   for i1 in 1:temp_1 loop
    14469    y[i1] := x[i1];
    14470   end for;
     14217  y := x;
    1447114218  return;
    1447214219 end FunctionTests.UnknownSize.FuncCallInSize.WithTemporary.g;
     
    1448114228  temp_1[1] := size(x, 1);
    1448214229  temp_1[2] := size(x, 1);
    14483   for i1 in 1:2 loop
    14484    n[i1] := temp_1[i1];
    14485   end for;
     14230  n := temp_1;
    1448614231  return;
    1448714232 end FunctionTests.UnknownSize.FuncCallInSize.WithTemporary.s;
     
    1457914324  output Real c;
    1458014325 algorithm
    14581   assert(size(a, 1) == 1, \"Mismatching size in dimension 1 of expression scalar(a[:,:]) in function FunctionTests.UnknownSize.Hidden.Scalar1.f\");
    14582   assert(size(a, 2) == 1, \"Mismatching size in dimension 2 of expression scalar(a[:,:]) in function FunctionTests.UnknownSize.Hidden.Scalar1.f\");
     14326  assert(size(a, 1) == 1, \"Mismatching size in dimension 1 of expression scalar(a) in function FunctionTests.UnknownSize.Hidden.Scalar1.f\");
     14327  assert(size(a, 2) == 1, \"Mismatching size in dimension 2 of expression scalar(a) in function FunctionTests.UnknownSize.Hidden.Scalar1.f\");
    1458314328  c := 2 * a[1,1];
    1458414329  return;
     
    1461914364  init c as Real[2];
    1462014365  assert(2 * size(a, 2) == 2, \"Mismatching sizes in FunctionTests.UnknownSize.Hidden.Vector1.f\");
    14621   assert(2 * size(a, 2) <= 2 + size(a, 2) - 2 + 1, \"Mismatching size in expression vector(a[1:2,:]) in function FunctionTests.UnknownSize.Hidden.Vector1.f\");
     14366  assert(2 * size(a, 2) <= 2 + size(a, 2) - 2 + 1, \"Mismatching size in expression vector(a) in function FunctionTests.UnknownSize.Hidden.Vector1.f\");
    1462214367  init temp_1 as Real[2 * size(a, 2)];
    1462314368  for i1 in 1:2 loop
     
    1466414409 algorithm
    1466514410  init c as Real[1, 1];
    14666   assert(size(a, 3) == 1, \"Mismatching size in dimension 3 of expression matrix(a[1:1,1:1,:]) in function FunctionTests.UnknownSize.Hidden.Matrix1.f\");
     14411  assert(size(a, 3) == 1, \"Mismatching size in dimension 3 of expression matrix(a) in function FunctionTests.UnknownSize.Hidden.Matrix1.f\");
    1466714412  init temp_1 as Real[1, 1];
    1466814413  for i1 in 1:1 loop
  • trunk/Compiler/ModelicaFrontEnd/test/modelica/InnerOuterTests.mo

    r10783 r14204  
    403403    B b;
    404404
    405     annotation(__JModelica(UnitTesting(tests={
    406         FlatteningTestCase(
    407             name="InnerOuterTest15",
    408             description="",
    409             flatModel="
     405annotation(__JModelica(UnitTesting(tests={
     406    FlatteningTestCase(
     407        name="InnerOuterTest15",
     408        description="",
     409        flatModel="
    410410fclass InnerOuterTests.InnerOuterTest15
    411411 Real a.x[2];
     
    429429    A a;
    430430
    431     annotation(__JModelica(UnitTesting(tests={
    432         FlatteningTestCase(
    433             name="InnerOuterTest16",
    434             description="Flattening of accesses to outer array with array subscripts",
    435             flatModel="
     431annotation(__JModelica(UnitTesting(tests={
     432    FlatteningTestCase(
     433        name="InnerOuterTest16",
     434        description="Flattening of accesses to outer array with array subscripts",
     435        flatModel="
    436436fclass InnerOuterTests.InnerOuterTest16
    437437 Real x[3] = {1, 2, 3} * time;
     
    607607    B b;
    608608
    609     annotation(__JModelica(UnitTesting(tests={
    610         FlatteningTestCase(
    611             name="InnerOuterTest21",
    612             description="Flattening array access in function in inner",
    613             flatModel="
     609annotation(__JModelica(UnitTesting(tests={
     610    FlatteningTestCase(
     611        name="InnerOuterTest21",
     612        description="Flattening array access in function in inner",
     613        flatModel="
    614614fclass InnerOuterTests.InnerOuterTest21
    615615 Real b.a.y[2] = InnerOuterTests.InnerOuterTest21.b.m.f({time, time});
     
    622622  assert(2 == size(x, 1), \"Mismatching sizes in function 'InnerOuterTests.InnerOuterTest21.b.m.f', component 'x', dimension '1'\");
    623623  init y as Real[2];
    624   y[1:2] := x[1:2];
     624  y := x;
    625625  return;
    626626 end InnerOuterTests.InnerOuterTest21.b.m.f;
     
    654654    inner M m;
    655655
    656     annotation(__JModelica(UnitTesting(tests={
    657         FlatteningTestCase(
    658             name="InnerOuterTest22",
    659             description="Flattening array access in short class decl in inner",
    660             flatModel="
     656annotation(__JModelica(UnitTesting(tests={
     657    FlatteningTestCase(
     658        name="InnerOuterTest22",
     659        description="Flattening array access in short class decl in inner",
     660        flatModel="
    661661fclass InnerOuterTests.InnerOuterTest22
    662662 Real m.y[2] = InnerOuterTests.InnerOuterTest22.m.f2(m.X[1:2]);
     
    669669 algorithm
    670670  init y as Real[size(x, 1)];
    671   y := x[:];
     671  y := x;
    672672  return;
    673673 end InnerOuterTests.InnerOuterTest22.m.f2;
  • trunk/Compiler/ModelicaFrontEnd/test/modelica/ModificationTests.mo

    r12245 r14204  
    24752475    record B = A;
    24762476
    2477     annotation(__JModelica(UnitTesting(tests={
    2478         FlatteningTestCase(
    2479             name="ArrayModifications71",
    2480             description="Test type checking of modifiers on records with short class declarations",
    2481             flatModel="
     2477annotation(__JModelica(UnitTesting(tests={
     2478    FlatteningTestCase(
     2479        name="ArrayModifications71",
     2480        description="Test type checking of modifiers on records with short class declarations",
     2481        flatModel="
    24822482fclass ModificationTests.ArrayModifications71
    24832483 ModificationTests.ArrayModifications71.B b1[1] = b2[1:1];
     
    25062506    end B;
    25072507
    2508     annotation(__JModelica(UnitTesting(tests={
    2509         FlatteningTestCase(
    2510             name="ArrayModifications72",
    2511             description="Test type checking of modifiers on records with inheritance",
    2512             flatModel="
     2508annotation(__JModelica(UnitTesting(tests={
     2509    FlatteningTestCase(
     2510        name="ArrayModifications72",
     2511        description="Test type checking of modifiers on records with inheritance",
     2512        flatModel="
    25132513fclass ModificationTests.ArrayModifications72
    25142514 ModificationTests.ArrayModifications72.B b1[1] = b2[1:1];
  • trunk/Compiler/ModelicaFrontEnd/test/modelica/NameTests.mo

    r13948 r14204  
    13871387    L f;
    13881388
    1389     annotation(__JModelica(UnitTesting(tests={
    1390         FlatteningTestCase(
    1391             name="ConstantLookup22",
    1392             description="Class lookup through redeclares with constrainedby, complex example",
    1393             flatModel="
     1389annotation(__JModelica(UnitTesting(tests={
     1390    FlatteningTestCase(
     1391        name="ConstantLookup22",
     1392        description="Class lookup through redeclares with constrainedby, complex example",
     1393        flatModel="
    13941394fclass NameTests.ConstantLookup22
    13951395 Real f.d.a[2] = f.e[1:2];
    13961396 Real f.e[2] = ones(2);
    1397 
    13981397end NameTests.ConstantLookup22;
    13991398")})));
     
    29732972  Real x = y.z[i];
    29742973
    2975     annotation(__JModelica(UnitTesting(tests={
    2976         FlatteningTestCase(
    2977             name="IndexLookup1",
    2978             description="Name lookup from within array subscript",
    2979             flatModel="
     2974annotation(__JModelica(UnitTesting(tests={
     2975    FlatteningTestCase(
     2976        name="IndexLookup1",
     2977        description="Name lookup from within array subscript",
     2978        flatModel="
    29802979fclass NameTests.IndexLookup1
    29812980 parameter Integer i = 2 /* 2 */;
    29822981 Real y.z[2] = {1, 2};
    29832982 Real x = (y.z[1:2])[i];
    2984 
    29852983end NameTests.IndexLookup1;
    29862984")})));
     
    29982996  Real x = y.z[i];
    29992997
    3000     annotation(__JModelica(UnitTesting(tests={
    3001         FlatteningTestCase(
    3002             name="IndexLookup2",
    3003             description="Name lookup from within array subscript",
    3004             flatModel="
     2998annotation(__JModelica(UnitTesting(tests={
     2999    FlatteningTestCase(
     3000        name="IndexLookup2",
     3001        description="Name lookup from within array subscript",
     3002        flatModel="
    30053003fclass NameTests.IndexLookup2
    30063004 parameter Integer i = 2 /* 2 */;
     
    30083006 Real y.z[2] = {1, 2};
    30093007 Real x = (y.z[1:2])[i];
    3010 
    30113008end NameTests.IndexLookup2;
    30123009")})));
  • trunk/Compiler/ModelicaFrontEnd/test/modelica/OperatorRecordTests.mo

    r13456 r14204  
    32243224 algorithm
    32253225  init y as OperatorRecordTests.Cplx[n];
    3226   y[:] := {OperatorRecordTests.Cplx.'constructor'(i, 0) for i in 1:n};
     3226  y := {OperatorRecordTests.Cplx.'constructor'(i, 0) for i in 1:n};
    32273227  return;
    32283228 end OperatorRecordTests.BuildArrayInInst1.f;
  • trunk/Compiler/ModelicaFrontEnd/test/modelica/OverconstrainedConnection.mo

    r13456 r14204  
    7676  assert(2 == size(i2, 1), \"Mismatching sizes in function 'OverconstrainedConnection.OverconstrainedCorrect1.T1.equalityConstraint', component 'i2', dimension '1'\");
    7777  init o as Real[1];
    78   o[1:1] := sum(i1[1:2] .+ i2[1:2]);
     78  o := sum(i1 .+ i2);
    7979  return;
    8080 end OverconstrainedConnection.OverconstrainedCorrect1.T1.equalityConstraint;
     
    146146  assert(2 == size(i2, 1), \"Mismatching sizes in function 'OverconstrainedConnection.OverconstrainedCorrect2.T1.equalityConstraint', component 'i2', dimension '1'\");
    147147  init o as Real[1];
    148   o[1:1] := sum(i1[1:2] .+ i2[1:2]);
     148  o := sum(i1 .+ i2);
    149149  return;
    150150 end OverconstrainedConnection.OverconstrainedCorrect2.T1.equalityConstraint;
     
    10211021  assert(2 == size(i2, 1), \"Mismatching sizes in function 'OverconstrainedConnection.PureConnectLoop3.T1.equalityConstraint', component 'i2', dimension '1'\");
    10221022  init o as Real[1];
    1023   o[1:1] := sum(i1[1:2] .+ i2[1:2]);
     1023  o := sum(i1 .+ i2);
    10241024  return;
    10251025 end OverconstrainedConnection.PureConnectLoop3.T1.equalityConstraint;
     
    10951095  assert(2 == size(i2, 1), \"Mismatching sizes in function 'OverconstrainedConnection.PureConnectLoop4.T1.equalityConstraint', component 'i2', dimension '1'\");
    10961096  init o as Real[1];
    1097   o[1:1] := sum(i1[1:2] .+ i2[1:2]);
     1097  o := sum(i1 .+ i2);
    10981098  return;
    10991099 end OverconstrainedConnection.PureConnectLoop4.T1.equalityConstraint;
  • trunk/Compiler/ModelicaFrontEnd/test/modelica/RecordTests.mo

    r12916 r14204  
    23712371    Real y[m] = a.x;
    23722372
    2373     annotation(__JModelica(UnitTesting(tests={
    2374         FlatteningTestCase(
    2375             name="RecordArray8",
    2376             description="Flattening of model with record that gets array size of member from function call that returns entire record",
    2377             flatModel="
     2373annotation(__JModelica(UnitTesting(tests={
     2374    FlatteningTestCase(
     2375        name="RecordArray8",
     2376        description="Flattening of model with record that gets array size of member from function call that returns entire record",
     2377        flatModel="
    23782378fclass RecordTests.RecordArray8
    23792379 structural parameter Integer m = 2 /* 2 */;
     
    23872387 algorithm
    23882388  a.n := n2;
    2389   a.x[:] := 1:n2;
     2389  a.x := 1:n2;
    23902390  return;
    23912391 end RecordTests.RecordArray8.f;
     
    30463046    R r5;
    30473047
    3048     annotation(__JModelica(UnitTesting(tests={
    3049         FlatteningTestCase(
    3050             name="RecordConstructor14",
    3051             description="Parameter in record depending on size of input to constructor",
    3052             flatModel="
     3048annotation(__JModelica(UnitTesting(tests={
     3049    FlatteningTestCase(
     3050        name="RecordConstructor14",
     3051        description="Parameter in record depending on size of input to constructor",
     3052        flatModel="
    30533053fclass RecordTests.RecordConstructor14
    30543054 parameter RecordTests.RecordConstructor14.R r1(x(size() = {1})) = RecordTests.RecordConstructor14.R({1}, size({1}, 1)) /* RecordTests.RecordConstructor14.R({ 1 }, 1) */;
     
    34853485    D d(redeclare B b, a2 = {A(2), A(3)});
    34863486
    3487     annotation(__JModelica(UnitTesting(tests={
    3488         FlatteningTestCase(
    3489             name="RecordConstructor25",
    3490             description="Array of records with constructors used in modification on redeclare",
    3491             flatModel="
     3487annotation(__JModelica(UnitTesting(tests={
     3488    FlatteningTestCase(
     3489        name="RecordConstructor25",
     3490        description="Array of records with constructors used in modification on redeclare",
     3491        flatModel="
    34923492fclass RecordTests.RecordConstructor25
    34933493 structural parameter Integer d.b.n = 2 /* 2 */;
     
    35833583    parameter R r = R(a={p});
    35843584
    3585     annotation(__JModelica(UnitTesting(tests={
    3586         FlatteningTestCase(
    3587             name="RecordConstructor28",
    3588             description="",
    3589             flatModel="
     3585annotation(__JModelica(UnitTesting(tests={
     3586    FlatteningTestCase(
     3587        name="RecordConstructor28",
     3588        description="",
     3589        flatModel="
    35903590fclass RecordTests.RecordConstructor28
    35913591 parameter Real p;
     
    36203620    C c;
    36213621
    3622     annotation(__JModelica(UnitTesting(tests={
    3623         FlatteningTestCase(
    3624             name="RecordConstructor29",
    3625             description="",
    3626             flatModel="
     3622annotation(__JModelica(UnitTesting(tests={
     3623    FlatteningTestCase(
     3624        name="RecordConstructor29",
     3625        description="",
     3626        flatModel="
    36273627fclass RecordTests.RecordConstructor29
    36283628 parameter Real c.p = -20 /* -20 */;
     
    59015901    R y = x[integer(time)];
    59025902
    5903     annotation(__JModelica(UnitTesting(tests={
    5904         TransformCanonicalTestCase(
    5905             name="RecordScalarize53",
    5906             description="",
    5907             flatModel="
     5903annotation(__JModelica(UnitTesting(tests={
     5904    TransformCanonicalTestCase(
     5905        name="RecordScalarize53",
     5906        description="",
     5907        flatModel="
    59085908fclass RecordTests.RecordScalarize53
    59095909 constant Real x[1].x = 1;
     
    63196319 Real q = f(1, 2);
    63206320
    6321     annotation(__JModelica(UnitTesting(tests={
    6322         TransformCanonicalTestCase(
    6323             name="RecordFunc5",
    6324             description="Scalarization of records in functions: inner array, assignment",
    6325             variability_propagation=false,
    6326             flatModel="
     6321annotation(__JModelica(UnitTesting(tests={
     6322    TransformCanonicalTestCase(
     6323        name="RecordFunc5",
     6324        description="Scalarization of records in functions: inner array, assignment",
     6325        variability_propagation=false,
     6326        flatModel="
    63276327fclass RecordTests.RecordFunc5
    63286328 Real q;
     
    63406340  z.x[1] := ix;
    63416341  z.x[2] := iy;