summaryrefslogtreecommitdiff
path: root/test/ken
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2010-06-23 10:55:50 -0400
committerRuss Cox <rsc@golang.org>2010-06-23 10:55:50 -0400
commit0194805879f5f7e70f9aac1256206004944643fd (patch)
tree07bdfb6239e74233cf56001236761e0f13398a1f /test/ken
parent6c57871c54d47f4feef7ba2eddbc460cc3e7e5ab (diff)
downloadgo-0194805879f5f7e70f9aac1256206004944643fd.tar.gz
gc: fix crash for nested complex division
R=ken2 CC=golang-dev http://codereview.appspot.com/1720043
Diffstat (limited to 'test/ken')
-rw-r--r--test/ken/cplx4.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ken/cplx4.go b/test/ken/cplx4.go
index c9ba2e9b9..d55d6a6e3 100644
--- a/test/ken/cplx4.go
+++ b/test/ken/cplx4.go
@@ -35,4 +35,10 @@ func main() {
// real, imag, cmplx
c3 := cmplx(real(c2)+3, imag(c2)-5) + c2
fmt.Printf("c = %G\n", c3)
+
+ // compiler used to crash on nested divide
+ c4 := cmplx(real(c3/2), imag(c3/2))
+ if c4 != c3/2 {
+ fmt.Printf("c3 = %G != c4 = %G\n", c3, c4)
+ }
}