mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Consistent length typedef.
First stab at initializers.
Change compound literal to Foo({ 1, 2 }) style.
Fixed up some tests.
Optimize the zero struct codegen.
Optimize union empty initializer.
Fix issues with unions. Added alignment to globals. Added some union tests.
Use puts to emit error messages during runtime. Fixup of int[] -> int* style conversions.
Fix implicit conversion of int[3]* -> int*
Fix int[] size. Use () to invoke the length of a subarray. Fix taking a slice of a pointer. Limit the number of members in a struct.
Fixes to vararg using debug and cleanups to slices.
25 lines
401 B
Plaintext
25 lines
401 B
Plaintext
|
|
module test;
|
|
|
|
struct Point
|
|
{
|
|
int x;
|
|
int y;
|
|
}
|
|
|
|
func void test1()
|
|
{
|
|
Point p = { 5, 6 };
|
|
}
|
|
|
|
// #expect: struct_codegen.ll
|
|
|
|
%test.Point = type { i32, i32 }
|
|
@Point = linkonce_odr constant i8 1
|
|
|
|
entry:
|
|
%p = alloca %test.Point, align 4
|
|
%0 = bitcast %test.Point* %p to i8*
|
|
call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %0, i8* align 8 bitcast (%test.Point* @0 to i8*), i32 8, i1 false)
|
|
|