1 // Copyright 2016 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
5 // Test that C.malloc does not return nil.
21 // The Dragonfly libc succeeds when asked to allocate
22 // 0xffffffffffffffff bytes, so pass a different value that
24 if runtime.GOOS == "dragonfly" {
25 size = C.size_t(0x7fffffff << (32 * (^uintptr(0) >> 63)))
30 fmt.Println("malloc: C.malloc returned nil")
31 // Just exit normally--the test script expects this
32 // program to crash, so exiting normally indicates failure.