diff --git a/builder/sizes_test.go b/builder/sizes_test.go index 0f513cc27c..6a6f8d8fcf 100644 --- a/builder/sizes_test.go +++ b/builder/sizes_test.go @@ -75,6 +75,18 @@ func TestBinarySize(t *testing.T) { {target: "microbit", path: "examples/serial", opt: "z"}, {target: "wioterminal", path: "examples/pininterrupt", opt: "z"}, + {target: "pico", path: "examples/serial", opt: "z"}, + {target: "pico", path: "examples/serial", opt: "2"}, + {target: "pico2", path: "examples/serial", opt: "z"}, + {target: "pico2", path: "examples/serial", opt: "2"}, + {target: "esp32c3-generic", path: "examples/serial", opt: "z"}, + {target: "esp32c3-generic", path: "examples/serial", opt: "2"}, + + {target: "cortex-m-qemu", path: "./testdata/size-slice", opt: "z"}, + {target: "cortex-m-qemu", path: "./testdata/size-slice", opt: "2"}, + {target: "pico2", path: "./testdata/size-os", opt: "z"}, + {target: "pico2", path: "./testdata/size-os", opt: "2"}, + {target: "cortex-m-qemu", path: "./testdata/size-corpus", opt: "z"}, {target: "cortex-m-qemu", path: "./testdata/size-corpus", opt: "2"}, {target: "riscv-qemu", path: "./testdata/size-corpus", opt: "z"}, diff --git a/builder/testdata/binary-size.txt b/builder/testdata/binary-size.txt index ebf3394095..b5e1676839 100644 --- a/builder/testdata/binary-size.txt +++ b/builder/testdata/binary-size.txt @@ -1,8 +1,18 @@ -target package opt code rodata data bss -hifive1b examples/echo z 4558 402 0 2276 -microbit examples/serial z 3001 439 8 2272 -wioterminal examples/pininterrupt z 7802 1686 136 7280 -cortex-m-qemu ./testdata/size-corpus z 9907 1301 80 4188 -cortex-m-qemu ./testdata/size-corpus 2 17482 862 72 4188 -riscv-qemu ./testdata/size-corpus z 17540 1028 88 16660 -riscv-qemu ./testdata/size-corpus 2 25160 744 80 16644 +target package opt code rodata data bss +hifive1b examples/echo z 4558 402 0 2276 +microbit examples/serial z 3001 439 8 2272 +wioterminal examples/pininterrupt z 7802 1686 136 7280 +pico examples/serial z 7673 1071 112 5616 +pico examples/serial 2 16298 862 108 5616 +pico2 examples/serial z 6468 1172 112 5608 +pico2 examples/serial 2 15925 979 108 5608 +esp32c3-generic examples/serial z 5864 768 0 8664 +esp32c3-generic examples/serial 2 9888 600 8 8672 +cortex-m-qemu ./testdata/size-slice z 3087 793 4 4168 +cortex-m-qemu ./testdata/size-slice 2 7331 341 4 4168 +pico2 ./testdata/size-os z 6153 1207 128 5592 +pico2 ./testdata/size-os 2 15240 1016 128 5592 +cortex-m-qemu ./testdata/size-corpus z 9907 1301 80 4188 +cortex-m-qemu ./testdata/size-corpus 2 17482 862 72 4188 +riscv-qemu ./testdata/size-corpus z 17540 1028 88 16660 +riscv-qemu ./testdata/size-corpus 2 25160 744 80 16644 diff --git a/builder/testdata/size-os/main.go b/builder/testdata/size-os/main.go new file mode 100644 index 0000000000..f481dc0224 --- /dev/null +++ b/builder/testdata/size-os/main.go @@ -0,0 +1,7 @@ +package main + +import "os" + +func main() { + os.Stdout.WriteString("hello\n") +} diff --git a/builder/testdata/size-slice/main.go b/builder/testdata/size-slice/main.go new file mode 100644 index 0000000000..0418348132 --- /dev/null +++ b/builder/testdata/size-slice/main.go @@ -0,0 +1,17 @@ +package main + +var values = makeValues() + +func makeValues() []byte { + var values []byte + for i := 0; i < 32; i++ { + values = append(values, byte(i)) + } + return values +} + +func main() { + for _, value := range values { + println(value) + } +}