-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Note: The original plan was to have this fully replace the optimizer's boolean folding. However, it turns out that that doesn't quite work because it would mess up the optimizer's tracking of feature usage. For now, we special-case the feature constants in the folder and don't touch them.
- Loading branch information
Showing
5 changed files
with
101 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. | ||
module Test { | ||
|
||
const bool b1 = True; | ||
const bool b2 = False; | ||
|
||
assert True; | ||
assert True; | ||
assert True; | ||
assert True; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# @TEST-EXEC: hiltic -p %INPUT >>output | ||
# @TEST-EXEC: hiltic -j %INPUT >>output | ||
# @TEST-EXEC: btest-diff output | ||
# | ||
# @TEST-DOC: Test boolean constant folding. | ||
|
||
module Test { | ||
|
||
const b1 = (True || False); | ||
const b2 = (True && False); | ||
|
||
assert True && True; | ||
assert (True && (False || (!False))); | ||
assert b1 || b2; | ||
assert !(b1 && b2); | ||
|
||
} |