mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
30 lines
429 B
C
30 lines
429 B
C
// #target: macos-x64
|
|
module foo;
|
|
|
|
struct Bar
|
|
{
|
|
struct
|
|
{
|
|
int y;
|
|
}
|
|
int ufe;
|
|
int[*] z;
|
|
}
|
|
|
|
|
|
fn void test(Bar b)
|
|
{
|
|
b.z[1];
|
|
}
|
|
|
|
/* #expect: foo.ll
|
|
|
|
%Bar = type { %.anon, i32, [0 x i32] }
|
|
%.anon = type { i32 }
|
|
|
|
define void @foo.test(ptr byval(%Bar) align 8 %0) #0 {
|
|
entry:
|
|
%1 = getelementptr inbounds %Bar, ptr %0, i32 0, i32 2
|
|
%2 = getelementptr inbounds [0 x i32], ptr %1, i64 0, i64 1
|
|
ret void
|
|
}
|