]> Cypherpunks.ru repositories - gostls13.git/blob - misc/cgo/fortran/testdata/testprog/fortran.go
misc/cgo/fortran: convert to Go test
[gostls13.git] / misc / cgo / fortran / testdata / testprog / fortran.go
1 // Copyright 2016 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 package main
6
7 // int the_answer();
8 import "C"
9 import "os"
10
11 func TheAnswer() int {
12         return int(C.the_answer())
13 }
14
15 func main() {
16         if a := TheAnswer(); a != 42 {
17                 println("Unexpected result for The Answer. Got:", a, " Want: 42")
18                 os.Exit(1)
19         }
20         println("ok")
21 }