Files
c3c/test/test_suite/distinct/distinct_function.c3t
Christoffer Lerno 5c77c9a754 - Change distinct -> typedef.
- Order of attribute declaration is changed for `alias`.
- Added `LANGUAGE_DEV_VERSION` env constant.
- Rename `anyfault` -> `fault`.
- Changed `fault` -> `faultdef`.
- Added `attrdef` instead of `alias` for attribute aliases.
2025-03-15 20:10:47 +01:00

34 lines
693 B
Plaintext

module test;
alias FnA = fn void(int*);
typedef FnB = FnA;
typedef FnC = inline FnA;
fn void func(int*) {}
fn void main()
{
FnA a = &func;
FnB b = (FnB)&func;
FnB b2 = &func;
FnB b3 = fn (int* x) {};
FnC c = &func;
c(null);
}
/* #expect: test.ll
%a = alloca ptr, align 8
%b = alloca ptr, align 8
%b2 = alloca ptr, align 8
%b3 = alloca ptr, align 8
%c = alloca ptr, align 8
store ptr @test.func, ptr %a, align 8
store ptr @test.func, ptr %b, align 8
store ptr @test.func, ptr %b2, align 8
store ptr @"test.main$lambda1", ptr %b3, align 8
store ptr @test.func, ptr %c, align 8
%0 = load ptr, ptr %c, align 8
call void %0(ptr null)
ret void