diff --git a/test/CTestTestfile.cmake b/test/CTestTestfile.cmake index 734daa1..913115d 100644 --- a/test/CTestTestfile.cmake +++ b/test/CTestTestfile.cmake @@ -49,6 +49,8 @@ ADD_TEST(compile_only_ce "scripts/compile_only" "good/ce.ept") ADD_TEST(compile_only_ckannot "scripts/compile_only" "good/ckannot.ept") ADD_TEST(compile_only_clock_causality "scripts/compile_only" "good/clock_causality.ept") ADD_TEST(compile_only_clocks "scripts/compile_only" "good/clocks.ept") +ADD_TEST(compile_only_const_record "scripts/compile_only" "good/const_record.ept") +ADD_TEST(compile_only_const_scope "scripts/compile_only" "good/const_scope.ept") ADD_TEST(compile_only_contract_automaton "scripts/compile_only" "good/contract_automaton.ept") ADD_TEST(compile_only_contract "scripts/compile_only" "good/contract.ept") ADD_TEST(compile_only_convolutions "scripts/compile_only" "good/convolutions.ept") @@ -71,6 +73,7 @@ ADD_TEST(compile_only_mapnot "scripts/compile_only" "good/mapnot.ept") ADD_TEST(compile_only_memalloc_clocks "scripts/compile_only" "good/memalloc_clocks.ept") ADD_TEST(compile_only_memalloc_record "scripts/compile_only" "good/memalloc_record.ept") ADD_TEST(compile_only_memalloc_simple "scripts/compile_only" "good/memalloc_simple.ept") +ADD_TEST(compile_only_minus_pre "scripts/compile_only" "good/minus_pre.ept") ADD_TEST(compile_only_name_clash "scripts/compile_only" "good/name_clash.ept") ADD_TEST(compile_only_norm "scripts/compile_only" "good/norm.ept") ADD_TEST(compile_only_or_keep "scripts/compile_only" "good/or_keep.ept") @@ -133,6 +136,8 @@ ADD_TEST(compile_gcc_run_ce "scripts/compile_gcc_run" "good/ce.ept") ADD_TEST(compile_gcc_run_ckannot "scripts/compile_gcc_run" "good/ckannot.ept") ADD_TEST(compile_gcc_run_clock_causality "scripts/compile_gcc_run" "good/clock_causality.ept") ADD_TEST(compile_gcc_run_clocks "scripts/compile_gcc_run" "good/clocks.ept") +ADD_TEST(compile_gcc_run_const_record "scripts/compile_gcc_run" "good/const_record.ept") +ADD_TEST(compile_gcc_run_const_scope "scripts/compile_gcc_run" "good/const_scope.ept") ADD_TEST(compile_gcc_run_contract_automaton "scripts/compile_gcc_run" "good/contract_automaton.ept") ADD_TEST(compile_gcc_run_contract "scripts/compile_gcc_run" "good/contract.ept") ADD_TEST(compile_gcc_run_convolutions "scripts/compile_gcc_run" "good/convolutions.ept") @@ -155,6 +160,7 @@ ADD_TEST(compile_gcc_run_mapnot "scripts/compile_gcc_run" "good/mapnot.ept") ADD_TEST(compile_gcc_run_memalloc_clocks "scripts/compile_gcc_run" "good/memalloc_clocks.ept") ADD_TEST(compile_gcc_run_memalloc_record "scripts/compile_gcc_run" "good/memalloc_record.ept") ADD_TEST(compile_gcc_run_memalloc_simple "scripts/compile_gcc_run" "good/memalloc_simple.ept") +ADD_TEST(compile_gcc_run_minus_pre "scripts/compile_gcc_run" "good/minus_pre.ept") ADD_TEST(compile_gcc_run_name_clash "scripts/compile_gcc_run" "good/name_clash.ept") ADD_TEST(compile_gcc_run_norm "scripts/compile_gcc_run" "good/norm.ept") ADD_TEST(compile_gcc_run_or_keep "scripts/compile_gcc_run" "good/or_keep.ept") @@ -217,6 +223,8 @@ ADD_TEST(test_option_bool_ce "scripts/test_option" "good/ce.ept" "-bool") ADD_TEST(test_option_bool_ckannot "scripts/test_option" "good/ckannot.ept" "-bool") ADD_TEST(test_option_bool_clock_causality "scripts/test_option" "good/clock_causality.ept" "-bool") ADD_TEST(test_option_bool_clocks "scripts/test_option" "good/clocks.ept" "-bool") +ADD_TEST(test_option_bool_const_record "scripts/test_option" "good/const_record.ept" "-bool") +ADD_TEST(test_option_bool_const_scope "scripts/test_option" "good/const_scope.ept" "-bool") ADD_TEST(test_option_bool_contract_automaton "scripts/test_option" "good/contract_automaton.ept" "-bool") ADD_TEST(test_option_bool_contract "scripts/test_option" "good/contract.ept" "-bool") ADD_TEST(test_option_bool_convolutions "scripts/test_option" "good/convolutions.ept" "-bool") @@ -239,6 +247,7 @@ ADD_TEST(test_option_bool_mapnot "scripts/test_option" "good/mapnot.ept" "-bool" ADD_TEST(test_option_bool_memalloc_clocks "scripts/test_option" "good/memalloc_clocks.ept" "-bool") ADD_TEST(test_option_bool_memalloc_record "scripts/test_option" "good/memalloc_record.ept" "-bool") ADD_TEST(test_option_bool_memalloc_simple "scripts/test_option" "good/memalloc_simple.ept" "-bool") +ADD_TEST(test_option_bool_minus_pre "scripts/test_option" "good/minus_pre.ept" "-bool") ADD_TEST(test_option_bool_name_clash "scripts/test_option" "good/name_clash.ept" "-bool") ADD_TEST(test_option_bool_norm "scripts/test_option" "good/norm.ept" "-bool") ADD_TEST(test_option_bool_or_keep "scripts/test_option" "good/or_keep.ept" "-bool") @@ -301,6 +310,8 @@ ADD_TEST(test_option_deadcode_ce "scripts/test_option" "good/ce.ept" "-deadcode" ADD_TEST(test_option_deadcode_ckannot "scripts/test_option" "good/ckannot.ept" "-deadcode") ADD_TEST(test_option_deadcode_clock_causality "scripts/test_option" "good/clock_causality.ept" "-deadcode") ADD_TEST(test_option_deadcode_clocks "scripts/test_option" "good/clocks.ept" "-deadcode") +ADD_TEST(test_option_deadcode_const_record "scripts/test_option" "good/const_record.ept" "-deadcode") +ADD_TEST(test_option_deadcode_const_scope "scripts/test_option" "good/const_scope.ept" "-deadcode") ADD_TEST(test_option_deadcode_contract_automaton "scripts/test_option" "good/contract_automaton.ept" "-deadcode") ADD_TEST(test_option_deadcode_contract "scripts/test_option" "good/contract.ept" "-deadcode") ADD_TEST(test_option_deadcode_convolutions "scripts/test_option" "good/convolutions.ept" "-deadcode") @@ -323,6 +334,7 @@ ADD_TEST(test_option_deadcode_mapnot "scripts/test_option" "good/mapnot.ept" "-d ADD_TEST(test_option_deadcode_memalloc_clocks "scripts/test_option" "good/memalloc_clocks.ept" "-deadcode") ADD_TEST(test_option_deadcode_memalloc_record "scripts/test_option" "good/memalloc_record.ept" "-deadcode") ADD_TEST(test_option_deadcode_memalloc_simple "scripts/test_option" "good/memalloc_simple.ept" "-deadcode") +ADD_TEST(test_option_deadcode_minus_pre "scripts/test_option" "good/minus_pre.ept" "-deadcode") ADD_TEST(test_option_deadcode_name_clash "scripts/test_option" "good/name_clash.ept" "-deadcode") ADD_TEST(test_option_deadcode_norm "scripts/test_option" "good/norm.ept" "-deadcode") ADD_TEST(test_option_deadcode_or_keep "scripts/test_option" "good/or_keep.ept" "-deadcode") @@ -385,6 +397,8 @@ ADD_TEST(test_option_tomato_ce "scripts/test_option" "good/ce.ept" "-tomato") ADD_TEST(test_option_tomato_ckannot "scripts/test_option" "good/ckannot.ept" "-tomato") ADD_TEST(test_option_tomato_clock_causality "scripts/test_option" "good/clock_causality.ept" "-tomato") ADD_TEST(test_option_tomato_clocks "scripts/test_option" "good/clocks.ept" "-tomato") +ADD_TEST(test_option_tomato_const_record "scripts/test_option" "good/const_record.ept" "-tomato") +ADD_TEST(test_option_tomato_const_scope "scripts/test_option" "good/const_scope.ept" "-tomato") ADD_TEST(test_option_tomato_contract_automaton "scripts/test_option" "good/contract_automaton.ept" "-tomato") ADD_TEST(test_option_tomato_contract "scripts/test_option" "good/contract.ept" "-tomato") ADD_TEST(test_option_tomato_convolutions "scripts/test_option" "good/convolutions.ept" "-tomato") @@ -407,6 +421,7 @@ ADD_TEST(test_option_tomato_mapnot "scripts/test_option" "good/mapnot.ept" "-tom ADD_TEST(test_option_tomato_memalloc_clocks "scripts/test_option" "good/memalloc_clocks.ept" "-tomato") ADD_TEST(test_option_tomato_memalloc_record "scripts/test_option" "good/memalloc_record.ept" "-tomato") ADD_TEST(test_option_tomato_memalloc_simple "scripts/test_option" "good/memalloc_simple.ept" "-tomato") +ADD_TEST(test_option_tomato_minus_pre "scripts/test_option" "good/minus_pre.ept" "-tomato") ADD_TEST(test_option_tomato_name_clash "scripts/test_option" "good/name_clash.ept" "-tomato") ADD_TEST(test_option_tomato_norm "scripts/test_option" "good/norm.ept" "-tomato") ADD_TEST(test_option_tomato_or_keep "scripts/test_option" "good/or_keep.ept" "-tomato") @@ -469,6 +484,8 @@ ADD_TEST(test_option_flatten_ce "scripts/test_option" "good/ce.ept" "-flatten") ADD_TEST(test_option_flatten_ckannot "scripts/test_option" "good/ckannot.ept" "-flatten") ADD_TEST(test_option_flatten_clock_causality "scripts/test_option" "good/clock_causality.ept" "-flatten") ADD_TEST(test_option_flatten_clocks "scripts/test_option" "good/clocks.ept" "-flatten") +ADD_TEST(test_option_flatten_const_record "scripts/test_option" "good/const_record.ept" "-flatten") +ADD_TEST(test_option_flatten_const_scope "scripts/test_option" "good/const_scope.ept" "-flatten") ADD_TEST(test_option_flatten_contract_automaton "scripts/test_option" "good/contract_automaton.ept" "-flatten") ADD_TEST(test_option_flatten_contract "scripts/test_option" "good/contract.ept" "-flatten") ADD_TEST(test_option_flatten_convolutions "scripts/test_option" "good/convolutions.ept" "-flatten") @@ -491,6 +508,7 @@ ADD_TEST(test_option_flatten_mapnot "scripts/test_option" "good/mapnot.ept" "-fl ADD_TEST(test_option_flatten_memalloc_clocks "scripts/test_option" "good/memalloc_clocks.ept" "-flatten") ADD_TEST(test_option_flatten_memalloc_record "scripts/test_option" "good/memalloc_record.ept" "-flatten") ADD_TEST(test_option_flatten_memalloc_simple "scripts/test_option" "good/memalloc_simple.ept" "-flatten") +ADD_TEST(test_option_flatten_minus_pre "scripts/test_option" "good/minus_pre.ept" "-flatten") ADD_TEST(test_option_flatten_name_clash "scripts/test_option" "good/name_clash.ept" "-flatten") ADD_TEST(test_option_flatten_norm "scripts/test_option" "good/norm.ept" "-flatten") ADD_TEST(test_option_flatten_or_keep "scripts/test_option" "good/or_keep.ept" "-flatten") @@ -553,6 +571,8 @@ ADD_TEST(test_option_itfusion_ce "scripts/test_option" "good/ce.ept" "-itfusion" ADD_TEST(test_option_itfusion_ckannot "scripts/test_option" "good/ckannot.ept" "-itfusion") ADD_TEST(test_option_itfusion_clock_causality "scripts/test_option" "good/clock_causality.ept" "-itfusion") ADD_TEST(test_option_itfusion_clocks "scripts/test_option" "good/clocks.ept" "-itfusion") +ADD_TEST(test_option_itfusion_const_record "scripts/test_option" "good/const_record.ept" "-itfusion") +ADD_TEST(test_option_itfusion_const_scope "scripts/test_option" "good/const_scope.ept" "-itfusion") ADD_TEST(test_option_itfusion_contract_automaton "scripts/test_option" "good/contract_automaton.ept" "-itfusion") ADD_TEST(test_option_itfusion_contract "scripts/test_option" "good/contract.ept" "-itfusion") ADD_TEST(test_option_itfusion_convolutions "scripts/test_option" "good/convolutions.ept" "-itfusion") @@ -575,6 +595,7 @@ ADD_TEST(test_option_itfusion_mapnot "scripts/test_option" "good/mapnot.ept" "-i ADD_TEST(test_option_itfusion_memalloc_clocks "scripts/test_option" "good/memalloc_clocks.ept" "-itfusion") ADD_TEST(test_option_itfusion_memalloc_record "scripts/test_option" "good/memalloc_record.ept" "-itfusion") ADD_TEST(test_option_itfusion_memalloc_simple "scripts/test_option" "good/memalloc_simple.ept" "-itfusion") +ADD_TEST(test_option_itfusion_minus_pre "scripts/test_option" "good/minus_pre.ept" "-itfusion") ADD_TEST(test_option_itfusion_name_clash "scripts/test_option" "good/name_clash.ept" "-itfusion") ADD_TEST(test_option_itfusion_norm "scripts/test_option" "good/norm.ept" "-itfusion") ADD_TEST(test_option_itfusion_or_keep "scripts/test_option" "good/or_keep.ept" "-itfusion") @@ -637,6 +658,8 @@ ADD_TEST(test_option_memalloc_ce "scripts/test_option" "good/ce.ept" "-memalloc" ADD_TEST(test_option_memalloc_ckannot "scripts/test_option" "good/ckannot.ept" "-memalloc") ADD_TEST(test_option_memalloc_clock_causality "scripts/test_option" "good/clock_causality.ept" "-memalloc") ADD_TEST(test_option_memalloc_clocks "scripts/test_option" "good/clocks.ept" "-memalloc") +ADD_TEST(test_option_memalloc_const_record "scripts/test_option" "good/const_record.ept" "-memalloc") +ADD_TEST(test_option_memalloc_const_scope "scripts/test_option" "good/const_scope.ept" "-memalloc") ADD_TEST(test_option_memalloc_contract_automaton "scripts/test_option" "good/contract_automaton.ept" "-memalloc") ADD_TEST(test_option_memalloc_contract "scripts/test_option" "good/contract.ept" "-memalloc") ADD_TEST(test_option_memalloc_convolutions "scripts/test_option" "good/convolutions.ept" "-memalloc") @@ -659,6 +682,7 @@ ADD_TEST(test_option_memalloc_mapnot "scripts/test_option" "good/mapnot.ept" "-m ADD_TEST(test_option_memalloc_memalloc_clocks "scripts/test_option" "good/memalloc_clocks.ept" "-memalloc") ADD_TEST(test_option_memalloc_memalloc_record "scripts/test_option" "good/memalloc_record.ept" "-memalloc") ADD_TEST(test_option_memalloc_memalloc_simple "scripts/test_option" "good/memalloc_simple.ept" "-memalloc") +ADD_TEST(test_option_memalloc_minus_pre "scripts/test_option" "good/minus_pre.ept" "-memalloc") ADD_TEST(test_option_memalloc_name_clash "scripts/test_option" "good/name_clash.ept" "-memalloc") ADD_TEST(test_option_memalloc_norm "scripts/test_option" "good/norm.ept" "-memalloc") ADD_TEST(test_option_memalloc_or_keep "scripts/test_option" "good/or_keep.ept" "-memalloc") @@ -721,6 +745,8 @@ ADD_TEST(test_option_unroll_ce "scripts/test_option" "good/ce.ept" "-unroll") ADD_TEST(test_option_unroll_ckannot "scripts/test_option" "good/ckannot.ept" "-unroll") ADD_TEST(test_option_unroll_clock_causality "scripts/test_option" "good/clock_causality.ept" "-unroll") ADD_TEST(test_option_unroll_clocks "scripts/test_option" "good/clocks.ept" "-unroll") +ADD_TEST(test_option_unroll_const_record "scripts/test_option" "good/const_record.ept" "-unroll") +ADD_TEST(test_option_unroll_const_scope "scripts/test_option" "good/const_scope.ept" "-unroll") ADD_TEST(test_option_unroll_contract_automaton "scripts/test_option" "good/contract_automaton.ept" "-unroll") ADD_TEST(test_option_unroll_contract "scripts/test_option" "good/contract.ept" "-unroll") ADD_TEST(test_option_unroll_convolutions "scripts/test_option" "good/convolutions.ept" "-unroll") @@ -743,6 +769,7 @@ ADD_TEST(test_option_unroll_mapnot "scripts/test_option" "good/mapnot.ept" "-unr ADD_TEST(test_option_unroll_memalloc_clocks "scripts/test_option" "good/memalloc_clocks.ept" "-unroll") ADD_TEST(test_option_unroll_memalloc_record "scripts/test_option" "good/memalloc_record.ept" "-unroll") ADD_TEST(test_option_unroll_memalloc_simple "scripts/test_option" "good/memalloc_simple.ept" "-unroll") +ADD_TEST(test_option_unroll_minus_pre "scripts/test_option" "good/minus_pre.ept" "-unroll") ADD_TEST(test_option_unroll_name_clash "scripts/test_option" "good/name_clash.ept" "-unroll") ADD_TEST(test_option_unroll_norm "scripts/test_option" "good/norm.ept" "-unroll") ADD_TEST(test_option_unroll_or_keep "scripts/test_option" "good/or_keep.ept" "-unroll") @@ -805,6 +832,8 @@ ADD_TEST(test_option_O_ce "scripts/test_option" "good/ce.ept" "-O") ADD_TEST(test_option_O_ckannot "scripts/test_option" "good/ckannot.ept" "-O") ADD_TEST(test_option_O_clock_causality "scripts/test_option" "good/clock_causality.ept" "-O") ADD_TEST(test_option_O_clocks "scripts/test_option" "good/clocks.ept" "-O") +ADD_TEST(test_option_O_const_record "scripts/test_option" "good/const_record.ept" "-O") +ADD_TEST(test_option_O_const_scope "scripts/test_option" "good/const_scope.ept" "-O") ADD_TEST(test_option_O_contract_automaton "scripts/test_option" "good/contract_automaton.ept" "-O") ADD_TEST(test_option_O_contract "scripts/test_option" "good/contract.ept" "-O") ADD_TEST(test_option_O_convolutions "scripts/test_option" "good/convolutions.ept" "-O") @@ -827,6 +856,7 @@ ADD_TEST(test_option_O_mapnot "scripts/test_option" "good/mapnot.ept" "-O") ADD_TEST(test_option_O_memalloc_clocks "scripts/test_option" "good/memalloc_clocks.ept" "-O") ADD_TEST(test_option_O_memalloc_record "scripts/test_option" "good/memalloc_record.ept" "-O") ADD_TEST(test_option_O_memalloc_simple "scripts/test_option" "good/memalloc_simple.ept" "-O") +ADD_TEST(test_option_O_minus_pre "scripts/test_option" "good/minus_pre.ept" "-O") ADD_TEST(test_option_O_name_clash "scripts/test_option" "good/name_clash.ept" "-O") ADD_TEST(test_option_O_norm "scripts/test_option" "good/norm.ept" "-O") ADD_TEST(test_option_O_or_keep "scripts/test_option" "good/or_keep.ept" "-O") @@ -889,6 +919,8 @@ ADD_TEST(compile_javac_run_ce "scripts/compile_javac_run" "good/ce.ept") ADD_TEST(compile_javac_run_ckannot "scripts/compile_javac_run" "good/ckannot.ept") ADD_TEST(compile_javac_run_clock_causality "scripts/compile_javac_run" "good/clock_causality.ept") ADD_TEST(compile_javac_run_clocks "scripts/compile_javac_run" "good/clocks.ept") +ADD_TEST(compile_javac_run_const_record "scripts/compile_javac_run" "good/const_record.ept") +ADD_TEST(compile_javac_run_const_scope "scripts/compile_javac_run" "good/const_scope.ept") ADD_TEST(compile_javac_run_contract_automaton "scripts/compile_javac_run" "good/contract_automaton.ept") ADD_TEST(compile_javac_run_contract "scripts/compile_javac_run" "good/contract.ept") ADD_TEST(compile_javac_run_convolutions "scripts/compile_javac_run" "good/convolutions.ept") @@ -911,6 +943,7 @@ ADD_TEST(compile_javac_run_mapnot "scripts/compile_javac_run" "good/mapnot.ept") ADD_TEST(compile_javac_run_memalloc_clocks "scripts/compile_javac_run" "good/memalloc_clocks.ept") ADD_TEST(compile_javac_run_memalloc_record "scripts/compile_javac_run" "good/memalloc_record.ept") ADD_TEST(compile_javac_run_memalloc_simple "scripts/compile_javac_run" "good/memalloc_simple.ept") +ADD_TEST(compile_javac_run_minus_pre "scripts/compile_javac_run" "good/minus_pre.ept") ADD_TEST(compile_javac_run_name_clash "scripts/compile_javac_run" "good/name_clash.ept") ADD_TEST(compile_javac_run_norm "scripts/compile_javac_run" "good/norm.ept") ADD_TEST(compile_javac_run_or_keep "scripts/compile_javac_run" "good/or_keep.ept") diff --git a/test/good/auto_clock.ept b/test/good/auto_clock.ept new file mode 100644 index 0000000..5406b95 --- /dev/null +++ b/test/good/auto_clock.ept @@ -0,0 +1,10 @@ +node when2(x :int; c :bool) returns (y :int) +let + automaton + state FirstPeriod do + y = x when c; + until true then Cruise + state Cruise do + y = x when c; + end +tel diff --git a/test/good/const_record.ept b/test/good/const_record.ept new file mode 100644 index 0000000..75df68f --- /dev/null +++ b/test/good/const_record.ept @@ -0,0 +1,8 @@ +type record = { a : int; b : int } +const a : record = { a = 0; b = 1 } +const b : record^2 = [a, a] + +node main() = (o:int) +let + o = (b[0]).a +tel diff --git a/test/good/const_scope.ept b/test/good/const_scope.ept new file mode 100644 index 0000000..42bf1c3 --- /dev/null +++ b/test/good/const_scope.ept @@ -0,0 +1,5 @@ +const nat :float = 0.0 +node main() = (nat : int) +let +nat = 0 fby (nat + 1) +tel diff --git a/test/good/minus_pre.ept b/test/good/minus_pre.ept new file mode 100644 index 0000000..d699855 --- /dev/null +++ b/test/good/minus_pre.ept @@ -0,0 +1,5 @@ +node main() = (o,p:int) +let + o = ~-1 -> pre o + 1; + p = -1 fby p + 1 +tel