From 5529a7006ae22df4ea69e06121bd0111fa52e45c Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Sat, 18 Aug 2018 12:23:41 -0400 Subject: opt: Re-run optimizations after reordering expressions This catches new data flow inferences that can be made after swapping the children of an expression. --- tests.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'tests.sh') diff --git a/tests.sh b/tests.sh index 8532d10..1ad1568 100755 --- a/tests.sh +++ b/tests.sh @@ -227,11 +227,14 @@ posix_tests=( test_a test_o test_deep + test_or_purity test_double_negation test_de_morgan_not test_de_morgan_and test_de_morgan_or test_data_flow_type + test_data_flow_and_swap + test_data_flow_or_swap ) bsd_tests=( @@ -410,7 +413,6 @@ gnu_tests=( test_comma test_precedence test_and_purity - test_or_purity test_not_reachability test_comma_reachability test_print_error @@ -1589,6 +1591,14 @@ function test_data_flow_type() { bfs_diff basic \! \( -type f -o \! -type f \) } +function test_data_flow_and_swap() { + bfs_diff basic \! -type f -a -type d +} + +function test_data_flow_or_swap() { + bfs_diff basic \! \( -type f -o -not -type d \) +} + function test_print_error() { if [ -e /dev/full ]; then ! invoke_bfs basic -maxdepth 0 >/dev/full 2>/dev/null -- cgit v1.2.3