Mercurial > hg > CbC > CbC_gcc
annotate libgo/misc/cgo/test/issue6390.go @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children |
rev | line source |
---|---|
111 | 1 // Copyright 2013 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. | |
4 | |
5 package cgotest | |
6 | |
7 // #include <stdlib.h> | |
8 import "C" | |
9 | |
10 import "testing" | |
11 | |
12 func test6390(t *testing.T) { | |
13 p1 := C.malloc(1024) | |
14 if p1 == nil { | |
15 t.Fatalf("C.malloc(1024) returned nil") | |
16 } | |
17 p2 := C.malloc(0) | |
18 if p2 == nil { | |
19 t.Fatalf("C.malloc(0) returned nil") | |
20 } | |
21 C.free(p1) | |
22 C.free(p2) | |
23 } |