Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests/switch-btree1.lst: New test. #19

Closed
wants to merge 1 commit into from

Conversation

maximumspatium
Copy link
Contributor

Looks simple enough to be grokkable by a human. Please submit as a PR.

Here it goes.

@pfalcon
Copy link
Owner

pfalcon commented Jan 6, 2018

Cool, merged with a comment that it unit-like test for a future pass.

Note that I thought this would go to tests/decomp/ first, and tried to drop it there too, but got an error:

  File "/mnt/hdd/projects/ScratchABlock/decomp.py", line 196, in match_if_else_inv_ladder_recursive
    assert len(block.branches) == 2, "Must be applied before match_if_else_ladder"
AssertionError: Must be applied before match_if_else_ladder

That's an example of mis-assumptions (and/or mis-ordering) of passes.

@pfalcon
Copy link
Owner

pfalcon commented Jan 6, 2018

So far, turned that assert into a warning in 3a10ad1

@pfalcon
Copy link
Owner

pfalcon commented Jan 7, 2018

Ok, trying it now leads to nondeterministic variations in if-else structuring:

         $a3 = 250;
       } else if ($a2_0 == 100) {
         $a3 = 100;
-      } else if ($a2_0 == 200) {
+      } else if ($a2_0 != 200) {
+      } else {
         $a3 = 200;
       }
-    } else if ($a2_0 != 500) {
-    } else {
+    } else if ($a2_0 == 500) {
       $a3 = 500;
     }
   } else if ($a2_0 == 750) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants