Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,11 @@ endif
@$(MD5SUM) test.hex
$(TINYGO) build -o wasm.wasm -target=wasm examples/wasm/export
$(TINYGO) build -o wasm.wasm -target=wasm examples/wasm/main
# test various compiler flags
$(TINYGO) build -size short -o test.hex -target=pca10040 -gc=none -scheduler=none examples/blinky1
@$(MD5SUM) test.hex
$(TINYGO) build -size short -o test.hex -target=pca10040 -opt=1 examples/blinky1
@$(MD5SUM) test.hex

wasmtest:
$(GO) test ./tests/wasm
Expand Down
2 changes: 2 additions & 0 deletions interp/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ func (e *evalPackage) hasSideEffects(fn llvm.Value) (*sideEffectResult, *Error)
// External function call. Assume only limited side effects
// (no affected globals, etc.).
switch child.Name() {
case "runtime.alloc":
continue
case "runtime.typeAssert":
continue // implemented in interp
case "runtime.interfaceImplements":
Expand Down
2 changes: 1 addition & 1 deletion transform/optimizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func Optimize(mod llvm.Module, config *compileopts.Config, optLevel, sizeLevel i
// After TinyGo-specific transforms have finished, undo exporting these functions.
for _, name := range getFunctionsUsedInTransforms(config) {
fn := mod.NamedFunction(name)
if fn.IsNil() {
if fn.IsNil() || fn.IsDeclaration() {
continue
}
fn.SetLinkage(llvm.InternalLinkage)
Expand Down