Commit a5f381d3 authored by Maxime Perrotin's avatar Maxime Perrotin

Add test case for IN expressions

parent f82f1d95
include ../shared.mk
ROOT_MODEL=og.pr
all: test-ada test-llvm
edit:
$(OPENGEODE) og.pr
test-parse:
$(OPENGEODE) og.pr --check
test-qgen-parse:
$(TESTQGEN_PARSE) $(ROOT_MODEL)
test-qgen-ada:
$(TESTQGEN_ADA) $(ROOT_MODEL)
test-qgen-c:
$(TESTQGEN_C) $(ROOT_MODEL)
test-qgen-gt-ada:
$(TESTQGEN_GT_ADA) $(ROOT_MODEL)
test-qgen-gt-c:
$(TESTQGEN_GT_C) $(ROOT_MODEL)
test-ada:
make -f Makefile.og
test-c:
$(OPENGEODE) og.pr --toC
mono $(ASN1SCC) -c -typePrefix asn1Scc -equal dataview-uniq.asn
$(CC) -O$(O) -c *.c
test-llvm:
$(OPENGEODE) og.pr --llvm -O$(O)
$(LLC) *.ll
$(CC) -O$(O) -c *.s
coverage:
coverage run -p $(OPENGEODE) og.pr --toAda
.PHONY: all edit test-parse test-ada test-llvm coverage
all:
gprbuild -p -P og.gpr # generate Ada code from the SDL model
gprbuild -p -P dataview_ada.gpr # generate Ada code from the ASN.1 model
gprbuild -p -P code/og_ada.gpr # build the Ada code
clean:
rm -rf obj code
\ No newline at end of file
TASTE-Dataview DEFINITIONS ::=
BEGIN
MyChoice ::= CHOICE {
a CHOICE {
b CHOICE {
c BOOLEAN,
d BOOLEAN
},
e BOOLEAN
},
f BOOLEAN
}
Some-Thing ::= MyInteger
MyInteger ::= INTEGER (0..255)
My-OctStr ::= OCTET STRING (SIZE (0..20))
SeqOf ::= SEQUENCE (SIZE(0..100)) OF MyInteger
Type1 ::= INTEGER(0..1)
Type2 ::= BOOLEAN
Toto ::= SEQUENCE { elem-1 Type1, elem-2 Type2 }
SeqBool ::= SEQUENCE(SIZE(1..5)) OF BOOLEAN
Enum-T ::= ENUMERATED {enum1, enum2, enum3}
default-seqof SeqOf ::= {4,7,9}
default-str My-OctStr ::= 'DEADBEEF'H
END
system og;
/* CIF TEXT (159, 221), (290, 200) */
-- Text area for declarations and comments
use dv comment 'dataview-uniq.asn';
--use dv2 comment 'dataview2.asn';
signal dd(Type2);
signal we(Some_Thing);
procedure hehe;
fpar in/out a_param Type2;
external;
/* CIF ENDTEXT */
channel c
from env to og with dd;
from og to env with we;
endchannel;
block og;
signalroute r
from env to og with dd;
from og to env with we;
connect c and r;
/* CIF PROCESS (225, 49), (150, 75) */
process og;
/* CIF TEXT (57, 58), (290, 173) */
dcl test Some_Thing := 4;
dcl someEnum Enum_T := enum2;
dcl somSeq Toto := {elem_1 1, elem_2 false};
/* CIF ENDTEXT */
/* CIF START (371, 221), (70, 35) */
START;
/* CIF decision (348, 276), (115, 50) */
decision test in { 1,2,3,4};
/* CIF ANSWER (287, 346), (70, 23) */
(true):
/* CIF PROCEDURECALL (266, 389), (112, 35) */
call writeln('OK 1');
/* CIF ANSWER (416, 346), (70, 23) */
(false):
/* CIF PROCEDURECALL (383, 389), (135, 35) */
call writeln('ERROR 1');
enddecision;
/* CIF decision (359, 439), (93, 50) */
decision 3 in {1,2,3,4};
/* CIF ANSWER (293, 509), (70, 23) */
(true):
/* CIF PROCEDURECALL (268, 552), (119, 35) */
call writeln('OK 2');
/* CIF ANSWER (427, 509), (70, 23) */
(false):
/* CIF PROCEDURECALL (391, 552), (142, 35) */
call writeln('ERROR 2');
enddecision;
/* CIF decision (306, 602), (200, 50) */
decision someEnum in {enum1, enum2};
/* CIF ANSWER (290, 672), (70, 23) */
(true):
/* CIF PROCEDURECALL (265, 715), (119, 35) */
call writeln('OK 3');
/* CIF ANSWER (430, 672), (70, 23) */
(false):
/* CIF PROCEDURECALL (394, 715), (142, 35) */
call writeln('ERROR 3');
enddecision;
/* CIF decision (203, 765), (406, 50) */
decision 'someSeq in {{elem_1 1, elem_2 false}, {elem_1 0, elem_2 true}}'
/* CIF comment (629, 772), (226, 35) */
comment 'cause bug in Ada backend: FIXME';
/* CIF ANSWER (290, 835), (70, 23) */
(true):
/* CIF PROCEDURECALL (265, 878), (119, 35) */
call writeln('OK 5');
/* CIF ANSWER (430, 835), (70, 23) */
(false):
/* CIF PROCEDURECALL (394, 878), (142, 35) */
call writeln('ERROR 5');
enddecision;
/* CIF NEXTSTATE (371, 928), (70, 35) */
NEXTSTATE wait;
/* CIF state (826, 332), (70, 35) */
state wait;
endstate;
endprocess og;
endblock;
endsystem;
\ No newline at end of file
[General]
geometry=@ByteArray(\x1\xd9\xd0\xcb\0\x1\0\0\0\0\x3\xd3\0\0\0\xa3\0\0\t\xf3\0\0\x5\r\0\0\x3\xd5\0\0\0\xba\0\0\t\xf1\0\0\x5\v\0\0\0\0\0\0)
windowState="@ByteArray(\0\0\0\xff\0\0\0\0\xfd\0\0\0\x2\0\0\0\x1\0\0\x2,\0\0\x3\x65\xfc\x2\0\0\0\x1\xfc\0\0\0>\0\0\x3\x65\0\0\0\x9a\x1\0\0\x1a\xfa\0\0\0\0\x2\0\0\0\x2\xfb\0\0\0\x1c\0\x64\0\x61\0t\0\x61\0t\0y\0p\0\x65\0s\0_\0\x64\0o\0\x63\0k\x1\0\0\0\0\xff\xff\xff\xff\0\0\0\x7f\0\xff\xff\xff\xfb\0\0\0\x1a\0\x64\0\x61\0t\0\x61\0\x64\0i\0\x63\0t\0_\0\x64\0o\0\x63\0k\x1\0\0\0\0\xff\xff\xff\xff\0\0\0\x7f\0\xff\xff\xff\0\0\0\x3\0\0\x5\xea\0\0\0\x8c\xfc\x1\0\0\0\x1\xfb\0\0\0\xe\0m\0s\0g\0\x44\0o\0\x63\0k\x1\0\0\0\x33\0\0\x5\xea\0\0\0T\0\a\xff\xff\0\0\x3\xb8\0\0\x3\x65\0\0\0\x4\0\0\0\x4\0\0\0\b\0\0\0\b\xfc\0\0\0\x2\0\0\0\0\0\0\0\x1\0\0\0\x16\0S\0\x44\0L\0 \0T\0o\0o\0l\0\x62\0\x61\0r\x3\0\0\0\0\xff\xff\xff\xff\0\0\0\0\0\0\0\0\0\0\0\x2\0\0\0\x1\0\0\0\x18\0\x46\0i\0l\0\x65\0 \0T\0o\0o\0l\0\x62\0\x61\0r\x1\0\0\0\0\xff\xff\xff\xff\0\0\0\0\0\0\0\0)"
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