Commit fc542020 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Add test case coming from taste regression suite

used for regression testing of signed/unsigned cases with asn1sccv4
parent b3b06f55
include ../shared.mk
all: test-ada test-llvm
edit:
$(OPENGEODE) f1.pr system_structure.pr
test-parse:
$(OPENGEODE) f1.pr system_structure.pr --check
test-ada: f1.ali dataview-uniq.o | test_ada.o
$(GNATBIND) -n f1.ali
$(GNATLINK) -o test_ada test_ada.o dataview-uniq.o f1.ali -lgnat
./test_ada
#gcov f1.adb
test-c: f1.c test_c.o dataview-uniq.o
$(CC) f1.c -c -o f1.o
$(CC) test_c.o f1.c dataview-uniq.o -lm -o test_c
./test_c | diff expected -
test-llvm: f1.o dataview-uniq.o | test_llvm.o
$(CC) f1.o dataview-uniq.o test_llvm.o -o test_llvm -lm
./test_llvm
coverage:
coverage run -p $(OPENGEODE) f1.pr system_structure.pr --toAda
.PHONY: all edit test-parse test-ada test-llvm coverage
TASTE-BasicTypes DEFINITIONS ::=
BEGIN
-- Set of TASTE predefined basic types
T-Int32 ::= INTEGER (-2147483648 .. 2147483647)
T-UInt32 ::= INTEGER (0 .. 4294967295)
T-Int8 ::= INTEGER (-128 .. 127)
T-UInt8 ::= INTEGER (0 .. 255)
T-Boolean ::= BOOLEAN
END
TASTE-Dataview DEFINITIONS ::=
BEGIN
IMPORTS T-Int32, T-UInt32, T-Int8, T-UInt8, T-Boolean FROM TASTE-BasicTypes;
-- A few simple types to start with ASN.1
MyInteger ::= T-UInt8
MySeq ::= SEQUENCE {
a MyInteger,
b ENUMERATED { f1, f2, f4 }
}
END
/* CIF PROCESS (250, 150), (150, 75) */
PROCESS f1;
/* CIF TEXT (640, 106), (356, 46) */
dcl p myseq := {a 1, b f1};
/* CIF ENDTEXT */
/* CIF START (447, 88), (70, 35) */
START;
/* CIF NEXTSTATE (446, 138), (72, 35) */
NEXTSTATE Wait;
/* CIF STATE (446, 138), (72, 35) */
STATE Wait;
/* CIF INPUT (442, 193), (80, 35) */
INPUT pulse;
/* CIF OUTPUT (446, 243), (72, 35) */
OUTPUT AA(p);
/* CIF PROCEDURECALL (382, 293), (200, 35) */
CALL writeln('F1 Calls with', p!a);
/* CIF TASK (371, 343), (221, 35) */
TASK p!a := (p!a + 1) mod 255;
/* CIF NEXTSTATE (447, 393), (70, 35) */
NEXTSTATE -;
ENDSTATE;
ENDPROCESS f1;
\ No newline at end of file
/* CIF Keep Specific Geode ASNFilename 'dataview-uniq.asn' */
USE Datamodel;
SYSTEM f1;
SIGNAL pulse;
/* CIF Keep Specific Geode PARAMNAMES p */
SIGNAL AA (MySeq);
CHANNEL c
FROM ENV TO f1 WITH pulse;
FROM f1 TO ENV WITH AA;
ENDCHANNEL;
BLOCK f1;
SIGNALROUTE r
FROM ENV TO f1 WITH pulse;
FROM f1 TO ENV WITH AA;
CONNECT c and r;
PROCESS f1 REFERENCED;
ENDBLOCK;
ENDSYSTEM;
\ 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