Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(79)

Unified Diff: misc/cgo/test/issue5986.go

Issue 13261055: code review 13261055: cmd/go: fix missing __mingw_fprintf symbol for cgo on w... (Closed)
Patch Set: diff -r e3fb358fb3c6 https://code.google.com/p/go Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « misc/cgo/test/cgo_test.go ('k') | src/cmd/go/build.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: misc/cgo/test/issue5986.go
===================================================================
new file mode 100644
--- /dev/null
+++ b/misc/cgo/test/issue5986.go
@@ -0,0 +1,32 @@
+// Copyright 2013 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 cgotest
+
+/*
+#cgo LDFLAGS: -lm
+#include <stdio.h>
+#include <math.h>
+
+static void output5986()
+{
+ int current_row = 0, row_count = 0;
+ double sum_squares = 0;
+ do {
+ if (current_row == 10) {
+ current_row = 0;
+ }
+ ++row_count;
+ }
+ while (current_row++ != 1);
+ double d = sqrt(sum_squares / row_count);
+ printf("sqrt is: %g\n", d);
+}
+*/
+import "C"
+import "testing"
+
+func test5986(t *testing.T) {
+ C.output5986()
+}
« no previous file with comments | « misc/cgo/test/cgo_test.go ('k') | src/cmd/go/build.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b