tinygo/compiler/testdata
Ayke van Laethem 2bb70812a8 compiler: add function and global section pragmas
This patch adds a new pragma for functions and globals to set the
section name. This can be useful to place a function or global in a
special device specific section, for example:

  * Functions may be placed in RAM to make them run faster, or in flash
    (if RAM is the default) to not let them take up RAM.
  * DMA memory may only be placed in a special memory area.
  * Some RAM may be faster than other RAM, and some globals may be
    performance critical thus placing them in this special RAM area can
    help.
  * Some (large) global variables may need to be placed in external RAM,
    which can be done by placing them in a special section.

To use it, you have to place a function or global in a special section,
for example:

    //go:section .externalram
    var externalRAMBuffer [1024]byte

This can then be placed in a special section of the linker script, for
example something like this:

    .bss.extram (NOLOAD) : {
        *(.externalram)
    } > ERAM
2021-06-24 15:00:30 +02:00
..
basic.go
basic.ll
float.go
float.ll
func.go
func.ll
goroutine-cortex-m-qemu.ll
goroutine-wasm.ll
goroutine.go
interface.go
interface.ll
pointer.go
pointer.ll
pragma.go compiler: add function and global section pragmas 2021-06-24 15:00:30 +02:00
pragma.ll compiler: add function and global section pragmas 2021-06-24 15:00:30 +02:00
slice.go
slice.ll
string.go
string.ll