mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +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
47 lines
1.2 KiB
Plaintext
47 lines
1.2 KiB
Plaintext
// #target: macos-x64
|
|
module test;
|
|
import std::io;
|
|
|
|
struct Ghh
|
|
{
|
|
int a;
|
|
int b;
|
|
int c;
|
|
}
|
|
fn void main()
|
|
{
|
|
int a = 111;
|
|
int x = @atomic_load(a);
|
|
int y = @atomic_load(a, RELAXED, true);
|
|
@atomic_store(a, 123 + x);
|
|
@atomic_store(a, 33 + y, RELAXED, true);
|
|
io::printfn("%d", a);
|
|
}
|
|
|
|
/* #expect: test.ll
|
|
|
|
define void @test.main() #0 {
|
|
entry:
|
|
%a = alloca i32, align 4
|
|
%x = alloca i32, align 4
|
|
%y = alloca i32, align 4
|
|
%varargslots = alloca [1 x %any], align 16
|
|
%retparam = alloca i64, align 8
|
|
store i32 111, ptr %a, align 4
|
|
%0 = load atomic i32, ptr %a seq_cst, align 4
|
|
store i32 %0, ptr %x, align 4
|
|
%1 = load atomic volatile i32, ptr %a monotonic, align 4
|
|
store i32 %1, ptr %y, align 4
|
|
%2 = load i32, ptr %x, align 4
|
|
%add = add i32 123, %2
|
|
store atomic i32 %add, ptr %a seq_cst, align 4
|
|
%3 = load i32, ptr %y, align 4
|
|
%add1 = add i32 33, %3
|
|
store atomic volatile i32 %add1, ptr %a monotonic, align 4
|
|
%4 = insertvalue %any undef, ptr %a, 0
|
|
%5 = insertvalue %any %4, i64 ptrtoint (ptr @"$ct.int" to i64), 1
|
|
store %any %5, ptr %varargslots, align 16
|
|
%6 = call i64 @std.io.printfn(ptr %retparam, ptr @.str, i64 2, ptr %varargslots, i64 1)
|
|
ret void
|
|
}
|