mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 20:11:17 +00:00
Upgrade of mingw in CI. Fix problems using reflection on interface types #1203. Improved debug information on defer. $foreach doesn't create an implicit syntactic scope. Error if `@if` depends on `@if`. Updated Linux stacktrace. Fix of default argument stacktrace. Allow linking libraries directly by file path. Improve inlining warning messages. Added `index_of_char_from`. Compiler crash using enum nameof from different module #1205. Removed unused fields in find_msvc. Use vswhere to find msvc. Update tests for LLVM 19
53 lines
1.2 KiB
C
53 lines
1.2 KiB
C
// #target: macos-x64
|
|
module test;
|
|
bitstruct Flags : int {
|
|
bool flag1;
|
|
}
|
|
|
|
struct Foo {
|
|
long x;
|
|
Flags flags;
|
|
}
|
|
|
|
fn int main(String[] args) {
|
|
long x;
|
|
Foo foo = {
|
|
.x = x,
|
|
.flags.flag1 = true,
|
|
};
|
|
Flags flags;
|
|
Foo bar = {
|
|
.x = x,
|
|
.flags = flags,
|
|
};
|
|
return 0;
|
|
}
|
|
|
|
|
|
/* #expect: test.ll
|
|
|
|
store ptr %0, ptr %args, align 8
|
|
%ptradd = getelementptr inbounds i8, ptr %args, i64 8
|
|
store i64 %1, ptr %ptradd, align 8
|
|
store i64 0, ptr %x, align 8
|
|
store i64 0, ptr %foo, align 8
|
|
%ptradd1 = getelementptr inbounds i8, ptr %foo, i64 8
|
|
store i32 0, ptr %ptradd1, align 8
|
|
%2 = load i64, ptr %x, align 8
|
|
store i64 %2, ptr %foo, align 8
|
|
%ptradd2 = getelementptr inbounds i8, ptr %foo, i64 8
|
|
%3 = load i32, ptr %ptradd2, align 8
|
|
%4 = and i32 %3, -2
|
|
%5 = or i32 %4, 1
|
|
store i32 %5, ptr %ptradd2, align 8
|
|
store i32 0, ptr %flags, align 4
|
|
store i64 0, ptr %bar, align 8
|
|
%ptradd3 = getelementptr inbounds i8, ptr %bar, i64 8
|
|
store i32 0, ptr %ptradd3, align 8
|
|
%6 = load i64, ptr %x, align 8
|
|
store i64 %6, ptr %bar, align 8
|
|
%ptradd4 = getelementptr inbounds i8, ptr %bar, i64 8
|
|
%7 = load i32, ptr %flags, align 4
|
|
store i32 %7, ptr %ptradd4, align 8
|
|
ret i32 0
|