Commit 57a331fc authored by Marco Lattuada's avatar Marco Lattuada
Browse files

Added c generation in regression tests

parent 9615353d
......@@ -11,9 +11,15 @@ test-parse:
test-ada:
@python test.py test-ada $(TEST_CASES)
test-c:
@python test.py test-c $(TEST_CASES)
test-llvm:
@python test.py test-llvm $(TEST_CASES)
test-vhdl:
@python test.py test-c $(TEST_CASES)
benchmark:
@python benchmark.py $(BENCHMARK_CASES)
......
......@@ -18,6 +18,10 @@ clean:
$(LLC) $*.ll
$(CC) -O$(O) -c -g $*.s
%.c: %.pr FORCE
$(OPENGEODE) $< system_structure.pr --toC
$(ASN1SCC) -c dataview-uniq.asn -typePrefix asn1Scc -equal
%.ali: %.pr FORCE
$(OPENGEODE) $< system_structure.pr --toAda
$(ASN1SCC) -Ada dataview-uniq.asn -typePrefix asn1Scc -equal
......
......@@ -13,11 +13,19 @@ test-ada: controlflow.ali dataview-uniq.o | test_ada.o
$(GNATLINK) test_ada.o controlflow.ali -lgnat -lm -o test_ada
./test_ada | diff expected -
test-c: controlflow.c test_c.o dataview-uniq.o
$(CC) controlflow.c -c -o controlflow.o
$(CC) test_c.o controlflow.c -lm -o test_c
./test_c | diff expected -
test-llvm: controlflow.o dataview-uniq.o | test_llvm.o
$(CC) controlflow.o dataview-uniq.o test_llvm.o -o test_llvm -lm
./test_llvm | diff expected -
test-vhdl : test-c
bambu controlflow.c test_c.c --experimental-setup=BAMBU --debug-classes=MuxConnectionBinding --print-dot --no-clean --pretty-print=a.c -d2
coverage:
coverage run -p $(OPENGEODE) controlflow.pr system_structure.pr --toAda
.PHONY: all edit test-parse test-ada test-llvm coverage
\ No newline at end of file
.PHONY: all edit test-parse test-ada test-llvm coverage
#include <stdio.h>
#include <stdlib.h>
#include "dataview-uniq.h"
extern void run();
void controlflow_RI_assert(asn1SccBoolean *res, asn1SccCharString *msg) {
if (!*res) {
printf("%.*s\n", (int)msg->nCount, msg->arr);
exit(1);
}
}
void controlflow_RI_fail(asn1SccCharString *msg) {
printf("%.*s\n", (int)msg->nCount, msg->arr);
exit(1);
}
int main() {
run();
return 0;
}
......@@ -13,6 +13,11 @@ test-ada: orchestrator.ali dataview-uniq.o | test_ada.o
$(GNATLINK) -o test_ada test_ada.o orchestrator.ali -lgnat
./test_ada
test-c: orchestrator.c test_c.o dataview-uniq.o
$(CC) orchestrator.c -c -o orchestrator.o
$(CC) test_c.o dataview-uniq.o orchestrator.o -lm -o test_c
./test_c | diff expected -
test-llvm: orchestrator.o
test-python:
......@@ -24,6 +29,9 @@ test-python:
$(CC) -shared -fPIC -o liborchestrator.so b~orchestrator.o orchestrator.o taste_basictypes.o adaasn1rtl.o -lgnat
python -c "from ctypes import *; test=CDLL('./liborchestrator.so'); test.liborchestratorinit()"
test-vhdl : test-c
bambu orchestrator.c test_c.c --experimental-setup=BAMBU
coverage:
coverage run -p $(OPENGEODE) orchestrator.pr system_structure.pr --toAda
......
[C Code] Running test
0
0
0
1
0
0
0
1
FALSE
TRUE
TRUE
FALSE
HELLO!!!
HELLOHELLOHELLO
#include <math.h>
#include <stdio.h>
#include "dataview-uniq.h"
extern void runTransition(int Id);
void telemetry(asn1SccMyEnum * param){}
int main()
{
printf("[C Code] Running test\n");
CInit();
runTransition(0);
return 0;
}
......@@ -13,11 +13,18 @@ test-ada: og.ali dataview-uniq.o | test_ada.o
$(GNATLINK) -o test_ada test_ada.o og.ali -lgnat
./test_ada | diff expected -
test-c: og.c test_c.o dataview-uniq.o
$(CC) og.c -c -o og.o
$(CC) test_c.o og.o dataview-uniq.o -lm -o test_c
./test_c | diff expected -
test-llvm: og.o dataview-uniq.o | test_llvm.o
$(CC) og.o dataview-uniq.o test_llvm.o -o test_llvm -lm
./test_llvm
test-vhdl : test-c
bambu og.c test_c.c --experimental-setup=BAMBU
coverage:
coverage run -p $(OPENGEODE) og.pr system_structure.pr --toAda
......
#include <stdio.h>
#include "dataview-uniq.h"
int main() {
asn1SccMy_OctStr toto;
CInit();
runTransition(0);
go(&toto);
return 0;
}
......@@ -13,11 +13,20 @@ test-ada: challenge.ali dataview-uniq.o | test_ada.o
$(GNATLINK) -o test_ada test_ada.o challenge.ali -lgnat -lm
./test_ada | diff expected -
test-c: challenge.c test_c.o dataview-uniq.o
$(CC) challenge.c -c -o challenge.o
$(CC) test_c.o dataview-uniq.o challenge.o -lm -o test_c
./test_c
./test_c | diff expected -
test-llvm: challenge.o dataview-uniq.o | test_llvm.o
$(CC) challenge.o dataview-uniq.o test_llvm.o -o test_llvm -lm
./test_llvm | diff expected -
test-vhdl : test-c
bambu challenge.c test_c.c --experimental-setup=BAMBU
coverage:
coverage run -p $(OPENGEODE) challenge.pr system_structure.pr --toAda
.PHONY: all edit test-parse test-ada test-llvm coverage
\ No newline at end of file
.PHONY: all edit test-parse test-ada test-llvm coverage
int main()
{
// CInit();
runTransition(0);
run();
go_off();
return 0;
}
......@@ -13,11 +13,19 @@ test-ada: expressions.ali dataview-uniq.o | test_ada.o
$(GNATLINK) test_ada.o expressions.ali -lgnat -lm -o test_ada
./test_ada
test-c: expressions.c test_c.o dataview-uniq.o
$(CC) expressions.c -c -o expressions.o
$(CC) test_c.o dataview-uniq.o expressions.o -lm -o test_c
./test_c
test-llvm: expressions.o dataview-uniq.o | test_llvm.o
$(CC) expressions.o dataview-uniq.o test_llvm.o -o test_llvm -lm
./test_llvm
test-vhdl : test-c
bambu expressions.c test_c.c dataview-uniq.c --experimental-setup=BAMBU -v4
coverage:
coverage run -p $(OPENGEODE) expressions.pr system_structure.pr --toAda
.PHONY: all edit test-parse test-ada test-llvm coverage
\ No newline at end of file
.PHONY: all edit test-parse test-ada test-llvm coverage
#include <stdio.h>
#include <stdlib.h>
#include "dataview-uniq.h"
void expressions_RI_assert(asn1SccBoolean *res, asn1SccCharString *msg) {
if (!*res) {
printf("%.*s\n", (int)msg->nCount, msg->arr);
exit(1);
}
}
int main() {
runTransition(0);
run();
return 0;
}
......@@ -13,6 +13,11 @@ test-ada: orchestrator.ali dataview-uniq.o | test_ada.o
$(GNATLINK) -o test_ada test_ada.o orchestrator.ali -lgnat
./test_ada
test-c: orchestrator.c test_c.o dataview-uniq.o
$(CC) orchestrator.c -c -o orchestrator.o
$(CC) test_c.o orchestrator.c dataview-uniq.o -lm -o test_c
./test_c | diff expected -
test-llvm: orchestrator.o dataview-uniq.o | test_llvm.o
$(CC) orchestrator.o dataview-uniq.o test_llvm.o -o test_llvm -lm
./test_llvm
......
[C Code] Running test
TRUE
FALSE
FALSE
(1) -> TRUEFALSE
(2) -> TRUETRUE
Hello word
Hop
Hop!!
Hop!!:-)
Hop
OK
void telemetry(void *_){}
int main()
{
printf("[C Code] Running test\n");
CInit();
runTransition(0);
return 0;
}
......@@ -13,6 +13,11 @@ test-ada: orchestrator.ali dataview-uniq.o | test_ada.o
$(GNATLINK) -o test_ada test_ada.o orchestrator.ali -lgnat
./test_ada
test-c: orchestrator.c test_c.o dataview-uniq.o
$(CC) orchestrator.c -c -o orchestrator.o
$(CC) test_c.o orchestrator.c dataview-uniq.o -lm -o test_c
./test_c | diff expected -
test-llvm: orchestrator.o
test-python:
......
[C Code] Running test
0
0
0
1
0
0
0
1
FALSE
TRUE
TRUE
FALSE
HELLO!!!
HELLOHELLOHELLO
void telemetry(void *_){}
int main()
{
printf("[C Code] Running test\n");
CInit();
runTransition(0);
return 0;
}
......@@ -13,6 +13,11 @@ test-ada: operators.ali dataview-uniq.o | test_ada.o
$(GNATLINK) test_ada.o operators.ali -lgnat -lm -o test_ada
./test_ada | diff expected -
test-c: operators.c test_c.o dataview-uniq.o
$(CC) operators.c -c -o operators.o
$(CC) test_c.o operators.c -lm -o test_c
./test_c | diff expected_c -
test-llvm: operators.o dataview-uniq.o | test_llvm.o
$(CC) operators.o dataview-uniq.o test_llvm.o -o test_llvm -lm
./test_llvm | diff expected -
......
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