Commit 521e81da authored by Marco Lattuada's avatar Marco Lattuada
Browse files

Fixed c regression tests

parent 57a331fc
......@@ -14,7 +14,7 @@ test-ada: orchestrator.ali dataview-uniq.o | test_ada.o
./test_ada
test-c: orchestrator.c test_c.o dataview-uniq.o
$(CC) orchestrator.c -c -o orchestrator.o
$(CC) -include missing.h orchestrator.c -c -o orchestrator.o
$(CC) test_c.o dataview-uniq.o orchestrator.o -lm -o test_c
./test_c | diff expected -
......
TASTE-BasicTypes DEFINITIONS ::=
BEGIN
Boolean ::= BOOLEAN
TASTE-Peek-id ::= INTEGER (0..4294967295)
TASTE-Peek-id-list ::= SEQUENCE (SIZE (1..10)) OF TASTE-Peek-id
......
#include "dataview-uniq.h"
asn1SccMyChoice asn1SccMyChoice_c1_set(asn1SccBoolean itm)
{
asn1SccMyChoice temp;
temp.kind = c1_PRESENT;
temp.u.c1 = itm;
return temp;
}
asn1SccSeqOpt_c asn1SccSeqOpt_c_Init()
{
asn1SccSeqOpt_c temp;
asn1SccSeqOpt_c_Initialize(&temp);
return temp;
}
asn1SccSeqOpt_d asn1SccSeqOpt_d_Init()
{
asn1SccSeqOpt_d temp;
asn1SccSeqOpt_d_Initialize(&temp);
return temp;
}
int asn1SccMyChoice_Kind(asn1SccMyChoice val)
{
return val.kind;
}
......@@ -14,7 +14,7 @@ test-ada: og.ali dataview-uniq.o | test_ada.o
./test_ada | diff expected -
test-c: og.c test_c.o dataview-uniq.o
$(CC) og.c -c -o og.o
$(CC) -include missing.h og.c -c -o og.o
$(CC) test_c.o og.o dataview-uniq.o -lm -o test_c
./test_c | diff expected -
......
#include "dataview-uniq.h"
asn1SccSeqOf asn1SccSeqOf_Init()
{
asn1SccSeqOf temp;
asn1SccSeqOf_Initialize(&temp);
return temp;
}
asn1SccAChoice asn1SccAChoice_b_set(asn1SccSeqOf itm)
{
asn1SccAChoice temp;
temp.kind = b_PRESENT;
temp.u.b = itm;
return temp;
}
asn1SccAChoice asn1SccAChoice_a_set(asn1SccT_Bool itm)
{
asn1SccAChoice temp;
temp.kind = a_PRESENT;
temp.u.a = itm;
return temp;
}
......@@ -14,8 +14,8 @@ test-ada: orchestrator.ali dataview-uniq.o | test_ada.o
./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
$(CC) -include missing.h orchestrator.c -c -o orchestrator.o
$(CC) test_c.o orchestrator.o dataview-uniq.o -lm -o test_c
./test_c | diff expected -
test-llvm: orchestrator.o
......
#include "dataview-uniq.h"
asn1SccSeqOpt_c asn1SccSeqOpt_c_Init()
{
asn1SccSeqOpt_c temp;
asn1SccSeqOpt_c_Initialize(&temp);
return temp;
}
asn1SccSeqOpt_d asn1SccSeqOpt_d_Init()
{
asn1SccSeqOpt_d temp;
asn1SccSeqOpt_d_Initialize(&temp);
return temp;
}
int asn1SccMyChoice_Kind(asn1SccMyChoice val)
{
return val.kind;
}
......@@ -14,8 +14,8 @@ test-ada: operators.ali dataview-uniq.o | test_ada.o
./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
$(CC) -include missing.h operators.c -c -o operators.o
$(CC) test_c.o operators.o -lm -o test_c
./test_c | diff expected_c -
test-llvm: operators.o dataview-uniq.o | test_llvm.o
......@@ -25,4 +25,4 @@ test-llvm: operators.o dataview-uniq.o | test_llvm.o
coverage:
coverage run -p $(OPENGEODE) operators.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 "dataview-uniq.h"
#include <math.h>
asn1SccReal pi = M_PI;
asn1SccChoice asn1SccChoice_i_set(asn1SccInteger itm)
{
asn1SccChoice temp;
temp.kind = i_PRESENT;
temp.u.i = itm;
return temp;
}
......@@ -11,6 +11,9 @@ test-parse:
test-ada:
$(OPENGEODE) og.pr --toAda
test-c:
$(OPENGEODE) og.pr --toC
test-llvm:
$(OPENGEODE) og.pr --llvm -O$(O)
......
......@@ -45,7 +45,7 @@ anint := 478;
/* CIF PROCEDURECALL (433, 360), (212, 35) */
CALL writeln('Input param', anint);
/* CIF PROCEDURECALL (442, 410), (193, 35) */
CALL externalProc(anint, anint);
CALL ExternalProc(anint, anint);
/* CIF PROCEDURECALL (427, 460), (224, 35) */
CALL writeln('Output param', anint);
/* CIF OUTPUT (482, 510), (114, 35) */
......@@ -71,4 +71,4 @@ anint := 478;
/* CIF NEXTSTATE (880, 305), (90, 35) */
NEXTSTATE Timeout;
ENDSTATE;
ENDPROCESS orchestrator;
\ No newline at end of file
ENDPROCESS orchestrator;
......@@ -14,7 +14,7 @@ test-ada: challenge.ali dataview-uniq.o | test_ada.o
./test_ada | diff expected -
test-c: challenge.c test_c.o dataview-uniq.o
$(CC) challenge.c -c -o challenge.o
$(CC) -include missing.h challenge.c -c -o challenge.o
$(CC) test_c.o challenge.c dataview-uniq.o -lm -o test_c
./test_c | diff expected -
......
......@@ -216,7 +216,7 @@ ENDSTATE;
/* CIF STATE (851, 72), (65, 35) */
STATE ON;
STATE on;
/* CIF INPUT (1043, 127), (88, 35) */
INPUT any_one;
/* CIF NEXTSTATE (1030, 177), (113, 35) */
......@@ -248,8 +248,8 @@ INPUT run;
/* CIF PROCEDURECALL (-360, 306), (106, 35) */
CALL writeln('2');
/* CIF NEXTSTATE (-374, 357), (132, 35) */
NEXTSTATE ON via via_toto
NEXTSTATE on via via_toto
/* CIF COMMENT (-222, 357), (219, 35) */
COMMENT 'Enter substate via entry point';
ENDSTATE;
ENDPROCESS challenge;
\ No newline at end of file
ENDPROCESS challenge;
......@@ -11,7 +11,7 @@ test-parse:
test-ada: orchestrator.ali
test-c: orchestrator.c
$(CC) -c orchestrator.c
$(CC) -include missing.h -c orchestrator.c
test-llvm: orchestrator.o
......
#include "dataview-uniq.h"
asn1SccMyChoice asn1SccMyChoice_b_set(asn1SccMySeq itm)
{
asn1SccMyChoice temp;
temp.kind = b_PRESENT;
temp.u.b = itm;
return temp;
}
asn1SccMyChoice asn1SccMyChoice_a_set(flag itm)
{
asn1SccMyChoice temp;
temp.kind = MyChoice_a_PRESENT;
temp.u.a = itm;
return temp;
}
asn1SccMyPossiblyEmptySeqOf asn1SccMyPossiblyEmptySeqOf_Init()
{
asn1SccMyPossiblyEmptySeqOf temp;
asn1SccMyPossiblyEmptySeqOf_Initialize(&temp);
return temp;
}
asn1SccMyComplexChoice asn1SccMyComplexChoice_a_set(asn1SccMyComplexChoice_a itm)
{
asn1SccMyComplexChoice temp;
temp.kind = MyComplexChoice_a_PRESENT;
temp.u.a = itm;
return temp;
}
asn1SccDeepSeq_a_b_d asn1SccDeepSeq_a_b_d_e_set(flag itm)
{
asn1SccDeepSeq_a_b_d temp;
temp.kind = e_PRESENT;
temp.u.e = itm;
return temp;
}
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