ADAPT-Chase commited on
Commit
c40ff7e
·
verified ·
1 Parent(s): 11617c4

Add files using upload-large-folder tool

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. platform/dbops/binaries/go/go/test/fixedbugs/issue11656.dir/issue11656.go +75 -0
  2. platform/dbops/binaries/go/go/test/fixedbugs/issue12677.dir/p.go +8 -0
  3. platform/dbops/binaries/go/go/test/fixedbugs/issue12677.dir/q.go +7 -0
  4. platform/dbops/binaries/go/go/test/fixedbugs/issue13777.dir/burnin.go +19 -0
  5. platform/dbops/binaries/go/go/test/fixedbugs/issue13777.dir/main.go +11 -0
  6. platform/dbops/binaries/go/go/test/fixedbugs/issue14164.dir/a.go +47 -0
  7. platform/dbops/binaries/go/go/test/fixedbugs/issue14164.dir/main.go +12 -0
  8. platform/dbops/binaries/go/go/test/fixedbugs/issue14331.dir/a.go +14 -0
  9. platform/dbops/binaries/go/go/test/fixedbugs/issue14331.dir/b.go +11 -0
  10. platform/dbops/binaries/go/go/test/fixedbugs/issue15071.dir/exp.go +24 -0
  11. platform/dbops/binaries/go/go/test/fixedbugs/issue15071.dir/main.go +14 -0
  12. platform/dbops/binaries/go/go/test/fixedbugs/issue15470.dir/a.go +24 -0
  13. platform/dbops/binaries/go/go/test/fixedbugs/issue15470.dir/b.go +3 -0
  14. platform/dbops/binaries/go/go/test/fixedbugs/issue15514.dir/a.go +7 -0
  15. platform/dbops/binaries/go/go/test/fixedbugs/issue15514.dir/b.go +7 -0
  16. platform/dbops/binaries/go/go/test/fixedbugs/issue15514.dir/c.go +10 -0
  17. platform/dbops/binaries/go/go/test/fixedbugs/issue15548.dir/a.go +17 -0
  18. platform/dbops/binaries/go/go/test/fixedbugs/issue15548.dir/b.go +9 -0
  19. platform/dbops/binaries/go/go/test/fixedbugs/issue15548.dir/c.go +10 -0
  20. platform/dbops/binaries/go/go/test/fixedbugs/issue15572.dir/a.go +40 -0
  21. platform/dbops/binaries/go/go/test/fixedbugs/issue15572.dir/b.go +27 -0
  22. platform/dbops/binaries/go/go/test/fixedbugs/issue15609.dir/call.go +7 -0
  23. platform/dbops/binaries/go/go/test/fixedbugs/issue15609.dir/call_386.s +8 -0
  24. platform/dbops/binaries/go/go/test/fixedbugs/issue15609.dir/call_amd64.s +8 -0
  25. platform/dbops/binaries/go/go/test/fixedbugs/issue15609.dir/call_decl.go +5 -0
  26. platform/dbops/binaries/go/go/test/fixedbugs/issue15609.dir/main.go +14 -0
  27. platform/dbops/binaries/go/go/test/fixedbugs/issue15646.dir/a.go +23 -0
  28. platform/dbops/binaries/go/go/test/fixedbugs/issue15646.dir/b.go +16 -0
  29. platform/dbops/binaries/go/go/test/fixedbugs/issue15838.dir/a.go +61 -0
  30. platform/dbops/binaries/go/go/test/fixedbugs/issue15838.dir/b.go +9 -0
  31. platform/dbops/binaries/go/go/test/fixedbugs/issue15920.dir/a.go +9 -0
  32. platform/dbops/binaries/go/go/test/fixedbugs/issue15920.dir/b.go +7 -0
  33. platform/dbops/binaries/go/go/test/fixedbugs/issue16133.dir/a1.go +7 -0
  34. platform/dbops/binaries/go/go/test/fixedbugs/issue16133.dir/a2.go +7 -0
  35. platform/dbops/binaries/go/go/test/fixedbugs/issue16133.dir/b.go +7 -0
  36. platform/dbops/binaries/go/go/test/fixedbugs/issue16133.dir/c.go +10 -0
  37. platform/dbops/binaries/go/go/test/fixedbugs/issue16317.dir/a.go +11 -0
  38. platform/dbops/binaries/go/go/test/fixedbugs/issue16317.dir/b.go +11 -0
  39. platform/dbops/binaries/go/go/test/fixedbugs/issue16616.dir/a.go +7 -0
  40. platform/dbops/binaries/go/go/test/fixedbugs/issue16616.dir/b.go +14 -0
  41. platform/dbops/binaries/go/go/test/fixedbugs/issue16616.dir/issue16616.go +26 -0
  42. platform/dbops/binaries/go/go/test/fixedbugs/issue18419.dir/other.go +11 -0
  43. platform/dbops/binaries/go/go/test/fixedbugs/issue18419.dir/test.go +15 -0
  44. platform/dbops/binaries/go/go/test/fixedbugs/issue18895.dir/p.go +14 -0
  45. platform/dbops/binaries/go/go/test/fixedbugs/issue18895.dir/q.go +11 -0
  46. platform/dbops/binaries/go/go/test/fixedbugs/issue18911.dir/a.go +7 -0
  47. platform/dbops/binaries/go/go/test/fixedbugs/issue18911.dir/b.go +21 -0
  48. platform/dbops/binaries/go/go/test/fixedbugs/issue19028.dir/a.go +9 -0
  49. platform/dbops/binaries/go/go/test/fixedbugs/issue19028.dir/main.go +26 -0
  50. platform/dbops/binaries/go/go/test/fixedbugs/issue19261.dir/p.go +24 -0
