Emmanuel Odeke | 53fd522 | 2016-04-10 14:32:26 -0700 | [diff] [blame] | 1 | // Copyright 2013 The Go Authors. All rights reserved. |
Russ Cox | e5c1050 | 2014-05-09 16:03:44 -0400 | [diff] [blame] | 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 cgotest |
| 6 | |
| 7 | import ( |
| 8 | "testing" |
| 9 | "unsafe" |
| 10 | ) |
| 11 | |
| 12 | // extern void f7665(void); |
| 13 | import "C" |
| 14 | |
| 15 | //export f7665 |
| 16 | func f7665() {} |
| 17 | |
| 18 | var bad7665 unsafe.Pointer = C.f7665 |
| 19 | var good7665 uintptr = uintptr(C.f7665) |
| 20 | |
| 21 | func test7665(t *testing.T) { |
Ian Lance Taylor | 6e5ccce8 | 2015-10-13 10:05:13 -0700 | [diff] [blame] | 22 | if bad7665 == nil || uintptr(bad7665) != good7665 { |
Russ Cox | e5c1050 | 2014-05-09 16:03:44 -0400 | [diff] [blame] | 23 | t.Errorf("ptrs = %p, %#x, want same non-nil pointer", bad7665, good7665) |
| 24 | } |
| 25 | } |