mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
&& doesn't work correctly with lambdas #1279.
This commit is contained in:
35
test/test_suite/lambda/lambda_ref.c3t
Normal file
35
test/test_suite/lambda/lambda_ref.c3t
Normal file
@@ -0,0 +1,35 @@
|
||||
// #target: macos-x64
|
||||
module test;
|
||||
|
||||
def FnA = fn void(int*);
|
||||
|
||||
fn void func(int*) { }
|
||||
fn void main()
|
||||
{
|
||||
FnA* a = && &func;
|
||||
a = &&(fn void(int*) { });
|
||||
}
|
||||
|
||||
/* #expect: test.ll
|
||||
|
||||
define void @test.func(ptr %0) #0 {
|
||||
entry:
|
||||
ret void
|
||||
}
|
||||
|
||||
define void @test.main() #0 {
|
||||
entry:
|
||||
%a = alloca ptr, align 8
|
||||
%taddr = alloca ptr, align 8
|
||||
%taddr1 = alloca ptr, align 8
|
||||
store ptr @test.func, ptr %taddr, align 8
|
||||
store ptr %taddr, ptr %a, align 8
|
||||
store ptr @"test.main$lambda1", ptr %taddr1, align 8
|
||||
store ptr %taddr1, ptr %a, align 8
|
||||
ret void
|
||||
}
|
||||
|
||||
define internal void @"test.main$lambda1"(ptr %0) #0 {
|
||||
entry:
|
||||
ret void
|
||||
}
|
||||
Reference in New Issue
Block a user