Source file src/cmd/cgo/internal/testcshared/testdata/go2c2go/m1/main.go

     1  // Copyright 2018 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  // extern int CFunc(void);
     8  import "C"
     9  
    10  import (
    11  	"fmt"
    12  	"os"
    13  )
    14  
    15  func main() {
    16  	got := C.CFunc()
    17  	const want = (1 << 8) | 2
    18  	if got != want {
    19  		fmt.Printf("got %#x, want %#x\n", got, want)
    20  		os.Exit(1)
    21  	}
    22  }
    23  

View as plain text