// Code generated by cmd/cgo; DO NOT EDIT.

//line /home/evie/packages/go/go-1.18-0/go/misc/cgo/errors/testdata/err2.go:1:1
// Copyright 2013 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.

package main

/*
#include <stdio.h>

typedef struct foo foo_t;
typedef struct bar bar_t;

foo_t *foop;

long double x = 0;

static int transform(int x) { return x; }

typedef void v;
void F(v** p) {}

void fvi(void *p, int x) {}

void fppi(int** p) {}

int i;
void fi(int i) {}
*/
import _ "unsafe"
import (
	"unsafe"
)

func main() {
	s := ""
	_ = s
	( /*line :37:2*/_Cfunc__CMalloc /*line :37:9*/)(s) // ERROR HERE

	x := (* /*line :39:9*/_Ctype_bar_t /*line :39:16*/)(nil)
	( /*line :40:2*/*_Cvar_foop /*line :40:7*/) = x // ERROR HERE

	// issue 13129: used to output error about C.unsignedshort with CC=clang
	var x1  /*line :43:9*/_Ctype_ushort /*line :43:17*/
	x1 = int(0) // ERROR HERE: C\.ushort

	// issue 13423
	_ = ( /*line :47:6*/_Cfunc_fopen /*line :47:12*/)() // ERROR HERE

	// issue 13467
	var x2 rune = '✈'
	var _ rune = ( /*line :51:15*/_Cfunc_transform /*line :51:25*/)(x2) // ERROR HERE: C\.int

	// issue 13635: used to output error about C.unsignedchar.
	// This test tests all such types.
	var (
		_  /*line :56:5*/_Ctype_uchar /*line :56:12*/         = "uc"  // ERROR HERE: C\.uchar
		_  /*line :57:5*/_Ctype_schar /*line :57:12*/         = "sc"  // ERROR HERE: C\.schar
		_  /*line :58:5*/_Ctype_ushort /*line :58:13*/        = "us"  // ERROR HERE: C\.ushort
		_  /*line :59:5*/_Ctype_uint /*line :59:11*/          = "ui"  // ERROR HERE: C\.uint
		_  /*line :60:5*/_Ctype_ulong /*line :60:12*/         = "ul"  // ERROR HERE: C\.ulong
		_  /*line :61:5*/_Ctype_longlong /*line :61:15*/      = "ll"  // ERROR HERE: C\.longlong
		_  /*line :62:5*/_Ctype_ulonglong /*line :62:16*/     = "ull" // ERROR HERE: C\.ulonglong
		_  /*line :63:5*/_Ctype_complexfloat /*line :63:19*/  = "cf"  // ERROR HERE: C\.complexfloat
		_  /*line :64:5*/_Ctype_complexdouble /*line :64:20*/ = "cd"  // ERROR HERE: C\.complexdouble
	)

	// issue 13830
	// cgo converts C void* to Go unsafe.Pointer, so despite appearances C
	// void** is Go *unsafe.Pointer. This test verifies that we detect the
	// problem at build time.
	{
		type v [0]byte

		f := func(p **v) {
			func() { _cgo0 := /*line :75:8*/(**_Ctype_v /*line :75:14*/)(unsafe.Pointer(p)); _cgoCheckPointer(_cgo0, nil); _Cfunc_F(_cgo0); }() // ERROR HERE
		}
		var p *v
		f(&p)
	}

	// issue 16116
	_ = ( /*line :82:6*/_Cfunc_fvi /*line :82:10*/)(1) // ERROR HERE

	// Issue 16591: Test that we detect an invalid call that was being
	// hidden by a type conversion inserted by cgo checking.
	{
		type x * /*line :87:11*/_Ctype_int /*line :87:16*/
		var p *x
		func() { _cgo0 := /*line :89:10*/p; _cgoCheckPointer(_cgo0, nil); _Cfunc_fppi(_cgo0); }() // ERROR HERE
	}

	// issue 26745
	_ = func(i int) int {
		// typecheck reports at column 14 ('+'), but types2 reports at
		// column 10 ('C').
		// TODO(mdempsky): Investigate why, and see if types2 can be
		// updated to match typecheck behavior.
		return ( /*line :98:10*/*_Cvar_i /*line :98:12*/) + 1 // ERROR HERE: \b(10|14)\b
	}
	_ = func(i int) {
		// typecheck reports at column 7 ('('), but types2 reports at
		// column 8 ('i'). The types2 position is more correct, but
		// updating typecheck here is fundamentally challenging because of
		// IR limitations.
		( /*line :105:3*/_Cfunc_fi /*line :105:6*/)(i) // ERROR HERE: \b(7|8)\b
	}

	( /*line :108:2*/_Cgo_ptr(_Cfpvar_fp_fi) /*line :108:5*/) = ( /*line :108:9*/_Cgo_ptr(_Cfpvar_fp_fi) /*line :108:12*/) // ERROR HERE

}
