// #target: macos-x64
import std::io;
import std::math::vector;
import std::math;

alias Callback = fn int();

fn int xy(Callback a) => a();

fn void main()
{
	const Callback F = fn int() { io::printfn("Hello"); return 23; };
	int z = xy(F);
	io::printfn("%d", z);
	int y = xy(fn () { return 3; });
}

/* #expect: simple_lambda.ll

@main.F = internal unnamed_addr constant ptr @"simple_lambda.main$lambda1", align 8

define void @simple_lambda.main() #0 {
entry:
  %z = alloca i32, align 4
  %0 = call i32 @simple_lambda.xy(ptr @"simple_lambda.main$lambda1")
  %4 = call i32 @simple_lambda.xy(ptr @"simple_lambda.main$lambda2")

define internal i32 @"simple_lambda.main$lambda1"() #0 {

define internal i32 @"simple_lambda.main$lambda2"() #0 {
entry:
  ret i32 3
}
