Text file src/cmd/link/testdata/script/ppc64_missing_toc_restore.txt

     1  [!GOOS:linux] skip
     2  [!GOARCH:ppc64le] skip
     3  
     4  env GOPPC64=power8
     5  
     6  # Report a missing TOC restoration slot without panicking while rewriting it.
     7  ! go build -buildmode=pie -ldflags=-linkmode=internal
     8  stderr 'missing toc restoration slot'
     9  ! stderr 'panic:'
    10  
    11  -- go.mod --
    12  module main
    13  
    14  go 1.20
    15  -- main.go --
    16  package main
    17  
    18  //go:cgo_import_dynamic libc_getpid getpid "libc.so.6"
    19  
    20  func getpid() int64
    21  
    22  func main() {
    23  	println(getpid())
    24  }
    25  -- main_ppc64le.s --
    26  #include "textflag.h"
    27  
    28  TEXT ·getpid(SB), NOSPLIT|NOFRAME, $0-8
    29  	CALL libc_getpid(SB)
    30  

View as plain text