annotate libgo/misc/cgo/test/issue7665.go @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 // Copyright 2013 The Go Authors. All rights reserved.
kono
parents:
diff changeset
2 // Use of this source code is governed by a BSD-style
kono
parents:
diff changeset
3 // license that can be found in the LICENSE file.
kono
parents:
diff changeset
4
kono
parents:
diff changeset
5 package cgotest
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 import (
kono
parents:
diff changeset
8 "testing"
kono
parents:
diff changeset
9 "unsafe"
kono
parents:
diff changeset
10 )
kono
parents:
diff changeset
11
kono
parents:
diff changeset
12 // extern void f7665(void);
kono
parents:
diff changeset
13 import "C"
kono
parents:
diff changeset
14
kono
parents:
diff changeset
15 //export f7665
kono
parents:
diff changeset
16 func f7665() {}
kono
parents:
diff changeset
17
kono
parents:
diff changeset
18 var bad7665 unsafe.Pointer = C.f7665
kono
parents:
diff changeset
19 var good7665 uintptr = uintptr(C.f7665)
kono
parents:
diff changeset
20
kono
parents:
diff changeset
21 func test7665(t *testing.T) {
kono
parents:
diff changeset
22 if bad7665 == nil || uintptr(bad7665) != good7665 {
kono
parents:
diff changeset
23 t.Errorf("ptrs = %p, %#x, want same non-nil pointer", bad7665, good7665)
kono
parents:
diff changeset
24 }
kono
parents:
diff changeset
25 }