Skip to content

Commit

Permalink
- Fix meta testsuite
Browse files Browse the repository at this point in the history
  • Loading branch information
sjoelund committed Oct 28, 2010
1 parent 4a2b23b commit 965c74e
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 82 deletions.
4 changes: 3 additions & 1 deletion Compiler/Builtin.mo
Expand Up @@ -2964,6 +2964,7 @@ algorithm
env = Env.extendFrameT(env, "realAtan", real2real);
env = Env.extendFrameT(env, "realExp", real2real);
env = Env.extendFrameT(env, "realLn", real2real);
env = Env.extendFrameT(env, "realLog10", real2real);
env = Env.extendFrameT(env, "realFloor", real2real);
env = Env.extendFrameT(env, "realSqrt", real2real);

Expand Down Expand Up @@ -3035,7 +3036,8 @@ algorithm
env = Env.extendFrameT(env, "setGlobalRoot", intBoxedNoRetcall);
env = Env.extendFrameT(env, "valueConstructor", boxed2int);
env = Env.extendFrameT(env, "valueSlots", boxed2int);
env = Env.extendFrameT(env, "valueEq", AA2bool);
env = Env.extendFrameT(env, "valueEq", AA2bool);
env = Env.extendFrameT(env, "referenceEq", AA2bool);
then env;
case env then env;
end matchcontinue;
Expand Down
54 changes: 27 additions & 27 deletions Compiler/RTOpts.mo
Expand Up @@ -46,82 +46,82 @@ public function args
input list<String> inStringLst;
output list<String> outStringLst;

external "C" outStringLst=RTOpts_args(inStringLst);
external "C" outStringLst=RTOpts_args(inStringLst) annotation(Library = "omcruntime");
end args;

public function typeinfo
output Boolean outBoolean;

external "C" outBoolean = RTOpts_typeinfo();
external "C" outBoolean = RTOpts_typeinfo() annotation(Library = "omcruntime");
end typeinfo;

public function splitArrays
output Boolean outBoolean;

external "C" splitArrays = RTOpts_splitArrays();
external "C" splitArrays = RTOpts_splitArrays() annotation(Library = "omcruntime");
end splitArrays;

public function paramsStruct
output Boolean outBoolean;

external "C" outBoolean = RTOpts_paramsStruct();
external "C" outBoolean = RTOpts_paramsStruct() annotation(Library = "omcruntime");
end paramsStruct;

public function modelicaOutput
output Boolean outBoolean;

external "C" outBoolean = RTOpts_modelicaOutput();
external "C" outBoolean = RTOpts_modelicaOutput() annotation(Library = "omcruntime");
end modelicaOutput;

public function debugFlag
input String inString;
output Boolean outBoolean;

external "C" outBoolean=RTOpts_debugFlag(inString);
external "C" outBoolean=RTOpts_debugFlag(inString) annotation(Library = "omcruntime");
end debugFlag;

public function setDebugFlag
input String inString;
input Integer value;
output Boolean str;

external "C" str = RTOpts_setDebugFlag(inString,value);
external "C" str = RTOpts_setDebugFlag(inString,value) annotation(Library = "omcruntime");
end setDebugFlag;

public function noProc
output Integer outInteger;

external "C" noProc = RTOpts_noProc();
external "C" noProc = RTOpts_noProc() annotation(Library = "omcruntime");
end noProc;

public function setEliminationLevel
input Integer level;

external "C" ;
external "C" annotation(Library = "omcruntime");
end setEliminationLevel;

public function eliminationLevel
output Integer level;

external "C" level = RTOpts_level();
external "C" level = RTOpts_level() annotation(Library = "omcruntime");
end eliminationLevel;

public function latency
output Real outReal;

external "C" outReal = RTOpts_latency();
external "C" outReal = RTOpts_latency() annotation(Library = "omcruntime");
end latency;

public function bandwidth
output Real outReal;

