tinygo/testdata
Ayke van Laethem 33f76d1c2e main: implement -ldflags="-X ..."
This commit implements replacing some global variables with a different
value, if the global variable has no initializer. For example, if you
have:

    package main

    var version string

you can replace the value with -ldflags="-X main.version=0.2".

Right now it only works for uninitialized globals. The Go tooling also
supports initialized globals (var version = "<undefined>") but that is a
bit hard to combine with how initialized globals are currently
implemented.

The current implementation still allows caching package IR files while
making sure the values don't end up in the build cache. This means
compiling a program multiple times with different values will use the
cached package each time, inserting the string value only late in the
build process.

Fixes #1045
2021-04-09 18:33:48 +02:00
..
cgo cgo: add support for CFLAGS in .c files 2021-04-06 10:57:50 +02:00
alias.go
alias.txt
atomic.go compiler: add support for atomic operations 2020-05-28 15:11:46 +02:00
atomic.txt compiler: add support for atomic operations 2020-05-28 15:11:46 +02:00
binop.go compiler: fix non-int integer constants 2020-12-27 16:13:36 +01:00
binop.txt compiler: fix non-int integer constants 2020-12-27 16:13:36 +01:00
calls.go compiler: fix "fragment covers entire variable" bug 2021-03-29 10:16:59 +02:00
calls.txt
channel.go compiler: fix a few crashes due to named types 2020-05-27 16:14:41 +02:00
channel.txt
coroutines.go runtime: add cheap atomic condition variable 2020-10-14 13:35:00 +02:00
coroutines.txt
env.go main: clean up tests 2021-04-09 18:33:48 +02:00
env.txt main: clean up tests 2021-04-09 18:33:48 +02:00
filesystem.go main: clean up tests 2021-04-09 18:33:48 +02:00
filesystem.txt main: clean up tests 2021-04-09 18:33:48 +02:00
float.go compiler: test float to int conversions and fix upper-bound calculation 2021-01-19 14:02:32 +01:00
float.txt compiler: test float to int conversions and fix upper-bound calculation 2021-01-19 14:02:32 +01:00
gc.go
gc.txt runtime: implement a simple mark/sweep garbage collector 2018-11-18 19:18:39 +01:00
init.go testdata: fix formatting 2020-05-12 01:17:27 +02:00
init.txt
init_multi.go
init_multi.txt
interface.go
interface.txt
json.go transform: optimize reflect.Type Implements() method 2021-03-28 14:00:37 +02:00
json.txt transform: optimize reflect.Type Implements() method 2021-03-28 14:00:37 +02:00
ldflags.go main: implement -ldflags="-X ..." 2021-04-09 18:33:48 +02:00
ldflags.txt main: implement -ldflags="-X ..." 2021-04-09 18:33:48 +02:00
map.go runtime: allow ranging over a nil map 2020-10-29 21:53:41 +01:00
map.txt
math.go
math.txt
print.go runtime: use dedicated printfloat32 2020-10-02 11:26:22 +02:00
print.txt runtime: use dedicated printfloat32 2020-10-02 11:26:22 +02:00
reflect.go reflect: implement Sizeof and Alignof for func values 2021-03-29 01:04:11 +02:00
reflect.txt reflect: implement Value.CanAddr 2021-03-28 19:28:55 +02:00
slice.go compiler: fix a few crashes due to named types 2020-05-27 16:14:41 +02:00
slice.txt
sort.go implement reflect.Swapper 2020-10-23 21:37:35 +02:00
sort.txt implement reflect.Swapper 2020-10-23 21:37:35 +02:00
stdlib.go
stdlib.txt os: implement virtual filesystem support 2020-05-13 08:08:57 +02:00
string.go compiler: fix named string to []byte slice conversion 2020-07-29 12:13:37 +02:00
string.txt
structs.go
structs.txt
zeroalloc.go
zeroalloc.txt add code to handle programs which use heap allocations but never hit the GC 2019-11-17 15:14:51 +01:00