1// Copyright 2018 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//go:build darwin
6
7package issue24161e2
8
9/*
10#cgo CFLAGS: -x objective-c
11#cgo LDFLAGS: -framework CoreFoundation -framework Security
12#include <TargetConditionals.h>
13#include <CoreFoundation/CoreFoundation.h>
14#include <Security/Security.h>
15#if TARGET_OS_IPHONE == 0 && __MAC_OS_X_VERSION_MAX_ALLOWED < 101200
16  typedef CFStringRef SecKeyAlgorithm;
17  static CFDataRef SecKeyCreateSignature(SecKeyRef key, SecKeyAlgorithm algorithm, CFDataRef dataToSign, CFErrorRef *error){return NULL;}
18  #define kSecKeyAlgorithmECDSASignatureDigestX962SHA1 foo()
19  static SecKeyAlgorithm foo(void){return NULL;}
20#endif
21*/
22import "C"
23import (
24	"fmt"
25	"testing"
26)
27
28var _ C.CFStringRef
29
30func f1() {
31	C.SecKeyCreateSignature(0, C.kSecKeyAlgorithmECDSASignatureDigestX962SHA1, 0, nil)
32}
33
34func f2(e C.CFErrorRef) {
35	if desc := C.CFErrorCopyDescription(e); desc != 0 {
36		fmt.Println(desc)
37	}
38}
39
40func Test(t *testing.T) {}
41