1
0
mirror of https://github.com/golang/go synced 2024-11-17 14:14:56 -07:00
go/test/unsafereject2.go
Yury Smolsky 1484270aec test: restore tests for the reject unsafe code option
Tests in test/safe were neglected after moving to the run.go
framework. This change restores them.

These tests are skipped for go/types via -+ option.

Fixes #25668

Change-Id: I8fe26574a76fa7afa8664c467d7c2e6334f1bba9
Reviewed-on: https://go-review.googlesource.com/124660
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-08-22 17:54:09 +00:00

16 lines
394 B
Go

// errorcheck -u -+
// Copyright 2018 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Check that we cannot import the "unsafe" package when -u is supplied.
package a
import "unsafe" // ERROR "import package unsafe"
func Float32bits(f float32) uint32 {
return *(*uint32)(unsafe.Pointer(&f))
}