summaryrefslogtreecommitdiffstats
path: root/src/runtime/testdata/testprog/unsafe.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/testdata/testprog/unsafe.go')
-rw-r--r--src/runtime/testdata/testprog/unsafe.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/runtime/testdata/testprog/unsafe.go b/src/runtime/testdata/testprog/unsafe.go
new file mode 100644
index 0000000..021b08f
--- /dev/null
+++ b/src/runtime/testdata/testprog/unsafe.go
@@ -0,0 +1,12 @@
+package main
+
+import "unsafe"
+
+func init() {
+ register("panicOnNilAndEleSizeIsZero", panicOnNilAndEleSizeIsZero)
+}
+
+func panicOnNilAndEleSizeIsZero() {
+ var p *struct{}
+ _ = unsafe.Slice(p, 5)
+}