diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2019-09-12 23:22:53 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2019-09-12 23:22:53 +0000 |
commit | 656297e1fec9a127ff742df16958ee279ccacec5 (patch) | |
tree | 24347a35dacea36ce742c32c17420f3e31f17e3d /libgo/go/reflect | |
parent | d6ecb707cc5a58816d27908a7aa324c4b0bc67bb (diff) | |
download | gcc-656297e1fec9a127ff742df16958ee279ccacec5.zip gcc-656297e1fec9a127ff742df16958ee279ccacec5.tar.gz gcc-656297e1fec9a127ff742df16958ee279ccacec5.tar.bz2 |
libgo: update to Go1.13
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/194698
From-SVN: r275691
Diffstat (limited to 'libgo/go/reflect')
-rw-r--r-- | libgo/go/reflect/all_test.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/libgo/go/reflect/all_test.go b/libgo/go/reflect/all_test.go index 823d43c..6e06485 100644 --- a/libgo/go/reflect/all_test.go +++ b/libgo/go/reflect/all_test.go @@ -2060,6 +2060,16 @@ func (p Point) TotalDist(points ...Point) int { return tot } +// This will be index 5. +func (p *Point) Int64Method(x int64) int64 { + return x +} + +// This will be index 6. +func (p *Point) Int32Method(x int32) int32 { + return x +} + func TestMethod(t *testing.T) { // Non-curried method of type. p := Point{3, 4} @@ -2268,6 +2278,17 @@ func TestMethodValue(t *testing.T) { if i != 425 { t.Errorf("Interface MethodByName returned %d; want 425", i) } + + // For issue #33628: method args are not stored at the right offset + // on amd64p32. + m64 := ValueOf(&p).MethodByName("Int64Method").Interface().(func(int64) int64) + if x := m64(123); x != 123 { + t.Errorf("Int64Method returned %d; want 123", x) + } + m32 := ValueOf(&p).MethodByName("Int32Method").Interface().(func(int32) int32) + if x := m32(456); x != 456 { + t.Errorf("Int32Method returned %d; want 456", x) + } } func TestVariadicMethodValue(t *testing.T) { |