|
| 1 | +// Copyright 2021 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 | +// N.B. This source is lifted verbatim from trace.go, added in |
| 6 | +// https://github.com/golang/go/commit/74f49f3366826f95a464cc15838a0668c92e3357 |
| 7 | +// |
| 8 | +// It's essentially a shim to allow linking a Go test binary without libfuzzer. |
| 9 | +// We chose the 'bzltestutil' package because it's a bazel dependency for all Go test binaries. |
| 10 | + |
| 11 | +//go:build !libfuzzer |
| 12 | + |
| 13 | +package bzltestutil |
| 14 | + |
| 15 | +import _ "unsafe" // for go:linkname |
| 16 | + |
| 17 | +//go:linkname libfuzzerTraceCmp1 runtime.libfuzzerTraceCmp1 |
| 18 | +//go:linkname libfuzzerTraceCmp2 runtime.libfuzzerTraceCmp2 |
| 19 | +//go:linkname libfuzzerTraceCmp4 runtime.libfuzzerTraceCmp4 |
| 20 | +//go:linkname libfuzzerTraceCmp8 runtime.libfuzzerTraceCmp8 |
| 21 | + |
| 22 | +//go:linkname libfuzzerTraceConstCmp1 runtime.libfuzzerTraceConstCmp1 |
| 23 | +//go:linkname libfuzzerTraceConstCmp2 runtime.libfuzzerTraceConstCmp2 |
| 24 | +//go:linkname libfuzzerTraceConstCmp4 runtime.libfuzzerTraceConstCmp4 |
| 25 | +//go:linkname libfuzzerTraceConstCmp8 runtime.libfuzzerTraceConstCmp8 |
| 26 | + |
| 27 | +//go:linkname libfuzzerHookStrCmp runtime.libfuzzerHookStrCmp |
| 28 | +//go:linkname libfuzzerHookEqualFold runtime.libfuzzerHookEqualFold |
| 29 | + |
| 30 | +func libfuzzerTraceCmp1(arg0, arg1 uint8, fakePC int) {} |
| 31 | +func libfuzzerTraceCmp2(arg0, arg1 uint16, fakePC int) {} |
| 32 | +func libfuzzerTraceCmp4(arg0, arg1 uint32, fakePC int) {} |
| 33 | +func libfuzzerTraceCmp8(arg0, arg1 uint64, fakePC int) {} |
| 34 | + |
| 35 | +func libfuzzerTraceConstCmp1(arg0, arg1 uint8, fakePC int) {} |
| 36 | +func libfuzzerTraceConstCmp2(arg0, arg1 uint16, fakePC int) {} |
| 37 | +func libfuzzerTraceConstCmp4(arg0, arg1 uint32, fakePC int) {} |
| 38 | +func libfuzzerTraceConstCmp8(arg0, arg1 uint64, fakePC int) {} |
| 39 | + |
| 40 | +func libfuzzerHookStrCmp(arg0, arg1 string, fakePC int) {} |
| 41 | +func libfuzzerHookEqualFold(arg0, arg1 string, fakePC int) {} |
0 commit comments