external "C" outReal = RTOpts_bandwidth();
external "C" outReal = RTOpts_bandwidth() annotation(Library = "omcruntime");
end bandwidth;

public function simulationCg
output Boolean outBoolean;

external "C" outBoolean = RTOpts_simulationCg();
external "C" outBoolean = RTOpts_simulationCg() annotation(Library = "omcruntime");
end simulationCg;

public function simulationCodeTarget
Expand All @@ -130,25 +130,25 @@ public function simulationCodeTarget
usage: omc [+target=gcc|msvc], default to 'gcc'."
output String outCodeTarget;

external "C" outCodeTarget = RTOpts_simulationCodeTarget();
external "C" outCodeTarget = RTOpts_simulationCodeTarget() annotation(Library = "omcruntime");
end simulationCodeTarget;

public function classToInstantiate
output String modelName;

external "C" modelName = RTOpts_classToInstantiate();
external "C" modelName = RTOpts_classToInstantiate() annotation(Library = "omcruntime");
end classToInstantiate;

public function silent
output Boolean outBoolean;

external "C" outBoolean = RTOpts_silent();
external "C" outBoolean = RTOpts_silent() annotation(Library = "omcruntime");
end silent;

public function versionRequest
output Boolean outBoolean;

external "C" outBoolean = RTOpts_versionRequest();
external "C" outBoolean = RTOpts_versionRequest() annotation(Library = "omcruntime");
end versionRequest;

public function acceptMetaModelicaGrammar
Expand All @@ -157,7 +157,7 @@ public function acceptMetaModelicaGrammar
usage: omc [+g=Modelica|MetaModelica], default to 'Modelica'."
output Boolean outBoolean;

external "C" outBoolean = RTOpts_acceptMetaModelicaGrammar();
external "C" outBoolean = RTOpts_acceptMetaModelicaGrammar() annotation(Library = "omcruntime");
end acceptMetaModelicaGrammar;

