Changeset 11596
- Timestamp:
- Sep 17, 2018 4:14:34 PM (15 months ago)
- Location:
- trunk/Compiler
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Compiler/ModelicaCBackEnd/test/modelica/CCodeGenTests.mo
r11595 r11596 11720 11720 end BlockTest24; 11721 11721 11722 model BlockTest25 11723 record R 11724 constant Real y; 11725 end R; 11726 11727 function f 11728 constant R[:] p = {R(3)}; 11729 input Integer i; 11730 output Real y = p[i].y; 11731 algorithm 11732 end f; 11733 11734 function f2 11735 input Real x; 11736 output Real y = x; 11737 algorithm 11738 annotation(Inline=false); 11739 end f2; 11740 11741 parameter Integer i = 1; 11742 Real x = f(i) + f2(x); 11743 11744 annotation(__JModelica(UnitTesting(tests={ 11745 CCodeGenTestCase( 11746 name="BlockTest25", 11747 description="Nominal with global constant in record", 11748 template="$C_dae_blocks_residual_functions$", 11749 variability_propagation=false, 11750 generatedCode=" 11751 static int dae_block_0(jmi_t* jmi, jmi_real_t* x, jmi_real_t* residual, int evaluation_mode) { 11752 /***** Block: 1 *****/ 11753 jmi_real_t** res = &residual; 11754 int ef = 0; 11755 JMI_DYNAMIC_INIT() 11756 if (evaluation_mode == JMI_BLOCK_VALUE_REFERENCE) { 11757 x[0] = 1; 11758 } else if (evaluation_mode == JMI_BLOCK_EQUATION_NOMINAL_AUTO) { 11759 (*res)[0] = jmi_max(AD_WRAP_LITERAL(1), jmi_max(jmi_abs(jmi_array_rec_1(JMI_GLOBAL(CCodeGenTests_BlockTest25_f_p), _i_0)->y), AD_WRAP_LITERAL(1))); 11760 } else if (evaluation_mode == JMI_BLOCK_INITIALIZE) { 11761 x[0] = _x_1; 11762 } else if (evaluation_mode & JMI_BLOCK_EVALUATE || evaluation_mode & JMI_BLOCK_WRITE_BACK) { 11763 if ((evaluation_mode & JMI_BLOCK_EVALUATE_NON_REALS) == 0) { 11764 _x_1 = x[0]; 11765 } 11766 if (evaluation_mode & JMI_BLOCK_EVALUATE) { 11767 (*res)[0] = jmi_array_rec_1(JMI_GLOBAL(CCodeGenTests_BlockTest25_f_p), _i_0)->y + func_CCodeGenTests_BlockTest25_f2_exp0(_x_1) - (_x_1); 11768 } 11769 } 11770 JMI_DYNAMIC_FREE() 11771 return ef; 11772 } 11773 ")}))); 11774 end BlockTest25; 11775 11722 11776 model NestedUnsolvedScalarInSolvedBlock 11723 11777 Real a; -
trunk/Compiler/ModelicaFlatTree/src/jastadd/FlatAPI/FlatAPI.jrag
r11543 r11596 3220 3220 3221 3221 eq FIdUseExp.nominal() = myFV().nominal(); 3222 eq FGlobalAccessExp.nominal() = new FAbsExp(treeCopy()); 3222 3223 3223 3224 syn FExp FAbstractVariable.nominal() {
Note: See TracChangeset
for help on using the changeset viewer.