summaryrefslogtreecommitdiffstats
path: root/misc/cgo/testshared/testdata/division/division.go
diff options
context:
space:
mode:
Diffstat (limited to 'misc/cgo/testshared/testdata/division/division.go')
-rw-r--r--misc/cgo/testshared/testdata/division/division.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/misc/cgo/testshared/testdata/division/division.go b/misc/cgo/testshared/testdata/division/division.go
new file mode 100644
index 0000000..bb5fc98
--- /dev/null
+++ b/misc/cgo/testshared/testdata/division/division.go
@@ -0,0 +1,17 @@
+// Copyright 2017 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 main
+
+//go:noinline
+func div(x, y uint32) uint32 {
+ return x / y
+}
+
+func main() {
+ a := div(97, 11)
+ if a != 8 {
+ panic("FAIL")
+ }
+}