Files
c3c/test/test_suite/globals/external_global.c3t
2021-05-11 14:58:21 +02:00

34 lines
633 B
Plaintext

module test;
struct MinInfo
{
long offset;
uint file_attr;
}
struct UzGlobs
{
ichar answerbuf;
MinInfo[1] info;
MinInfo* pInfo;
}
extern UzGlobs g;
func int extract_or_test_files()
{
g.pInfo = &g.info;
return 0;
}
// #expect: test.ll
%test.UzGlobs = type { i8, [1 x %test.MinInfo], %test.MinInfo* }
%test.MinInfo = type { i64, i32 }
@g = external global %test.UzGlobs, align 8
entry:
store %test.MinInfo* getelementptr inbounds (%test.UzGlobs, %test.UzGlobs* @g, i32 0, i32 1, i32 0), %test.MinInfo** getelementptr inbounds (%test.UzGlobs, %test.UzGlobs* @g, i32 0, i32 2), align 8
ret i32 0
}