aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/coverage
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/coverage')
-rw-r--r--src/runtime/coverage/emit.go3
-rw-r--r--src/runtime/coverage/testsupport.go6
2 files changed, 9 insertions, 0 deletions
diff --git a/src/runtime/coverage/emit.go b/src/runtime/coverage/emit.go
index 6fe04daea8..6510c889ea 100644
--- a/src/runtime/coverage/emit.go
+++ b/src/runtime/coverage/emit.go
@@ -574,6 +574,9 @@ func (s *emitState) emitCounterDataFile(finalHash [16]byte, w io.Writer) error {
return nil
}
+// markProfileEmitted is injected to testmain via linkname.
+//go:linkname markProfileEmitted
+
// markProfileEmitted signals the runtime/coverage machinery that
// coverage data output files have already been written out, and there
// is no need to take any additional action at exit time. This
diff --git a/src/runtime/coverage/testsupport.go b/src/runtime/coverage/testsupport.go
index 4b00f3a0f7..b673d3cd2c 100644
--- a/src/runtime/coverage/testsupport.go
+++ b/src/runtime/coverage/testsupport.go
@@ -22,6 +22,9 @@ import (
"unsafe"
)
+// processCoverTestDir is injected in testmain.
+//go:linkname processCoverTestDir
+
// processCoverTestDir is called (via a linknamed reference) from
// testmain code when "go test -cover" is in effect. It is not
// intended to be used other than internally by the Go command's
@@ -277,6 +280,9 @@ func (ts *tstate) readAuxMetaFiles(metafiles string, importpaths map[string]stru
return nil
}
+// snapshot is injected in testmain.
+//go:linkname snapshot
+
// snapshot returns a snapshot of coverage percentage at a moment of
// time within a running test, so as to support the testing.Coverage()
// function. This version doesn't examine coverage meta-data, so the