Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/link: new test case for Darwin/DWARF
Test case for issue 32233. Updates #32233. Change-Id: I0e3b4a46832f39de4ef36d8fd8c6070bf9b1a019 Reviewed-on: https://go-review.googlesource.com/c/go/+/178726 Reviewed-by: Cherry Zhang <cherryyz@google.com> Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
- Loading branch information
Showing
4 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Copyright 2019 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. | ||
|
||
#import <Foundation/Foundation.h> | ||
#import <UserNotifications/UserNotifications.h> | ||
|
||
BOOL function(void) { | ||
if (@available(macOS 10.14, *)) { | ||
UNUserNotificationCenter *center = | ||
[UNUserNotificationCenter currentNotificationCenter]; | ||
} | ||
return NO; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Copyright 2019 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 lib | ||
|
||
/* | ||
#cgo darwin CFLAGS: -mmacosx-version-min=10.10 -D__MAC_OS_X_VERSION_MAX_ALLOWED=101450 -Wunguarded-availability-new | ||
#cgo darwin LDFLAGS: -framework Foundation -framework UserNotifications | ||
#include "stdlib.h" | ||
int function(void); | ||
*/ | ||
import "C" | ||
import "fmt" | ||
|
||
func DoC() { | ||
C.function() | ||
fmt.Println("called c function") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// Copyright 2019 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 | ||
|
||
import "cmd/link/internal/ld/testdata/issue32233/lib" | ||
|
||
func main() { | ||
lib.DoC() | ||
} |