summaryrefslogtreecommitdiff
path: root/test.lang
diff options
context:
space:
mode:
authorWormHeamer2025-08-10 04:46:09 -0400
committerWormHeamer2025-08-10 04:46:09 -0400
commitc9980711ce42de9cf58db35f41ce1ac42bfea0c7 (patch)
treecaa99c741b012f5fc683f131c6c2281fec4e2f61 /test.lang
parentd4c768a481b923d407201c25d3d750040b6ccd44 (diff)
fix peephole bug (communative(phi(a,b), phi(a,b)) =/= communative(a,b))
Diffstat (limited to 'test.lang')
-rw-r--r--test.lang6
1 files changed, 4 insertions, 2 deletions
diff --git a/test.lang b/test.lang
index 2de85c1..d461439 100644
--- a/test.lang
+++ b/test.lang
@@ -1,9 +1,11 @@
func main(a, b i64) i64 {
let x i64, y bool
- if a = b {
+ if a < b {
let t = a
a := b
b := t
+ } else {
+ x := 2
}
- return a
+ return (a + b) + x
}