summaryrefslogtreecommitdiff
path: root/chapter05/src/test/java/com
Commit message (Collapse)AuthorAgeFilesLines
* Move debug printing into shared spaceCliff Click2026-10-011-1/+1
| | | | Same as the graph viewer, moves a lot of code out of all Nodes
* Add same constant phi merge testfuhsnn2026-09-291-0/+15
|
* minor fixesCliff Click2026-09-271-9/+0
| | | | | Fix CI build Backport ch 23 fix to ch 22.
* Remove excessive spaces in test code (#256)Hsiang-Ying Fu2026-09-273-13/+20
| | | Co-authored-by: Cliff Click <cliffc@acm.org>
* Remove -disablePeepholeCliff Click2026-09-272-12/+1
|
* Extend and backport SubNode peephole (#254)Hsiang-Ying Fu2026-09-251-0/+28
| | | | | | | | | | | | | | | * Extend and backport SubNode peephole * Add tests * Restrict subtraction zero peepholes to integer operands Require resolved integer mode in chapter 25 so zero subtraction preserves floating-point signed zero. Keep nonnumeric operands in the graph for subtraction diagnostics. Add signed-zero coverage from chapter 12 and null-subtraction diagnostics from chapter 22. Confirmed the regressions fail on the original PR. Full Make suites pass in chapters 4-25 (5462 tests), including fresh chapter 25 sys.o compilation. --------- Co-authored-by: Cliff Click <cliffc@acm.org>
* Add shared graph viewer to all chaptersCliff Click2026-09-224-26/+22
|
* Add testRedeclareVar in all later chapterstannal2025-01-191-0/+10
|
* Start to fix maven failsCliff Click2025-01-151-1/+1
|
* Test for "arg--2"Cliff Click2025-01-151-0/+6
| | | | Parse as "arg - -2" and not "arg-- 2" which is a syntax error
* Backport tests (#87)Thalia Archibald2024-06-215-325/+387
| | | | | | | | | | | | | | | | | * Fix unexpected number parse errors * Add chapter titles * Split test files by chapter * Backport rename Fuzzer08Test to FuzzerWrap * Replace graph build scripts with Makefile * Backport Chapter05Test.testRegress1 * Backport require space after 'return' * Backport check EOF after return statement
* Format whitespace (#86)Thalia Archibald2024-06-211-28/+28
| | | | | | | | | * Trim trailing whitespace * Ensure final new lines * Convert line endings from CRLF to LF * Replace tabs with spaces
* Backport some of the code refactoring to previous chapters (#50)Dibyendu Majumdar2023-12-071-10/+18
| | | | | | | | | | | * #44 Revise docs and comments * #44 Add starting scope to xScopes * #44 back some of the code refactoring port to previous chapters * #44 add_def should not be public * #44 add_def should not be public. Rename method names so that they are camelcase
* Backport changes in Chapter 5 to previous chapters and update Chapter5 ↵Dibyendu Majumdar2023-11-031-11/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | documentation (#34) * Backport changes from chapter 5 to older chapters (#30) * Fix wrong indent * Backport to chapter 4 * Backport to chapter 3 * Backport to chapter 2 * Backport to chapter 1 * Add if statement to comment (#32) * Update visuals for chapters 1,2 & 3. Reenable drawing of edges from constants to Start for these chapters. * Update visuals for chapters 4. Revise text to explain the labeling of edges in graphs and that we omit edge from Constant to Start nodes from chapter 4. * Add code snippets for if statement parsing and the duplication and merging of ScopeNodes. Explain how scopeNodes are duplicated and merged. * Add constant check to minus node (#31) * Fix closing root block with } (#33) * Backport fix closing root block with } to chapter 4 and 3 (#35) * Show use-def edge from Phi to Region as dotted edge. Add example of Phi peephole. Update visuals. Add more examples. * Fix visuals in chapter 1 and README in chapter 4. * Remove subheading * Adjust spaces --------- Co-authored-by: XmiliaH <45106915+XmiliaH@users.noreply.github.com>
* Bail out unclosed block (#25)Yichen Yan2023-11-011-0/+10
| | | | | | | | | * Report unclosed block in parsing * Fix tests * Resolve comments and rebase onto chapter5 * Test `isEOF` after consume whitespaces
* Test expecting an excpetion is missing an fail (#29)XmiliaH2023-11-011-0/+1
|
* Revert "Report unclosed block in parsing (#28)"dibyendumajumdar2023-11-011-10/+0
| | | | This reverts commit e3c412bbbdd6f6eefe2ac889f6d59aeaef71beb1.
* Report unclosed block in parsing (#28)XmiliaH2023-11-011-0/+10
|
* Fix list of keywords and node index of merge (#27)XmiliaH2023-11-011-1/+1
| | | | | | | * Wrong input index used * Then is currently not a keyword * Some phis are now not created and ids shifted
* Add copy method to bool nodes (#23)XmiliaH2023-11-011-0/+7
|
* Update visualdibyendumajumdar2023-11-011-0/+1
|
* Cleanup doc example graphCliff Click2023-11-011-2/+1
|
* Lots of improvements to graphvizCliff Click2023-11-011-4/+4
| | | | | | | | Merging common edges. Phis of same Region align. Phis use greek phi, and have a debug name. Scope carries the debug name. Phis are lightly colored. Common math names for math prims. Parse can optionally show the graph after closing the last scope.
* Bug fix last peepholeCliff Click2023-11-011-1/+8
|
* Rethink & cleanup Add peepsCliff Click2023-11-011-2/+2
| | | | More rigorously head for a left-spline sum-of-products format.
* Fix div-by-0, some javadocCliff Click2023-11-011-7/+8
| | | | | higher level parsers can return null, but their return is ignored anycase. div-by-0 is defined to be 0, backported to ch2,3,4,5
* Fix missing trailing expressionCliff Click2023-11-011-0/+10
|
* Fix broken error reportCliff Click2023-11-011-1/+10
|
* Fix bugs using keywords as idsCliff Click2023-11-011-1/+30
| | | | | | | | Add an exact 'matchx' for keywords. Add a list of keywords. int true=0; return true; // Expected id, found 'true' int else=arg; if(else) else=2; else else=1; return else; // Expected id, found 'else' inta=1; return a; // undefined inta
* Update READMECliff Click2023-11-011-1/+14
| | | | Add true/false
* Parser gather Returns in the StopCliff Click2023-11-011-43/+52
| | | | | | Return returns a tuple of control & result GraphViz works with multi-Scopes and Scopes do not double-print uid. Proj also does not print uid in golden test results, because every time we add a new early node, the final results change node id so fail golden test.
* Fix Scope.dup mixing up edge ordersCliff Click2023-11-011-1/+16
| | | | Fix GraphVix node edge ordering
* Greatly simplify Merge logic; move to ScopeNode.Cliff Click2023-11-011-47/+88
| | | | | | | | | Rename CTRL_TOKEN... its not a token. _allScopes becomes a Stack, because... it behaves like a stack. Add a junk Phi peep. More general AddNode peeps Add a bunch of If tests. Rewrite how expected-exception tests work; the workflow on the old technique sucked. New one stops in the right place in the debugger.
* Update visualization to show all the Scope Nodes that are active.dibyendumajumdar2023-11-011-9/+20
| | | | | | Fix test cases broken due to renaming of ProjNode label. Cleanup the way we update $ctrl token Assign an ID to each ScopeNode so that when we visualize we can assign different names
* Some initial Ch 5 cleanupCliff Click2023-11-011-1/+1
| | | | | | Drop Control interface, not flexible enough. Use isCFG() call, overloaded in child classes. Projections have a more complex test. Missing some printouts in Bool children, If, Region, Phi. IfNode type is a tuple. Region is TypeControl.
* Added PhiNode, RegionNode, IfNode, StopNodedibyendumajumdar2023-11-011-0/+7
| | | | | No type compute yet Initial parsing logic for If statements
* Rename test class and dot diagramsdibyendumajumdar2023-11-011-1/+1
|
* Start on Chapter 5dibyendumajumdar2023-11-011-0/+273