platform/dbops/binaries/go/go/test/fixedbugs/issue11656.dir/issue11656.go ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright 2015 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
+ package main
6
+
7
+ import (
8
+ "encoding/binary"
9
+ "runtime"
10
+ "runtime/debug"
11
+ "unsafe"
12
+ )
13
+
14
+ func main() {
15
+ debug.SetPanicOnFault(true)
16
+ defer func() {
17
+ if err := recover(); err == nil {
18
+ panic("not panicking")
19
+ }
20
+ pc, _, _, _ := runtime.Caller(10)
21
+ f := runtime.FuncForPC(pc)
22
+ if f == nil || f.Name() != "main.f" {
23
+ if f == nil {
24
+ println("no func for ", unsafe.Pointer(pc))
25
+ } else {
26
+ println("found func:", f.Name())
27
+ }
28
+ panic("cannot find main.f on stack")
29
+ }
30
+ }()
31
+ f(20)
32
+ }
33
+
34
+ func f(n int) {
35
+ if n > 0 {
36
+ f(n - 1)
37
+ }
38
+ var f struct {
39
+ x uintptr
40
+ }
41
+
42
+ // We want to force a seg fault, to get a crash at a PC value != 0.
43
+ // Not all systems make the data section non-executable.
44
+ ill := make([]byte, 64)
45
+ switch runtime.GOARCH {
46
+ case "386", "amd64":
47
+ ill = append(ill[:0], 0x89, 0x04, 0x25, 0x00, 0x00, 0x00, 0x00) // MOVL AX, 0
48
+ case "arm":
49
+ binary.LittleEndian.PutUint32(ill[0:4], 0xe3a00000) // MOVW $0, R0
50
+ binary.LittleEndian.PutUint32(ill[4:8], 0xe5800000) // MOVW R0, (R0)
51
+ case "arm64":
52
+ binary.LittleEndian.PutUint32(ill, 0xf90003ff) // MOVD ZR, (ZR)
53
+ case "ppc64":
54
+ binary.BigEndian.PutUint32(ill, 0xf8000000) // MOVD R0, (R0)
55
+ case "ppc64le":
56
+ binary.LittleEndian.PutUint32(ill, 0xf8000000) // MOVD R0, (R0)
57
+ case "mips", "mips64":
58
+ binary.BigEndian.PutUint32(ill, 0xfc000000) // MOVV R0, (R0)
59
+ case "mipsle", "mips64le":
60
+ binary.LittleEndian.PutUint32(ill, 0xfc000000) // MOVV R0, (R0)
61
+ case "s390x":
62
+ ill = append(ill[:0], 0xa7, 0x09, 0x00, 0x00) // MOVD $0, R0
63
+ ill = append(ill, 0xe3, 0x00, 0x00, 0x00, 0x00, 0x24) // MOVD R0, (R0)
64
+ case "riscv64":
65
+ binary.LittleEndian.PutUint32(ill, 0x00003023) // MOV X0, (X0)
66
+ default:
67
+ // Just leave it as 0 and hope for the best.
68
+ }
69
+
70
+ f.x = uintptr(unsafe.Pointer(&ill[0]))
71
+ p := &f
72
+ fn := *(*func())(unsafe.Pointer(&p))
73
+ syncIcache(f.x)
74
+ fn()
75
+ }
platform/dbops/binaries/go/go/test/fixedbugs/issue12677.dir/p.go ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ // Copyright 2015 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
+ package p
6
+ func Baz(f int) float64 {
7
+ return 1 / float64(int(1)<<(uint(f)))
8
+ }
platform/dbops/binaries/go/go/test/fixedbugs/issue12677.dir/q.go ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ // Copyright 2015 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
+ package q
6
+ import "./p"
7
+ func f() { println(p.Baz(2)) }
platform/dbops/binaries/go/go/test/fixedbugs/issue13777.dir/burnin.go ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ package burnin
2
+
3
+ type sendCmdFunc func(string)
4
+
5
+ func sendCommand(c string) {}
6
+
7
+ func NewSomething() {
8
+ // This works...
9
+ // var sendCmd sendCmdFunc
10
+ // sendCmd = sendCommand
11
+
12
+ // So does this...
13
+ //sendCmd := sendCmdFunc(sendCommand)
14
+
15
+ // This fails...
16
+ sendCmd := sendCommand
17
+
18
+ _ = sendCmd
19
+ }
platform/dbops/binaries/go/go/test/fixedbugs/issue13777.dir/main.go ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // build
2
+
3
+ package main
4
+
5
+ import (
6
+ x "./burnin"
7
+ )
8
+
9
+ func main() {
10
+ x.NewSomething()
11
+ }
platform/dbops/binaries/go/go/test/fixedbugs/issue14164.dir/a.go ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright 2016 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
+ package a
6
+
7
+ // F is an exported function, small enough to be inlined.
8
+ // It defines a local interface with an unexported method
9
+ // f, which will appear with a package-qualified method
10
+ // name in the export data.
11
+ func F(x interface{}) bool {
12
+ _, ok := x.(interface {
13
+ f()
14
+ })
15
+ return ok
16
+ }
17
+
18
+ // Like F but with the unexported interface method f
19
+ // defined via an embedded interface t. The compiler
20
+ // always flattens embedded interfaces so there should
21
+ // be no difference between F and G. Alas, currently
22
+ // G is not inlineable (at least via export data), so
23
+ // the issue is moot, here.
24
+ func G(x interface{}) bool {
25
+ type t0 interface {
26
+ f()
27
+ }
28
+ _, ok := x.(interface {
29
+ t0
30
+ })
31
+ return ok
32
+ }
33
+
34
+ // Like G but now the embedded interface is declared
35
+ // at package level. This function is inlineable via
36
+ // export data. The export data representation is like
37
+ // for F.
38
+ func H(x interface{}) bool {
39
+ _, ok := x.(interface {
40
+ t1
41
+ })
42
+ return ok
43
+ }
44
+
45
+ type t1 interface {
46
+ f()
47
+ }
platform/dbops/binaries/go/go/test/fixedbugs/issue14164.dir/main.go ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright 2016 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
+ package main
6
+
7
+ // Verify that we can import package "a" containing an inlineable
8
+ // function F that declares a local interface with a non-exported
9
+ // method f.
10
+ import _ "./a"
11
+
12
+ func main() {}
platform/dbops/binaries/go/go/test/fixedbugs/issue14331.dir/a.go ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright 2016 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
+ package a
6
+
7
+ var S struct {
8
+ Str string `tag`
9
+ }
10
+
11
+ func F() string {
12
+ v := S
13
+ return v.Str
14
+ }
platform/dbops/binaries/go/go/test/fixedbugs/issue14331.dir/b.go ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright 2016 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
+ package b
6
+
7
+ import "./a"
8
+
9
+ func G() string {
10
+ return a.F()
11
+ }
platform/dbops/binaries/go/go/test/fixedbugs/issue15071.dir/exp.go ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright 2016 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
+ package exp
6
+
7
+ func Exported(x int) int {
8
+ return inlined(x)
9
+ }
10
+
11
+ func inlined(x int) int {
12
+ y := 0
13
+ switch {
14
+ case x > 0:
15
+ y += 5
16
+ return 0 + y
17
+ case x < 1:
18
+ y += 6
19
+ fallthrough
20
+ default:
21
+ y += 7
22
+ return 2 + y
23
+ }
24
+ }
platform/dbops/binaries/go/go/test/fixedbugs/issue15071.dir/main.go ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // run
2
+
3
+ // Copyright 2016 The Go Authors. All rights reserved.
4
+ // Use of this source code is governed by a BSD-style
5
+ // license that can be found in the LICENSE file.
6
+
7
+ package main
8
+
9
+ import "os"
10
+ import "./exp"
11
+
12
+ func main() {
13
+ _ = exp.Exported(len(os.Args))
14
+ }
platform/dbops/binaries/go/go/test/fixedbugs/issue15470.dir/a.go ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ package a
2
+
3
+ import "io"
4
+
5
+ type T interface {
6
+ M0(_ int)
7
+ M1(x, _ int) // _ (blank) caused crash
8
+ M2() (x, _ int)
9
+ }
10
+
11
+ type S struct{}
12
+
13
+ func (S) M0(_ int) {}
14
+ func (S) M1(x, _ int) {}
15
+ func (S) M2() (x, _ int) { return }
16
+ func (_ S) M3() {}
17
+
18
+ // Snippet from x/tools/godoc/analysis/analysis.go.
19
+ // Offending code from #5470.
20
+ type Link interface {
21
+ Start() int
22
+ End() int
23
+ Write(w io.Writer, _ int, start bool) // _ (blank) caused crash
24
+ }
platform/dbops/binaries/go/go/test/fixedbugs/issue15470.dir/b.go ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ package b
2
+
3
+ import _ "./a" // must not fail
platform/dbops/binaries/go/go/test/fixedbugs/issue15514.dir/a.go ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ // Copyright 2016 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
+ package a
6
+
7
+ type A struct{ _ int32 }
platform/dbops/binaries/go/go/test/fixedbugs/issue15514.dir/b.go ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ // Copyright 2016 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
+ package b
6
+
7
+ func B() (_ struct{ _ int32 }) { return }
platform/dbops/binaries/go/go/test/fixedbugs/issue15514.dir/c.go ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright 2016 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
+ package c
6
+
7
+ import "./a"
8
+ import "./b"
9
+
10
+ var _ a.A = b.B() // ERROR "cannot use b\.B|incompatible type"
platform/dbops/binaries/go/go/test/fixedbugs/issue15548.dir/a.go ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright 2016 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
+ package a
6
+
7
+ type I0 interface {
8
+ I1
9
+ }
10
+
11
+ type T struct {
12
+ I1
13
+ }
14
+
15
+ type I1 interface {
16
+ M(*T) // removing * makes crash go away
17
+ }
platform/dbops/binaries/go/go/test/fixedbugs/issue15548.dir/b.go ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright 2016 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
+ package b
6
+
7
+ import "./a"
8
+
9
+ var X a.T
platform/dbops/binaries/go/go/test/fixedbugs/issue15548.dir/c.go ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright 2016 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
+ package c
6
+
7
+ import (
8
+ _ "./b"
9
+ _ "./a"
10
+ )
platform/dbops/binaries/go/go/test/fixedbugs/issue15572.dir/a.go ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright 2016 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
+ package a
6
+
7
+ type T struct {
8
+ }
9
+
10
+ func F() []T {
11
+ return []T{T{}}
12
+ }
13
+
14
+ func Fi() []T {
15
+ return []T{{}} // element with implicit composite literal type
16
+ }
17
+
18
+ func Fp() []*T {
19
+ return []*T{&T{}}
20
+ }
21
+
22
+ func Fip() []*T {
23
+ return []*T{{}} // element with implicit composite literal type
24
+ }
25
+
26
+ func Gp() map[int]*T {
27
+ return map[int]*T{0: &T{}}
28
+ }
29
+
30
+ func Gip() map[int]*T {
31
+ return map[int]*T{0: {}} // element with implicit composite literal type
32
+ }
33
+
34
+ func Hp() map[*T]int {
35
+ return map[*T]int{&T{}: 0}
36
+ }
37
+
38
+ func Hip() map[*T]int {
39
+ return map[*T]int{{}: 0} // key with implicit composite literal type
40
+ }
platform/dbops/binaries/go/go/test/fixedbugs/issue15572.dir/b.go ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright 2016 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
+ package b
6
+
7
+ import "./a"
8
+
9
+ func F() {
10
+ a.F()
11
+ a.Fi()
12
+ }
13
+
14
+ func Fp() {
15
+ a.Fp()
16
+ a.Fip()
17
+ }
18
+
19
+ func Gp() {
20
+ a.Gp()
21
+ a.Gip()
22
+ }
23
+
24
+ func Hp() {
25
+ a.Hp()
26
+ a.Hip()
27
+ }
platform/dbops/binaries/go/go/test/fixedbugs/issue15609.dir/call.go ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ //go:build !amd64 && !386
2
+
3
+ package main
4
+
5
+ func jump() {
6
+ target()
7
+ }
platform/dbops/binaries/go/go/test/fixedbugs/issue15609.dir/call_386.s ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ #include "textflag.h"
2
+
3
+ DATA ·pointer(SB)/4, $·target(SB)
4
+ GLOBL ·pointer(SB),RODATA,$4
5
+
6
+ TEXT ·jump(SB),NOSPLIT,$4
7
+ CALL *·pointer(SB)
8
+ RET
platform/dbops/binaries/go/go/test/fixedbugs/issue15609.dir/call_amd64.s ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ #include "textflag.h"
2
+
3
+ DATA ·pointer(SB)/8, $·target(SB)
4
+ GLOBL ·pointer(SB),RODATA,$8
5
+
6
+ TEXT ·jump(SB),NOSPLIT,$8
7
+ CALL *·pointer(SB)
8
+ RET
platform/dbops/binaries/go/go/test/fixedbugs/issue15609.dir/call_decl.go ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ //go:build amd64 || 386
2
+
3
+ package main
4
+
5
+ func jump()
platform/dbops/binaries/go/go/test/fixedbugs/issue15609.dir/main.go ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ package main
2
+
3
+ var called bool
4
+
5
+ func target() {
6
+ called = true
7
+ }
8
+
9
+ func main() {
10
+ jump()
11
+ if !called {
12
+ panic("target not called")
13
+ }
14
+ }
platform/dbops/binaries/go/go/test/fixedbugs/issue15646.dir/a.go ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright 2016 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
+ package a
6
+
7
+ type T struct{}
8
+
9
+ func (T) m() string {
10
+ return "m"
11
+ }
12
+
13
+ func (*T) mp() string {
14
+ return "mp"
15
+ }
16
+
17
+ func F() func(T) string {
18
+ return T.m // method expression
19
+ }
20
+
21
+ func Fp() func(*T) string {
22
+ return (*T).mp // method expression
23
+ }
platform/dbops/binaries/go/go/test/fixedbugs/issue15646.dir/b.go ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright 2016 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
+ package main
6
+
7
+ import "./a" // import must succeed
8
+
9
+ func main() {
10
+ if a.F()(a.T{}) != "m" {
11
+ panic(0)
12
+ }
13
+ if a.Fp()(nil) != "mp" {
14
+ panic(1)
15
+ }
16
+ }
platform/dbops/binaries/go/go/test/fixedbugs/issue15838.dir/a.go ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright 2016 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
+ package a
6
+
7
+ func F1() {
8
+ L:
9
+ goto L
10
+ }
11
+
12
+ func F2() {
13
+ L:
14
+ for {
15
+ break L
16
+ }
17
+ }
18
+
19
+ func F3() {
20
+ L:
21
+ for {
22
+ continue L
23
+ }
24
+ }
25
+
26
+ func F4() {
27
+ switch {
28
+ case true:
29
+ fallthrough
30
+ default:
31
+ }
32
+ }
33
+
34
+ type T struct{}
35
+
36
+ func (T) M1() {
37
+ L:
38
+ goto L
39
+ }
40
+
41
+ func (T) M2() {
42
+ L:
43
+ for {
44
+ break L
45
+ }
46
+ }
47
+
48
+ func (T) M3() {
49
+ L:
50
+ for {
51
+ continue L
52
+ }
53
+ }
54
+
55
+ func (T) M4() {
56
+ switch {
57
+ case true:
58
+ fallthrough
59
+ default:
60
+ }
61
+ }
platform/dbops/binaries/go/go/test/fixedbugs/issue15838.dir/b.go ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright 2016 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
+ package b
6
+
7
+ import "./a"
8
+
9
+ type T struct{ a.T }
platform/dbops/binaries/go/go/test/fixedbugs/issue15920.dir/a.go ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright 2016 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
+ package a
6
+
7
+ type Error error
8
+
9
+ func F() Error { return nil }
platform/dbops/binaries/go/go/test/fixedbugs/issue15920.dir/b.go ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ // Copyright 2016 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
+ package b
6
+
7
+ import _ "./a"
platform/dbops/binaries/go/go/test/fixedbugs/issue16133.dir/a1.go ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ package a
2
+
3
+ type X string
4
+
5
+ func NewX() X {
6
+ return ""
7
+ }
platform/dbops/binaries/go/go/test/fixedbugs/issue16133.dir/a2.go ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ package a
2
+
3
+ type X string
4
+
5
+ func NewX() X {
6
+ return ""
7
+ }
platform/dbops/binaries/go/go/test/fixedbugs/issue16133.dir/b.go ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ package b
2
+
3
+ import "./a2"
4
+
5
+ type T struct {
6
+ X a.X
7
+ }
platform/dbops/binaries/go/go/test/fixedbugs/issue16133.dir/c.go ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ package p
2
+
3
+ import (
4
+ "./a1"
5
+ "./b"
6
+ )
7
+
8
+ var _ = b.T{
9
+ X: a.NewX(), // ERROR `cannot use "a1"\.NewX\(\)`
10
+ }
platform/dbops/binaries/go/go/test/fixedbugs/issue16317.dir/a.go ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright 2016 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
+ package a
6
+
7
+ import "unsafe"
8
+
9
+ func ConstUnsafePointer() unsafe.Pointer {
10
+ return unsafe.Pointer(uintptr(0))
11
+ }
platform/dbops/binaries/go/go/test/fixedbugs/issue16317.dir/b.go ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright 2016 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
+ package main
6
+
7
+ import "./a"
8
+
9
+ func main() {
10
+ _ = a.ConstUnsafePointer()
11
+ }
platform/dbops/binaries/go/go/test/fixedbugs/issue16616.dir/a.go ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ // Copyright 2016 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
+ package a
6
+
7
+ type V struct{ i int }
platform/dbops/binaries/go/go/test/fixedbugs/issue16616.dir/b.go ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright 2016 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
+ package b
6
+
7
+ import "./a"
8
+
9
+ var V struct{ i int }
10
+
11
+ var U struct {
12
+ a.V
13
+ j int
14
+ }
platform/dbops/binaries/go/go/test/fixedbugs/issue16616.dir/issue16616.go ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright 2016 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
+ package main
6
+
7
+ import (
8
+ "reflect"
9
+
10
+ _ "./a"
11
+ "./b"
12
+ )
13
+
14
+ var V struct{ i int }
15
+
16
+ func main() {
17
+ if got := reflect.ValueOf(b.V).Type().Field(0).PkgPath; got != "b" {
18
+ panic(`PkgPath=` + got + ` for first field of b.V, want "b"`)
19
+ }
20
+ if got := reflect.ValueOf(V).Type().Field(0).PkgPath; got != "main" {
21
+ panic(`PkgPath=` + got + ` for first field of V, want "main"`)
22
+ }
23
+ if got := reflect.ValueOf(b.U).Type().Field(0).PkgPath; got != "b" {
24
+ panic(`PkgPath=` + got + ` for first field of b.U, want "b"`)
25
+ }
26
+ }
platform/dbops/binaries/go/go/test/fixedbugs/issue18419.dir/other.go ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright 2017 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
+ package other
6
+
7
+ type Exported struct {
8
+ Member int
9
+ }
10
+
11
+ func (e *Exported) member() int { return 1 }
platform/dbops/binaries/go/go/test/fixedbugs/issue18419.dir/test.go ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // errorcheck -0 -m -l
2
+
3
+ // Copyright 2017 The Go Authors. All rights reserved.
4
+ // Use of this source code is governed by a BSD-style
5
+ // license that can be found in the LICENSE file.
6
+
7
+ package main
8
+
9
+ import "./other"
10
+
11
+ func InMyCode(e *other.Exported) {
12
+ e.member() // ERROR "e\.member undefined .cannot refer to unexported field or method other\.\(\*Exported\)\.member.|unexported field or method"
13
+ }
14
+
15
+ func main() {}
platform/dbops/binaries/go/go/test/fixedbugs/issue18895.dir/p.go ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright 2017 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
+ package p
6
+
7
+ func F() { // ERROR "can inline"
8
+ var v t
9
+ v.m() // ERROR "inlining call"
10
+ }
11
+
12
+ type t int
13
+
14
+ func (t) m() {} // ERROR "can inline"
platform/dbops/binaries/go/go/test/fixedbugs/issue18895.dir/q.go ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright 2017 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
+ package q
6
+
7
+ import "./p"
8
+
9
+ func x() { // ERROR "can inline x"
10
+ p.F() // ERROR "inlining call to .*\.F" "inlining call to .*\.m"
11
+ }
platform/dbops/binaries/go/go/test/fixedbugs/issue18911.dir/a.go ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
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
+ package a
6
+
7
+ var X interface{} = struct{ x int }{}
platform/dbops/binaries/go/go/test/fixedbugs/issue18911.dir/b.go ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ package main
6
+
7
+ import "./a"
8
+ import "strings"
9
+
10
+ func main() {
11
+ defer func() {
12
+ p, ok := recover().(error)
13
+ if ok && strings.Contains(p.Error(), "different packages") {
14
+ return
15
+ }
16
+ panic(p)
17
+ }()
18
+
19
+ // expected to fail and report two identical looking (but different) types
20
+ _ = a.X.(struct{ x int })
21
+ }
platform/dbops/binaries/go/go/test/fixedbugs/issue19028.dir/a.go ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright 2017 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
+ package reflect
6
+
7
+ import "reflect"
8
+
9
+ type Type reflect.Type
platform/dbops/binaries/go/go/test/fixedbugs/issue19028.dir/main.go ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright 2017 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
+ package main
6
+
7
+ import (
8
+ "reflect"
9
+ fake "./a" // 2nd package with name "reflect"
10
+ )
11
+
12
+ type T struct {
13
+ _ fake.Type
14
+ }
15
+
16
+ func (T) f() {}
17
+ func (T) G() (_ int) { return }
18
+ func (T) H() (_, _ int) { return }
19
+
20
+ func main() {
21
+ var x T
22
+ typ := reflect.TypeOf(x)
23
+ for i := 0; i < typ.NumMethod(); i++ {
24
+ _ = typ.Method(i) // must not crash
25
+ }
26
+ }
platform/dbops/binaries/go/go/test/fixedbugs/issue19261.dir/p.go ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Copyright 2017 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
+ package p
6
+
7
+ func F() { // ERROR "can inline F"
8
+ print(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
9
+ print(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
10
+ print(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
11
+ print(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
12
+ print(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
13
+ print(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
14
+ }
15
+
16
+ func G() {
17
+ F() // ERROR "inlining call to F"
18
+ print(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
19
+ print(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
20
+ print(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
21
+ print(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
22
+ print(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
23
+ print(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
24
+ }