mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 20:11:17 +00:00
Auto-import std::core. Fix module assignment of declarations. Introspection improvements. Deref null error panics in safe mode. Support for LLVM 15
This commit is contained in:
committed by
Christoffer Lerno
parent
df41caabdd
commit
b1d83e2ccd
27
test/test_suite2/struct/struct_codegen.c3t
Normal file
27
test/test_suite2/struct/struct_codegen.c3t
Normal file
@@ -0,0 +1,27 @@
|
||||
// #target: macos-x64
|
||||
module test;
|
||||
|
||||
struct Point
|
||||
{
|
||||
int x;
|
||||
int y;
|
||||
}
|
||||
|
||||
fn void test1()
|
||||
{
|
||||
Point p = { 5, 6 };
|
||||
}
|
||||
|
||||
/* #expect: test.ll
|
||||
|
||||
%Point = type { i32, i32 }
|
||||
|
||||
@.typeid.test.Point = linkonce constant { i8, i64 } { i8 10, i64 2 }, align 8
|
||||
@.__const = private unnamed_addr constant %Point { i32 5, i32 6 }, align 4
|
||||
|
||||
define void @test.test1() #0 {
|
||||
entry:
|
||||
%p = alloca %Point, align 4
|
||||
call void @llvm.memcpy.p0.p0.i32(ptr align 4 %p, ptr align 4 @.__const, i32 8, i1 false)
|
||||
ret void
|
||||
}
|
||||
Reference in New Issue
Block a user