]> Cypherpunks.ru repositories - gostls13.git/blobdiff - test/nilptr3.go
cmd/compile/internal/inline: score call sites exposed by inlines
[gostls13.git] / test / nilptr3.go
index 3345cfa5ab38a477a147637b59e7a557e5764bb7..2cc510beb635df01ae75e92ee06d51212e1ef34d 100644 (file)
@@ -1,7 +1,6 @@
 // errorcheck -0 -d=nil
 
-// +build !wasm
-// +build !aix
+//go:build !wasm && !aix
 
 // Copyright 2013 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
@@ -241,3 +240,17 @@ func f9() []int {
        y := x[:] // ERROR "removed nil check"
        return y
 }
+
+// See issue 42673.
+func f10(p **int) int {
+       return * // ERROR "removed nil check"
+       /* */
+       *p // ERROR "removed nil check"
+}
+
+func f11(x []byte) {
+       p := (*[0]byte)(x)
+       _ = *p // ERROR "generated nil check"
+       q := (*[4]byte)(x)
+       _ = *q // ERROR "removed nil check"
+}