Mercurial > hg > CbC > CbC_gcc
comparison libgo/misc/cgo/test/issue9510a/a.go @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
68:561a7518be6b | 111:04ced10e8804 |
---|---|
1 package issue9510a | |
2 | |
3 /* | |
4 static double csquare(double a, double b) { | |
5 __complex__ double d; | |
6 __real__ d = a; | |
7 __imag__ d = b; | |
8 return __real__ (d * d); | |
9 } | |
10 */ | |
11 import "C" | |
12 | |
13 func F(a, b float64) float64 { | |
14 return float64(C.csquare(C.double(a), C.double(b))) | |
15 } |