Commit 14eaa27f authored by dbarbera's avatar dbarbera
Browse files

Execute llvm generated code

parent 6ed0927a
......@@ -10,19 +10,25 @@ test-ada:
../../../opengeode.py --toAda challenge.pr system_structure.pr
asn1.exe -Ada dataview-uniq.asn -typePrefix asn1Scc -equal
gnatmake -c *.adb
gcc -c test.c
gcc -c test_ada.c
gnatbind -n challenge.ali
gnatlink -o testcase test.o challenge.ali -lgnat -lm
gnatlink -o testcase test_ada.o challenge.ali -lgnat -lm
./testcase | diff expected -
test-llvm:
../../../opengeode.py challenge.pr system_structure.pr --llvm
../../../opengeode.py challenge.pr system_structure.pr --check --llvm
asn1.exe -c dataview-uniq.asn -typePrefix asn1Scc -equal
llc challenge.ll
gcc -c challenge.s
clang -c challenge.s
clang -c dataview-uniq.c
clang -c test_llvm.c
clang challenge.o dataview-uniq.o test_llvm.o -o testcase -lm
./testcase | diff expected -
coverage:
coverage run -p ../../../opengeode.py challenge.pr system_structure.pr --toAda
clean:
rm -rf *.adb *.ads *.pyc runSpark.sh spark.idx *.o *.ali gnat.cfg examiner \
bin *.wrn *.gpr testcase *.ll *.s
bin *.wrn *.gpr testcase *.ll *.s dataview-uniq.c dataview-uniq.h real.c xer.c \
ber.c acn.c asn1crt.c asn1crt.h
#include <math.h>
#include <stdio.h>
/* Ada code external interface */
extern void challenge_run();
extern void challenge_any_one();
extern int challenge_startup();
//extern long long l_result;
/* Provide code called by the Ada state machine as external procedure */
void challenge_RI_pow(long long *a, long long *b, long long *res)
{
*res = (long long)pow((double)*a, (double)*b);
}
int main()
{
challenge_startup();
challenge_run();
challenge_run();
//printf("Internal state: %lld\n", l_result);
challenge_any_one();
challenge_run();
return 0;
}
......@@ -17,9 +17,14 @@ test-ada:
./testcase | diff expected -
test-llvm:
../../../opengeode.py orchestrator.pr system_structure.pr --llvm
../../../opengeode.py orchestrator.pr system_structure.pr --check --llvm
asn1.exe -c dataview-uniq.asn -typePrefix asn1Scc -equal
llc orchestrator.ll
gcc -c orchestrator.s
clang -c orchestrator.s
clang -c dataview-uniq.c
clang -c test_llvm.c
clang orchestrator.o dataview-uniq.o test_llvm.o -o testcase -lm
./testcase | diff expected -
coverage:
coverage run -p ../../../opengeode.py orchestrator.pr system_structure.pr --toAda
......
#include <math.h>
#include <stdio.h>
#include "dataview-uniq.h"
extern void orchestrator_startup();
void orchestrator_RI_VESAT_one_step(asn1SccT_GNC_LV_SIM_INPUTS *inp)
{
printf("[C Code] Received T_GNC_LV_SIM_INPUTS\n");
}
int main()
{
printf("[C Code] Running test\n");
orchestrator_startup();
return 0;
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment