blob: c75ce10c5951f9dce03efaaeaed78f3df42f780a [file] [log] [blame]
Josh Bleecher Snyder30812612014-02-26 12:25:13 -08001// build
2
Emmanuel Odeke53fd5222016-04-10 14:32:26 -07003// Copyright 2014 The Go Authors. All rights reserved.
Josh Bleecher Snyder30812612014-02-26 12:25:13 -08004// Use of this source code is governed by a BSD-style
5// license that can be found in the LICENSE file.
6
7// Test that the compiler does not crash during compilation.
8
9package main
10
11import "unsafe"
12
13// Issue 7413
14func f1() {
15 type t struct {
16 i int
17 }
18
19 var v *t
20 _ = int(uintptr(unsafe.Pointer(&v.i)))
21 _ = int32(uintptr(unsafe.Pointer(&v.i)))
22}
23
24func main() {}