Text file src/simd/_gen/simdgen/etetest.sh

     1  #!/bin/bash
     2  
     3  # This is an end-to-end test of Go SIMD. It updates all generated
     4  # files in this repo and then runs several tests.
     5  
     6  XEDDATA="${XEDDATA:-xeddata}"
     7  if [[ ! -d "$XEDDATA" ]]; then
     8      echo >&2 "Must either set \$XEDDATA or symlink xeddata/ to the XED obj/dgen directory."
     9      exit 1
    10  fi
    11  
    12  which go >/dev/null || exit 1
    13  goroot="$(go env GOROOT)"
    14  if [[ ! ../../../.. -ef "$goroot" ]]; then
    15      # We might be able to make this work but it's SO CONFUSING.
    16      echo >&2 "go command in path has GOROOT $goroot"
    17      exit 1
    18  fi
    19  
    20  if [[ $(go env GOEXPERIMENT) != simd ]]; then
    21      echo >&2 "GOEXPERIMENT=$(go env GOEXPERIMENT), expected simd"
    22      exit 1
    23  fi
    24  
    25  set -ex
    26  
    27  # Regenerate SIMD files
    28  go run . -o godefs -goroot "$goroot" -xedPath "$XEDDATA" go.yaml types.yaml categories.yaml
    29  # Regenerate SSA files from SIMD rules
    30  go run -C "$goroot"/src/cmd/compile/internal/ssa/_gen .
    31  
    32  # Rebuild compiler
    33  cd "$goroot"/src
    34  go install cmd/compile
    35  
    36  # Tests
    37  GOARCH=amd64 go run -C simd/testdata .
    38  GOARCH=amd64 go test -v simd
    39  go test go/doc go/build
    40  go test cmd/api -v -check -run ^TestCheck$
    41  go test cmd/compile/internal/ssagen -simd=0
    42  
    43  # Check tests without the GOEXPERIMENT
    44  GOEXPERIMENT= go test go/doc go/build
    45  GOEXPERIMENT= go test cmd/api -v -check -run ^TestCheck$
    46  GOEXPERIMENT= go test cmd/compile/internal/ssagen -simd=0
    47  
    48  # TODO: Add some tests of SIMD itself
    49  

View as plain text