mirror of
https://github.com/golang/go
synced 2024-11-22 06:54:39 -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
@ -134,6 +134,9 @@ complexgen(Node *n, Node *res)
|
|||||||
dump("complexgen-res", res);
|
dump("complexgen-res", res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
while(n->op == OCONVNOP)
|
||||||
|
n = n->left;
|
||||||
|
|
||||||
// pick off float/complex opcodes
|
// pick off float/complex opcodes
|
||||||
switch(n->op) {
|
switch(n->op) {
|
||||||
case OCOMPLEX:
|
case OCOMPLEX:
|
||||||
|
@ -105,4 +105,16 @@ func main() {
|
|||||||
println("opcode x", ce, Ce)
|
println("opcode x", ce, Ce)
|
||||||
panic("fail")
|
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