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 package runtime_test 6 7 import ( 8 "runtime/internal/startlinetest" 9 "testing" 10 ) 11 12 // TestStartLineAsm tests the start line metadata of an assembly function. This 13 // is only tested on amd64 to avoid the need for a proliferation of per-arch 14 // copies of this function. 15 func TestStartLineAsm(t *testing.T) { 16 startlinetest.CallerStartLine = callerStartLine 17 18 const wantLine = 23 19 got := startlinetest.AsmFunc() 20 if got != wantLine { 21 t.Errorf("start line got %d want %d", got, wantLine) 22 } 23 } 24