Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
OpenGEODE
Commits
b0f7abd0
Commit
b0f7abd0
authored
Oct 25, 2015
by
Maxime Perrotin
Browse files
Test priority handling in nested states
parent
a3c79eb8
Changes
8
Hide whitespace changes
Inline
Side-by-side
tests/regression/test-nestedpriority/Makefile
0 → 100644
View file @
b0f7abd0
include
../shared.mk
all
:
test-ada test-llvm
edit
:
$(OPENGEODE)
challenge.pr system_structure.pr
test-parse
:
$(OPENGEODE)
challenge.pr system_structure.pr
--check
test-ada
:
challenge.ali dataview-uniq.o | test_ada.o
$(GNATBIND)
-n
challenge.ali
$(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
tests/regression/test-nestedpriority/challenge.pr
0 → 100644
View file @
b0f7abd0
/* CIF PROCESS (150, 150), (150, 75) */
PROCESS challenge;
STATE nested;
SUBSTRUCTURE
STATE nested_1;
SUBSTRUCTURE
/* CIF PROCEDURE (104, 101), (70, 35) */
PROCEDURE exit;
/* CIF START (198, 116), (70, 35) */
START;
/* CIF PROCEDURECALL (142, 166), (181, 35) */
CALL writeln('exit nested_1');
/* CIF RETURN (215, 216), (35, 35) */
RETURN ;
ENDPROCEDURE;
/* CIF PROCEDURE (110, 183), (74, 35) */
PROCEDURE entry;
/* CIF START (105, 54), (70, 35) */
START;
/* CIF PROCEDURECALL (34, 104), (210, 35) */
CALL writeln('entering nested_1');
/* CIF RETURN (122, 154), (35, 35) */
RETURN ;
ENDPROCEDURE;
/* CIF START (245, 55), (70, 35) */
START;
/* CIF NEXTSTATE (233, 105), (93, 35) */
NEXTSTATE nested_2;
/* CIF STATE (276, 165), (93, 35) */
STATE nested_2;
/* CIF INPUT (287, 220), (70, 35) */
INPUT run;
/* CIF PROCEDURECALL (263, 270), (118, 35) */
CALL writeln('OK');
/* CIF NEXTSTATE (287, 320), (70, 35) */
NEXTSTATE -;
ENDSTATE;
ENDSUBSTRUCTURE;
/* CIF PROCEDURE (334, 58), (70, 35) */
PROCEDURE exit;
/* CIF START (76, 53), (70, 35) */
START;
/* CIF PROCEDURECALL (27, 103), (167, 35) */
CALL writeln('exit nested');
/* CIF RETURN (93, 153), (35, 35) */
RETURN ;
ENDPROCEDURE;
/* CIF PROCEDURE (340, 134), (74, 35) */
PROCEDURE entry;
/* CIF START (121, 85), (70, 35) */
START;
/* CIF PROCEDURECALL (57, 135), (196, 35) */
CALL writeln('entering nested');
/* CIF RETURN (138, 185), (35, 35) */
RETURN ;
ENDPROCEDURE;
/* CIF START (136, 68), (70, 35) */
START;
/* CIF NEXTSTATE (124, 118), (93, 35) */
NEXTSTATE nested_1;
/* CIF STATE (124, 118), (93, 35) */
STATE nested_1;
/* CIF INPUT (130, 173), (80, 35) */
INPUT go_off;
/* CIF RETURN (152, 223), (35, 35) */
RETURN ;
ENDSTATE;
ENDSUBSTRUCTURE;
/* CIF START (92, 76), (68, 37) */
START;
/* CIF NEXTSTATE (86, 128), (79, 35) */
NEXTSTATE nested;
/* CIF STATE (389, 131), (70, 35) */
STATE well;
ENDSTATE;
/* CIF STATE (86, 128), (79, 35) */
STATE nested;
/* CIF INPUT (145, 183), (70, 35) */
INPUT run;
/* CIF PROCEDURECALL (105, 233), (149, 35) */
CALL writeln('FAIL');
/* CIF NEXTSTATE (145, 283), (70, 35) */
NEXTSTATE -;
/* CIF CONNECT (51, 183), (0, 35) */
CONNECT ;
/* CIF NEXTSTATE (12, 233), (78, 35) */
NEXTSTATE well;
ENDSTATE;
ENDPROCESS challenge;
\ No newline at end of file
tests/regression/test-nestedpriority/dataview-uniq.asn
0 → 100644
View file @
b0f7abd0
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
BitString ::= BIT STRING (SIZE(32))
OctString ::= OCTET STRING (SIZE(4))
SeqBit ::= SEQUENCE (SIZE(32)) OF BOOLEAN
SeqBit2 ::= SEQUENCE (SIZE(1..32)) OF 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
challenge T-UInt32 ::= 18
bound T-UInt32 ::= 1000000
nb-bit T-UInt32 ::= 20
val-max T-UInt32 ::= 1048575
count-max T-UInt32 ::= 524288
exceed-nb T-UInt32 ::= 48575
CountTab ::= SEQUENCE (SIZE(nb-bit)) OF T-UInt32
END
tests/regression/test-nestedpriority/expected
0 → 100644
View file @
b0f7abd0
entering nested
entering nested_1
exit nested_1
exit nested
entering nested
entering nested_1
exit nested_1
exit nested
tests/regression/test-nestedpriority/system_structure.pr
0 → 100644
View file @
b0f7abd0
/* CIF Keep Specific Geode ASNFilename 'dataview-uniq.asn' */
USE Datamodel;
SYSTEM challenge;
PROCEDURE pow COMMENT '#c_predef';
FPAR
IN a T_UInt32,
IN b T_UInt32,
IN/OUT res T_UInt32;
EXTERNAL;
SIGNAL run;
SIGNAL go_off;
SIGNAL any_one;
signal any_two;
CHANNEL c
FROM ENV TO challenge WITH run, go_off, any_one, any_two;
ENDCHANNEL;
BLOCK challenge;
SIGNALROUTE r
FROM ENV TO challenge WITH run, go_off, any_one, any_two;
CONNECT c and r;
PROCESS challenge REFERENCED;
ENDBLOCK;
ENDSYSTEM;
tests/regression/test-nestedpriority/test_ada.c
0 → 100644
View file @
b0f7abd0
#include
<math.h>
#include
<stdio.h>
/* Ada code external interface */
extern
void
challenge_run
();
extern
void
challenge_go_off
();
extern
int
adainit
();
//extern long long l_result;
/* Provide code called by the Ada state machine as external procedure */
void
challenge_RI_pow
(
long
long
*
a
,
long
long
*
b
,
long
long
*
res
)
{
*
res
=
(
long
long
)
pow
((
double
)
*
a
,
(
double
)
*
b
);
}
int
main
()
{
adainit
();
challenge_run
();
challenge_go_off
();
return
0
;
}
tests/regression/test-nestedpriority/test_c.c
0 → 100644
View file @
b0f7abd0
int
main
()
{
// CInit();
runTransition
(
0
);
run
();
go_off
();
return
0
;
}
tests/regression/test-nestedpriority/test_llvm.c
0 → 100644
View file @
b0f7abd0
#include
<math.h>
#include
<stdio.h>
/* Ada code external interface */
extern
void
challenge_run
();
extern
void
challenge_go_off
();
extern
int
challenge_startup
();
//extern long long l_result;
/* Provide code called by the Ada state machine as external procedure */
void
challenge_RI_pow
(
long
long
*
a
,
long
long
*
b
,
long
long
*
res
)
{
*
res
=
(
long
long
)
pow
((
double
)
*
a
,
(
double
)
*
b
);
}
int
main
()
{
challenge_startup
();
challenge_run
();
challenge_go_off
();
return
0
;
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment