mirror of
https://github.com/golang/go
synced 2024-11-11 19:51:37 -07:00
gc: handle complex CONVNOP
Fixes #2256. R=ken2 CC=golang-dev https://golang.org/cl/5044047
This commit is contained in:
parent
f554c90cef
commit
ad7dea1e96
@ -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")
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user