summaryrefslogtreecommitdiffstats
path: root/src/cmd/objdump/testdata
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/objdump/testdata')
-rw-r--r--src/cmd/objdump/testdata/fmthello.go20
-rw-r--r--src/cmd/objdump/testdata/fmthellocgo.go21
-rw-r--r--src/cmd/objdump/testdata/testfilenum/a.go7
-rw-r--r--src/cmd/objdump/testdata/testfilenum/b.go7
-rw-r--r--src/cmd/objdump/testdata/testfilenum/c.go7
-rw-r--r--src/cmd/objdump/testdata/testfilenum/go.mod3
6 files changed, 65 insertions, 0 deletions
diff --git a/src/cmd/objdump/testdata/fmthello.go b/src/cmd/objdump/testdata/fmthello.go
new file mode 100644
index 0000000..c8d8246
--- /dev/null
+++ b/src/cmd/objdump/testdata/fmthello.go
@@ -0,0 +1,20 @@
+package main
+
+import "fmt"
+
+func main() {
+ Println("hello, world")
+ if flag {
+//line fmthello.go:999999
+ Println("bad line")
+ for {
+ }
+ }
+}
+
+//go:noinline
+func Println(s string) {
+ fmt.Println(s)
+}
+
+var flag bool
diff --git a/src/cmd/objdump/testdata/fmthellocgo.go b/src/cmd/objdump/testdata/fmthellocgo.go
new file mode 100644
index 0000000..6555c3b
--- /dev/null
+++ b/src/cmd/objdump/testdata/fmthellocgo.go
@@ -0,0 +1,21 @@
+package main
+
+import "fmt"
+import "C"
+
+func main() {
+ Println("hello, world")
+ if flag {
+//line fmthello.go:999999
+ Println("bad line")
+ for {
+ }
+ }
+}
+
+//go:noinline
+func Println(s string) {
+ fmt.Println(s)
+}
+
+var flag bool
diff --git a/src/cmd/objdump/testdata/testfilenum/a.go b/src/cmd/objdump/testdata/testfilenum/a.go
new file mode 100644
index 0000000..2729ae0
--- /dev/null
+++ b/src/cmd/objdump/testdata/testfilenum/a.go
@@ -0,0 +1,7 @@
+// 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.
+
+package p
+
+func A() {}
diff --git a/src/cmd/objdump/testdata/testfilenum/b.go b/src/cmd/objdump/testdata/testfilenum/b.go
new file mode 100644
index 0000000..a632aaf
--- /dev/null
+++ b/src/cmd/objdump/testdata/testfilenum/b.go
@@ -0,0 +1,7 @@
+// 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.
+
+package p
+
+func B() {}
diff --git a/src/cmd/objdump/testdata/testfilenum/c.go b/src/cmd/objdump/testdata/testfilenum/c.go
new file mode 100644
index 0000000..d73efa7
--- /dev/null
+++ b/src/cmd/objdump/testdata/testfilenum/c.go
@@ -0,0 +1,7 @@
+// 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.
+
+package p
+
+func C() {}
diff --git a/src/cmd/objdump/testdata/testfilenum/go.mod b/src/cmd/objdump/testdata/testfilenum/go.mod
new file mode 100644
index 0000000..db43288
--- /dev/null
+++ b/src/cmd/objdump/testdata/testfilenum/go.mod
@@ -0,0 +1,3 @@
+module objdumptest
+
+go 1.16