aboutsummaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2020-06-11 12:01:52 -0700
committerIan Lance Taylor <iant@golang.org>2020-06-11 21:53:45 +0000
commita5a9a06d7183a6faf70b3d1231273af247503c19 (patch)
treedbfda0e9c85addb3e9b56b79cc2fc18e2185b2b8 /misc
parentf7ba82d68f90e20aa9e6aa973cb6f12321abec71 (diff)
downloadgo-a5a9a06d7183a6faf70b3d1231273af247503c19.tar.gz
go-a5a9a06d7183a6faf70b3d1231273af247503c19.zip
cmd/cgo: in -godefs mode, don't change constant to type
Fixes #39534 Change-Id: Icbc1745935dd7098c09e2d35c61cd5bfbaa31c63 Reviewed-on: https://go-review.googlesource.com/c/go/+/237558 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'misc')
-rw-r--r--misc/cgo/testgodefs/testdata/issue39534.go12
-rw-r--r--misc/cgo/testgodefs/testgodefs_test.go1
2 files changed, 13 insertions, 0 deletions
diff --git a/misc/cgo/testgodefs/testdata/issue39534.go b/misc/cgo/testgodefs/testdata/issue39534.go
new file mode 100644
index 0000000000..9899ba1673
--- /dev/null
+++ b/misc/cgo/testgodefs/testdata/issue39534.go
@@ -0,0 +1,12 @@
+// Copyright 2020 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.
+//
+// +build ignore
+
+package main
+
+// enum { ENUMVAL = 0x1 };
+import "C"
+
+const ENUMVAL = C.ENUMVAL
diff --git a/misc/cgo/testgodefs/testgodefs_test.go b/misc/cgo/testgodefs/testgodefs_test.go
index 178fff3fbc..e4085f9ca8 100644
--- a/misc/cgo/testgodefs/testgodefs_test.go
+++ b/misc/cgo/testgodefs/testgodefs_test.go
@@ -24,6 +24,7 @@ var filePrefixes = []string{
"issue37479",
"issue37621",
"issue38649",
+ "issue39534",
}
func TestGoDefs(t *testing.T) {