tinygo/compiler/testdata
Ayke van Laethem afd49e7cdd compiler: add support for recursive function types
This adds support for a construct like this:

    type foo func(fn foo)

Unfortunately, LLVM cannot create function pointers that look like this.
LLVM only supports named types for structs (not for pointers) and thus
can't add a pointer to a function type of the same type to a parameter
of that function type.

The fix is simple: cast all function pointers to a void function, in
LLVM IR:

    void ()*

Raw function pointers are cast to this type before storing, and cast
back to the regular function type before calling. This means that
function parameters will never refer to its own type because raw
function types are fixed at that one type.

Somehow, this does have an effect on binary size in some cases. The
effect is small and goes both ways. On top of that, there is work
underway in LLVM which would make all pointer types opaque (without a
pointee type). This would make this whole commit useless and therefore
should fix any size increases that might happen.
https://llvm.org/docs/OpaquePointers.html
2021-10-30 15:55:20 +02:00
..
basic.go compiler: properly implement div and rem operations 2021-10-28 15:55:02 +02:00
basic.ll compiler: properly implement div and rem operations 2021-10-28 15:55:02 +02:00
channel.go compiler: avoid zero-sized alloca in channel operations 2021-09-09 11:24:52 +02:00
channel.ll compiler: add nounwind attribute 2021-10-25 13:39:54 +02:00
float.go compiler: test float to int conversions and fix upper-bound calculation 2021-01-19 14:02:32 +01:00
float.ll compiler: add nounwind attribute 2021-10-25 13:39:54 +02:00
func.go compiler: add func tests 2021-04-12 12:07:42 +02:00
func.ll compiler: add nounwind attribute 2021-10-25 13:39:54 +02:00
go1.17.go compiler: add support for new language features of Go 1.17 2021-08-30 09:18:58 +02:00
go1.17.ll compiler: add nounwind attribute 2021-10-25 13:39:54 +02:00
goroutine-cortex-m-qemu.ll compiler: add support for recursive function types 2021-10-30 15:55:20 +02:00
goroutine-wasm.ll compiler: add nounwind attribute 2021-10-25 13:39:54 +02:00
goroutine.go compiler: add support for running a builtin in a goroutine 2021-05-26 20:21:08 +02:00
interface.go compiler: add interface IR test 2021-03-28 14:00:37 +02:00
interface.ll compiler: add nounwind attribute 2021-10-25 13:39:54 +02:00
intrinsics-cortex-m-qemu.ll compiler: add nounwind attribute 2021-10-25 13:39:54 +02:00
intrinsics-wasm.ll compiler: add nounwind attribute 2021-10-25 13:39:54 +02:00
intrinsics.go compiler: move LLVM math builtin support into the compiler 2021-08-10 20:08:27 +02:00
pointer.go compiler: refactor and add tests 2021-01-15 14:43:43 +01:00
pointer.ll compiler: add nounwind attribute 2021-10-25 13:39:54 +02:00
pragma.go compiler: add function and global section pragmas 2021-06-24 15:00:30 +02:00
pragma.ll compiler: add nounwind attribute 2021-10-25 13:39:54 +02:00
slice.go compiler: add *ssa.MakeSlice bounds tests 2021-08-17 08:16:27 +02:00
slice.ll compiler: add nounwind attribute 2021-10-25 13:39:54 +02:00
string.go compiler: optimize string literals and globals 2021-04-08 11:40:59 +02:00
string.ll compiler: add nounwind attribute 2021-10-25 13:39:54 +02:00