mirror of
https://github.com/golang/go
synced 2024-11-12 12:40:28 -07:00
f74b52cf50
The approach of https://golang.org/cl/43476 turned out incorrect. The problem is that the sniff introduced by the CL only work for simple expression. And when it fails it fallback to uint64, not int64, which breaks backward compatibility. In this CL, we use DWARF for guessing kind instead. That should be more reliable than previous approach. And importanly, it fallbacks to int64 even if it fails to guess kind. Fixes #21708 Change-Id: I39a18cb2efbe4faa9becdcf53d5ac68dba180d46 Reviewed-on: https://go-review.googlesource.com/60510 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
17 lines
416 B
Go
17 lines
416 B
Go
// Copyright 2017 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 cgotest
|
|
|
|
// #include <stdint.h>
|
|
// #define CAST_TO_INT64 (int64_t)(-1)
|
|
import "C"
|
|
import "testing"
|
|
|
|
func test21708(t *testing.T) {
|
|
if got, want := C.CAST_TO_INT64, -1; got != want {
|
|
t.Errorf("C.CAST_TO_INT64 == %v, expected %v", got, want)
|
|
}
|
|
}
|