Files
c3c/test/test_suite/struct/struct_codegen.c3t

28 lines
481 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
%0 = getelementptr inbounds %test.Point, %test.Point* %p, i32 0, i32 0
store i32 5, i32* %0
%1 = getelementptr inbounds %test.Point, %test.Point* %p, i32 0, i32 1
store i32 6, i32* %1
%2 = load %test.Point, %test.Point* %p