blob: a14efc9a689410ccfe66ac2c94ee120524640215 [file] [log] [blame]
Dan Willemsenbc60c3c2021-12-15 01:09:00 -08001// run fake-arg-to-force-use-of-go-run
2
3// Copyright 2021 The Go Authors. All rights reserved.
4// Use of this source code is governed by a BSD-style
5// license that can be found in the LICENSE file.
6
7//go:build cgo
8// +build cgo
9
10package main
11
12// void f(int *p) { *p = 0x12345678; }
13import "C"
14
15func main() {
16 var x C.int
17 func() {
18 defer C.f(&x)
19 }()
20 if x != 0x12345678 {
21 panic("FAIL")
22 }
23}