Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(22)

Unified Diff: test/nilptr_s390.go

Issue 174320043: code review 174320043: test: s390[x] specific variants of nilptr.go.
Patch Set: diff -r fe11c71dbee6c22c38c6f5037ff3ac43929e8eff https://code.google.com/p/go/ Created 10 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/nilptr_other.go ('k') | test/nilptr_s390_common.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/nilptr_s390.go
===================================================================
new file mode 100644
--- /dev/null
+++ b/test/nilptr_s390.go
@@ -0,0 +1,23 @@
+// +build s390
+// run nilptr.go nilptr_s390_common.go
+
+// Copyright 2014 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.
+
+// Platform specific test configuration
+
+package main
+
+// Having a big address space means that indexing at a large
+// offset from a nil pointer might not cause a memory access
+// fault. This test checks that Go is doing the correct explicit
+// checks to catch these nil pointer accesses, not just relying on
+// the hardware.
+//
+// Give us a big address space somewhere near minBssOffset.
+const inMemSize uintptr = 256 << 20 // 256 MiB
+const minBssOffset uintptr = 1 << 22 // 0x00400000
+const maxlen uintptr = (1 << 31) - 2 // 0x7ffffffe
+const inMaxlenArray uintptr = minBssOffset + inMemSize / 2
+var dummy [inMemSize]byte
« no previous file with comments | « test/nilptr_other.go ('k') | test/nilptr_s390_common.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b