From f6ad4dcef54c5ce997a4bad5a6d86de229015700 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Tue, 16 Apr 2024 21:25:22 +0200 Subject: Adding upstream version 1.22.1. Signed-off-by: Daniel Baumann --- src/cmd/cgo/internal/test/issue9510a/a.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/cmd/cgo/internal/test/issue9510a/a.go (limited to 'src/cmd/cgo/internal/test/issue9510a/a.go') diff --git a/src/cmd/cgo/internal/test/issue9510a/a.go b/src/cmd/cgo/internal/test/issue9510a/a.go new file mode 100644 index 0000000..f0a0128 --- /dev/null +++ b/src/cmd/cgo/internal/test/issue9510a/a.go @@ -0,0 +1,19 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package issue9510a + +/* +static double csquare(double a, double b) { + __complex__ double d; + __real__ d = a; + __imag__ d = b; + return __real__ (d * d); +} +*/ +import "C" + +func F(a, b float64) float64 { + return float64(C.csquare(C.double(a), C.double(b))) +} -- cgit v1.2.3