| 1 |
// Copyright 2022 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 |
#include "funcdata.h" |
| 6 |
#include "textflag.h" |
| 7 |
|
| 8 |
// Assembly function for runtime_test.TestStartLineAsm. |
| 9 |
// |
| 10 |
// Note that this file can't be built directly as part of runtime_test, as assembly |
| 11 |
// files can't declare an alternative package. Building it into runtime is |
| 12 |
// possible, but linkshared complicates things: |
| 13 |
// |
| 14 |
// 1. linkshared mode leaves the function around in the final output of |
| 15 |
// non-test builds. |
| 16 |
// 2. Due of (1), the linker can't resolve the callerStartLine relocation |
| 17 |
// (as runtime_test isn't built for non-test builds). |
| 18 |
// |
| 19 |
// Thus it is simpler to just put this in its own package, imported only by |
| 20 |
// runtime_test. We use ABIInternal as no ABI wrapper is generated for |
| 21 |
// callerStartLine since it is in a different package. |
| 22 |
|
| 23 |
TEXT ·AsmFunc<ABIInternal>(SB),NOSPLIT,$8-0 |
| 24 |
NO_LOCAL_POINTERS |
| 25 |
MOVQ $0, AX // wantInlined |
| 26 |
MOVQ ·CallerStartLine(SB), DX |
| 27 |
CALL (DX) |
| 28 |
RET |