mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 20:11:17 +00:00
28 lines
481 B
Plaintext
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
|
|
|