Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
ad7dea1e
Commit
ad7dea1e
authored
Sep 19, 2011
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gc: handle complex CONVNOP
Fixes #2256. R=ken2 CC=golang-dev
https://golang.org/cl/5044047
parent
f554c90c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
0 deletions
+15
-0
cplx.c
src/cmd/gc/cplx.c
+3
-0
cplx2.go
test/ken/cplx2.go
+12
-0
No files found.
src/cmd/gc/cplx.c
View file @
ad7dea1e
...
...
@@ -133,6 +133,9 @@ complexgen(Node *n, Node *res)
dump
(
"
\n
complexgen-n"
,
n
);
dump
(
"complexgen-res"
,
res
);
}
while
(
n
->
op
==
OCONVNOP
)
n
=
n
->
left
;
// pick off float/complex opcodes
switch
(
n
->
op
)
{
...
...
test/ken/cplx2.go
View file @
ad7dea1e
...
...
@@ -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"
)
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment