-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change-Id: Id221e8395516d3b7227267fecacc0ef78118041c
- Loading branch information
Showing
4 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
FROM golang:1.10-alpine | ||
|
||
RUN apk add --no-cache bash build-base nodejs | ||
|
||
ENV GOROOT=/usr/local/go-wasm | ||
ADD src $GOROOT/src | ||
ADD misc $GOROOT/misc | ||
ADD test $GOROOT/test | ||
RUN ln -s $GOROOT/misc/wasm/go_js_wasm_exec /usr/local/bin/go_js_wasm_exec | ||
|
||
RUN echo "dev" > $GOROOT/VERSION | ||
RUN cd $GOROOT/src && ./make.bash | ||
ENV PATH=$GOROOT/bin:$PATH | ||
RUN cd $GOROOT/test && go build run.go | ||
|
||
ENV GOARCH=wasm | ||
ENV GOOS=js | ||
RUN go install -v std | ||
RUN go test -short std | ||
RUN cd $GOROOT/test && ./run -v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash | ||
set -ex | ||
|
||
# cd src/cmd/compile/internal/ssa/gen | ||
# go run *.go | ||
# cd - | ||
|
||
env GOROOT=$PWD toolstash go install -v -toolexec=toolstash cmd | ||
|
||
# env GOOS=js GOARCH=wasm GOSSAFUNC=$SSA ./bin/go build -gcflags '-l -c 1' runtime/internal/sys | ||
env GOOS=js GOARCH=wasm GOSSAFUNC=$SSA ./bin/go build -a -gcflags '-l -c 1' -o ~/src/test2/test.wasm test2 | ||
# env GOOS=js GOARCH=wasm GOSSAFUNC=$SSA ./bin/go test -c -a -gcflags '-l -c 1' -o ~/src/test2/test.wasm go/printer | ||
|
||
# wasm2wast --no-check ~/src/test2/test.wasm > ~/src/test2/test.wat | ||
# wast2wasm ~/src/test2/test.wat > /dev/null | ||
|
||
go_js_wasm_exec ~/src/test2/test.wasm -test.v -test.short -test.run=TestLargeStringWrites | ||
|
||
# cd ~/src/test2/ | ||
# wasm-opt test.wasm -o test.wasm --debuginfo | ||
# wasm2wast test.wasm > test.wat | ||
|
||
# wasm-opt test.wasm -o test-opt.wasm --debuginfo -Oz | ||
# wasm2wast test-opt.wasm > test-opt.wat | ||
|
||
# diff -w -u test.wat test-opt.wat > wat.diff |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
set -ex | ||
|
||
env GOROOT=$PWD toolstash go install -v -toolexec=toolstash cmd | ||
|
||
export PATH=$PWD/bin:$PATH | ||
export GOOS=js | ||
export GOARCH=wasm | ||
|
||
cd test | ||
./run -v |