Commit ad7dea1e authored by Russ Cox's avatar Russ Cox

gc: handle complex CONVNOP

Fixes #2256.

R=ken2
CC=golang-dev
https://golang.org/cl/5044047
parent f554c90c
......@@ -133,6 +133,9 @@ complexgen(Node *n, Node *res)
dump("\ncomplexgen-n", n);
dump("complexgen-res", res);
}
while(n->op == OCONVNOP)
n = n->left;
// pick off float/complex opcodes
switch(n->op) {
......
......@@ -105,4 +105,16 @@ func main() {
println("opcode x", ce, Ce)
panic("fail")
}
r32 := real(complex64(ce))
if r32 != float32(real(Ce)) {
println("real(complex64(ce))", r32, real(Ce))
panic("fail")
}
r64 := real(complex128(ce))
if r64 != real(Ce) {
println("real(complex128(ce))", r64, real(Ce))
panic("fail")
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment