Commit 3dd5153e authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Add test case for sequence of

parent 08b99c71
include ../shared.mk
all: test-ada test-llvm
edit:
$(OPENGEODE) test.pr
test-parse:
$(OPENGEODE) test.pr --check
test-ada:
$(OPENGEODE) test.pr --toAda
$(ASN1SCC) -Ada dataview.asn -typePrefix asn1Scc -equal
$(GNATMAKE) -O$(O) -c *.adb
$(GNATBIND) -n test.ali
gnat make test_ada.ada
simu:
$(OPENGEODE) test.pr --shared
./test_simu.sh
test-c:
$(OPENGEODE) test.pr --toC
$(ASN1SCC) -c dataview.asn -typePrefix asn1Scc -equal
$(CC) -O$(O) -c *.c
test-llvm:
$(OPENGEODE) test.pr --llvm -O$(O)
$(LLC) *.ll
$(CC) -O$(O) -c *.s
coverage:
coverage run -p $(OPENGEODE) test.pr --toAda
.PHONY: all edit test-parse test-ada test-llvm coverage simu
TASTE-Dataview DEFINITIONS ::=
BEGIN
MySeqOf ::= SEQUENCE (SIZE (1..10)) OF BOOLEAN
MyBoolean ::= BOOLEAN
END
system test;
/* CIF TEXT (164, 303), (356, 219) */
-- Text area for declarations and comments
use datamodel comment 'dataview.asn';
signal seqof1(MySeqOf);
/* CIF ENDTEXT */
channel c
from env to test with seqof1;
endchannel;
block test;
signalroute r
from env to test with seqof1;
connect c and r;
/* CIF PROCESS (202, 142), (150, 75) */
process test;
/* CIF TEXT (438, 271), (287, 140) */
dcl s1, s2 MySeqof;
dcl boo MyBoolean;
/* CIF ENDTEXT */
/* CIF START (198, 56), (70, 35) */
START;
/* CIF task (133, 111), (199, 35) */
task s2 := { true, true, false, true };
/* CIF PROCEDURECALL (157, 161), (152, 35) */
call writeln ( length (s1) )
/* CIF comment (329, 161), (188, 35) */
comment 'Uninitialized => will return 0';
/* CIF task (183, 216), (99, 35) */
task s1 := s2 (1,3)
/* CIF comment (302, 216), (284, 38) */
comment 'Minimum size
s1 (1, 3) := { true, false, true} provokes a bug';
/* CIF PROCEDURECALL (157, 271), (152, 35) */
call writeln ( length (s1) );
/* CIF task (170, 326), (126, 35) */
task s1 := s1 // { false };
/* CIF PROCEDURECALL (157, 381), (152, 35) */
call writeln ( length (s1) );
/* CIF task (170, 436), (126, 35) */
task s1 := s1 // {boo};
/* CIF PROCEDURECALL (157, 491), (152, 35) */
call writeln ( length (s1) );
/* CIF NEXTSTATE (198, 541), (70, 35) */
NEXTSTATE wait;
/* CIF state (596, 470), (70, 35) */
state wait;
endstate;
endprocess test;
endblock;
endsystem;
\ No newline at end of file
with text_io, test;
use text_io, test;
procedure test_ada is
begin
put_line ("hello");
end;
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