From 89eddd77c48a4595909800b1fc9e2d98b8bbb04c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwena=C3=ABl=20Delaval?= Date: Tue, 30 Oct 2018 17:10:26 +0100 Subject: [PATCH] Add test for xor operator --- test/CTestTestfile.cmake | 11 +++++++++++ test/good/xor.ept | 14 ++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 test/good/xor.ept diff --git a/test/CTestTestfile.cmake b/test/CTestTestfile.cmake index 913115d..d7f23b4 100644 --- a/test/CTestTestfile.cmake +++ b/test/CTestTestfile.cmake @@ -118,6 +118,7 @@ ADD_TEST(compile_only_tuple_args "scripts/compile_only" "good/tuple_args.ept") ADD_TEST(compile_only_type_alias "scripts/compile_only" "good/type_alias.ept") ADD_TEST(compile_only_updown "scripts/compile_only" "good/updown.ept") ADD_TEST(compile_only_when_merge1 "scripts/compile_only" "good/when_merge1.ept") +ADD_TEST(compile_only_xor "scripts/compile_only" "good/xor.ept") ADD_TEST(compile_gcc_run_ais "scripts/compile_gcc_run" "good/ais.ept") ADD_TEST(compile_gcc_run_alloc "scripts/compile_gcc_run" "good/alloc.ept") ADD_TEST(compile_gcc_run_array1 "scripts/compile_gcc_run" "good/array1.ept") @@ -205,6 +206,7 @@ ADD_TEST(compile_gcc_run_tuple_args "scripts/compile_gcc_run" "good/tuple_args.e ADD_TEST(compile_gcc_run_type_alias "scripts/compile_gcc_run" "good/type_alias.ept") ADD_TEST(compile_gcc_run_updown "scripts/compile_gcc_run" "good/updown.ept") ADD_TEST(compile_gcc_run_when_merge1 "scripts/compile_gcc_run" "good/when_merge1.ept") +ADD_TEST(compile_gcc_run_xor "scripts/compile_gcc_run" "good/xor.ept") ADD_TEST(test_option_bool_ais "scripts/test_option" "good/ais.ept" "-bool") ADD_TEST(test_option_bool_alloc "scripts/test_option" "good/alloc.ept" "-bool") ADD_TEST(test_option_bool_array1 "scripts/test_option" "good/array1.ept" "-bool") @@ -292,6 +294,7 @@ ADD_TEST(test_option_bool_tuple_args "scripts/test_option" "good/tuple_args.ept" ADD_TEST(test_option_bool_type_alias "scripts/test_option" "good/type_alias.ept" "-bool") ADD_TEST(test_option_bool_updown "scripts/test_option" "good/updown.ept" "-bool") ADD_TEST(test_option_bool_when_merge1 "scripts/test_option" "good/when_merge1.ept" "-bool") +ADD_TEST(test_option_bool_xor "scripts/test_option" "good/xor.ept" "-bool") ADD_TEST(test_option_deadcode_ais "scripts/test_option" "good/ais.ept" "-deadcode") ADD_TEST(test_option_deadcode_alloc "scripts/test_option" "good/alloc.ept" "-deadcode") ADD_TEST(test_option_deadcode_array1 "scripts/test_option" "good/array1.ept" "-deadcode") @@ -379,6 +382,7 @@ ADD_TEST(test_option_deadcode_tuple_args "scripts/test_option" "good/tuple_args. ADD_TEST(test_option_deadcode_type_alias "scripts/test_option" "good/type_alias.ept" "-deadcode") ADD_TEST(test_option_deadcode_updown "scripts/test_option" "good/updown.ept" "-deadcode") ADD_TEST(test_option_deadcode_when_merge1 "scripts/test_option" "good/when_merge1.ept" "-deadcode") +ADD_TEST(test_option_deadcode_xor "scripts/test_option" "good/xor.ept" "-deadcode") ADD_TEST(test_option_tomato_ais "scripts/test_option" "good/ais.ept" "-tomato") ADD_TEST(test_option_tomato_alloc "scripts/test_option" "good/alloc.ept" "-tomato") ADD_TEST(test_option_tomato_array1 "scripts/test_option" "good/array1.ept" "-tomato") @@ -466,6 +470,7 @@ ADD_TEST(test_option_tomato_tuple_args "scripts/test_option" "good/tuple_args.ep ADD_TEST(test_option_tomato_type_alias "scripts/test_option" "good/type_alias.ept" "-tomato") ADD_TEST(test_option_tomato_updown "scripts/test_option" "good/updown.ept" "-tomato") ADD_TEST(test_option_tomato_when_merge1 "scripts/test_option" "good/when_merge1.ept" "-tomato") +ADD_TEST(test_option_tomato_xor "scripts/test_option" "good/xor.ept" "-tomato") ADD_TEST(test_option_flatten_ais "scripts/test_option" "good/ais.ept" "-flatten") ADD_TEST(test_option_flatten_alloc "scripts/test_option" "good/alloc.ept" "-flatten") ADD_TEST(test_option_flatten_array1 "scripts/test_option" "good/array1.ept" "-flatten") @@ -553,6 +558,7 @@ ADD_TEST(test_option_flatten_tuple_args "scripts/test_option" "good/tuple_args.e ADD_TEST(test_option_flatten_type_alias "scripts/test_option" "good/type_alias.ept" "-flatten") ADD_TEST(test_option_flatten_updown "scripts/test_option" "good/updown.ept" "-flatten") ADD_TEST(test_option_flatten_when_merge1 "scripts/test_option" "good/when_merge1.ept" "-flatten") +ADD_TEST(test_option_flatten_xor "scripts/test_option" "good/xor.ept" "-flatten") ADD_TEST(test_option_itfusion_ais "scripts/test_option" "good/ais.ept" "-itfusion") ADD_TEST(test_option_itfusion_alloc "scripts/test_option" "good/alloc.ept" "-itfusion") ADD_TEST(test_option_itfusion_array1 "scripts/test_option" "good/array1.ept" "-itfusion") @@ -640,6 +646,7 @@ ADD_TEST(test_option_itfusion_tuple_args "scripts/test_option" "good/tuple_args. ADD_TEST(test_option_itfusion_type_alias "scripts/test_option" "good/type_alias.ept" "-itfusion") ADD_TEST(test_option_itfusion_updown "scripts/test_option" "good/updown.ept" "-itfusion") ADD_TEST(test_option_itfusion_when_merge1 "scripts/test_option" "good/when_merge1.ept" "-itfusion") +ADD_TEST(test_option_itfusion_xor "scripts/test_option" "good/xor.ept" "-itfusion") ADD_TEST(test_option_memalloc_ais "scripts/test_option" "good/ais.ept" "-memalloc") ADD_TEST(test_option_memalloc_alloc "scripts/test_option" "good/alloc.ept" "-memalloc") ADD_TEST(test_option_memalloc_array1 "scripts/test_option" "good/array1.ept" "-memalloc") @@ -727,6 +734,7 @@ ADD_TEST(test_option_memalloc_tuple_args "scripts/test_option" "good/tuple_args. ADD_TEST(test_option_memalloc_type_alias "scripts/test_option" "good/type_alias.ept" "-memalloc") ADD_TEST(test_option_memalloc_updown "scripts/test_option" "good/updown.ept" "-memalloc") ADD_TEST(test_option_memalloc_when_merge1 "scripts/test_option" "good/when_merge1.ept" "-memalloc") +ADD_TEST(test_option_memalloc_xor "scripts/test_option" "good/xor.ept" "-memalloc") ADD_TEST(test_option_unroll_ais "scripts/test_option" "good/ais.ept" "-unroll") ADD_TEST(test_option_unroll_alloc "scripts/test_option" "good/alloc.ept" "-unroll") ADD_TEST(test_option_unroll_array1 "scripts/test_option" "good/array1.ept" "-unroll") @@ -814,6 +822,7 @@ ADD_TEST(test_option_unroll_tuple_args "scripts/test_option" "good/tuple_args.ep ADD_TEST(test_option_unroll_type_alias "scripts/test_option" "good/type_alias.ept" "-unroll") ADD_TEST(test_option_unroll_updown "scripts/test_option" "good/updown.ept" "-unroll") ADD_TEST(test_option_unroll_when_merge1 "scripts/test_option" "good/when_merge1.ept" "-unroll") +ADD_TEST(test_option_unroll_xor "scripts/test_option" "good/xor.ept" "-unroll") ADD_TEST(test_option_O_ais "scripts/test_option" "good/ais.ept" "-O") ADD_TEST(test_option_O_alloc "scripts/test_option" "good/alloc.ept" "-O") ADD_TEST(test_option_O_array1 "scripts/test_option" "good/array1.ept" "-O") @@ -901,6 +910,7 @@ ADD_TEST(test_option_O_tuple_args "scripts/test_option" "good/tuple_args.ept" "- ADD_TEST(test_option_O_type_alias "scripts/test_option" "good/type_alias.ept" "-O") ADD_TEST(test_option_O_updown "scripts/test_option" "good/updown.ept" "-O") ADD_TEST(test_option_O_when_merge1 "scripts/test_option" "good/when_merge1.ept" "-O") +ADD_TEST(test_option_O_xor "scripts/test_option" "good/xor.ept" "-O") ADD_TEST(compile_javac_run_ais "scripts/compile_javac_run" "good/ais.ept") ADD_TEST(compile_javac_run_alloc "scripts/compile_javac_run" "good/alloc.ept") ADD_TEST(compile_javac_run_array1 "scripts/compile_javac_run" "good/array1.ept") @@ -988,6 +998,7 @@ ADD_TEST(compile_javac_run_tuple_args "scripts/compile_javac_run" "good/tuple_ar ADD_TEST(compile_javac_run_type_alias "scripts/compile_javac_run" "good/type_alias.ept") ADD_TEST(compile_javac_run_updown "scripts/compile_javac_run" "good/updown.ept") ADD_TEST(compile_javac_run_when_merge1 "scripts/compile_javac_run" "good/when_merge1.ept") +ADD_TEST(compile_javac_run_xor "scripts/compile_javac_run" "good/xor.ept") ADD_TEST(compile_sdc_run_alloc "scripts/compile_sdc_run" "sdc/alloc.ept") ADD_TEST(compile_sdc_run_contrenum "scripts/compile_sdc_run" "sdc/contrenum.ept") ADD_TEST(compile_sdc_run_lnum_simple "scripts/compile_sdc_run" "sdc/lnum_simple.ept") diff --git a/test/good/xor.ept b/test/good/xor.ept new file mode 100644 index 0000000..821211c --- /dev/null +++ b/test/good/xor.ept @@ -0,0 +1,14 @@ +node f_xor(a,b:bool) = (c:bool) +let + c = (a and not b) or (not a and b); +tel + +(* CHECK main *) +node main() returns (ok:bool) + var x, y, z : bool; +let + z = x xor y; + x = false fby false fby true; + y = false fby true fby false fby true; + ok = (z = f_xor(x,y)); +tel