public function getAnnotationVersion
Expand All @@ -168,15 +168,15 @@ public function getAnnotationVersion
setAnnotationVersion(\"3.x\");
for annotations: 1.x or 2.x or 3.x"
output String annotationVersion;
external "C" annotationVersion = RTOpts_getAnnotationVersion();
external "C" annotationVersion = RTOpts_getAnnotationVersion() annotation(Library = "omcruntime");
end getAnnotationVersion;

public function setAnnotationVersion
"@author: adrpo 2008-11-28
setAnnotationVersion(\"3.x\");
for annotations: 1.x or 2.x or 3.x"
input String annotationVersion;
external "C";
external "C" annotation(Library = "omcruntime");
end setAnnotationVersion;

public function getNoSimplify
Expand All @@ -186,43 +186,43 @@ public function getNoSimplify
or via the API
setNoSimplify(true|false);"
output Boolean noSimplify;
external "C" noSimplify = RTOpts_getNoSimplify();
external "C" noSimplify = RTOpts_getNoSimplify() annotation(Library = "omcruntime");
end getNoSimplify;

public function setNoSimplify
"@author: adrpo 2008-12-13
setAnnotationVersion(\"3.x\");
for annotations: 1.x or 2.x or 3.x"
input Boolean noSimplify;
external "C";
external "C" annotation(Library = "omcruntime");
end setNoSimplify;

public function vectorizationLimit
"Returns the vectorization limit that is used to determine how large an array
can be before it no longer is expanded by Static.crefVectorize."
output Integer limit;
external "C" limit = RTOpts_vectorizationLimit();
external "C" limit = RTOpts_vectorizationLimit() annotation(Library = "omcruntime");
end vectorizationLimit;

public function setVectorizationLimit
"Sets the vectorization limit, see vectorizationLimit above."
input Integer limit;
external "C";
external "C" annotation(Library = "omcruntime");
end setVectorizationLimit;

public function showAnnotations
output Boolean show;
external "C" show = RTOpts_showAnnotations();
external "C" show = RTOpts_showAnnotations() annotation(Library = "omcruntime");
end showAnnotations;

public function setShowAnnotations
input Boolean show;
external "C";
external "C" annotation(Library = "omcruntime");
end setShowAnnotations;

public function getRunningTestsuite
output Boolean runningTestsuite;
external "C" runningTestsuite = RTOpts_getRunningTestsuite();
external "C" runningTestsuite = RTOpts_getRunningTestsuite() annotation(Library = "omcruntime");
end getRunningTestsuite;

end RTOpts;
Expand Down
45 changes: 0 additions & 45 deletions c_runtime/meta_modelica_builtin.cpp
Expand Up @@ -263,51 +263,6 @@ realMin_rettype realMin(modelica_real r1, modelica_real r2)
return r1 < r2 ? r1 : r2;
}

realAbs_rettype realAbs(modelica_real r)
{
return fabs(r);
}

realNeg_rettype realNeg(modelica_real r)
{
return -r;
}

realCos_rettype realCos(modelica_real r)
{
return cos(r);
}

realSin_rettype realSin(modelica_real r)
{
return sin(r);
}

realAtan_rettype realAtan(modelica_real r)
{
return atan(r);
}

realExp_rettype realExp(modelica_real r)
{
return exp(r);
}

realLn_rettype realLn(modelica_real r)
{
return log(r);
}

realFloor_rettype realFloor(modelica_real r)
{
return floor(r);
}

realSqrt_rettype realSqrt(modelica_real r)
{
return sqrt(r);
}

realLt_rettype realLt(modelica_real r1, modelica_real r2)
{
return r1 < r2;
Expand Down
22 changes: 13 additions & 9 deletions c_runtime/meta_modelica_builtin.h
Expand Up @@ -145,18 +145,20 @@ typedef modelica_real realSin_rettype;
typedef modelica_real realAtan_rettype;
typedef modelica_real realExp_rettype;
typedef modelica_real realLn_rettype;
typedef modelica_real realLog10_rettype;
typedef modelica_real realFloor_rettype;
typedef modelica_real realSqrt_rettype;

realAbs_rettype realAbs(modelica_real);
realNeg_rettype realNeg(modelica_real);
realCos_rettype realCos(modelica_real);
realSin_rettype realSin(modelica_real);
realAtan_rettype realAtan(modelica_real);
realExp_rettype realExp(modelica_real);
realLn_rettype realLn(modelica_real);
realFloor_rettype realFloor(modelica_real);
realSqrt_rettype realSqrt(modelica_real);
#define realAbs(X) fabs(X)
#define realNeg(X) (-(X))
#define realCos(X) cos(X)
#define realSin(X) sin(X)
#define realAtan(X) atan(X)
#define realExp(X) exp(X)
#define realLn(X) log(X)
#define realLog10(X) log10(X)
#define realFloor(X) floor(X)
#define realSqrt(X) sqrt(X)

typedef modelica_boolean realLt_rettype;
typedef modelica_boolean realLe_rettype;
Expand Down Expand Up @@ -283,6 +285,7 @@ void equality(modelica_metatype, modelica_metatype);
/* Weird RML stuff */
typedef modelica_metatype getGlobalRoot_rettype;
typedef modelica_integer valueConstructor_rettype;
typedef modelica_boolean referenceEq_rettype;

getGlobalRoot_rettype getGlobalRoot(int ix);
void setGlobalRoot(int ix, modelica_metatype val);
Expand All @@ -291,6 +294,7 @@ valueConstructor_rettype valueConstructor(modelica_metatype val);
modelica_metatype boxptr_getGlobalRoot(modelica_metatype);
void boxptr_setGlobalRoot(modelica_metatype, modelica_metatype);
modelica_metatype boxptr_valueConstructor(modelica_metatype);
#define referenceEq(X,Y) ((X) == (Y))

#if defined(__cplusplus)
}
Expand Down

0 comments on commit 965c74e

Please sign in to comment.