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
35 lines
838 B
Plaintext
35 lines
838 B
Plaintext
// #target: macos-x64
|
|
module test;
|
|
|
|
interface Test {}
|
|
|
|
fn void main()
|
|
{
|
|
Test a;
|
|
bool x = a == null;
|
|
a = null;
|
|
any z = a;
|
|
z = null;
|
|
}
|
|
|
|
/* #expect: test.ll
|
|
|
|
%any = type { ptr, i64 }
|
|
@"$ct.void" = linkonce global %.introspect { i8 0, i64 0, ptr null, i64 1, i64 0, i64 0, [0 x i64] zeroinitializer }, align 8
|
|
|
|
define void @test.main() #0 {
|
|
entry:
|
|
%a = alloca %any, align 8
|
|
%x = alloca i8, align 1
|
|
%z = alloca %any, align 8
|
|
store %any zeroinitializer, ptr %a, align 8
|
|
%0 = load ptr, ptr %a, align 8
|
|
%eq = icmp eq ptr %0, null
|
|
%1 = zext i1 %eq to i8
|
|
store i8 %1, ptr %x, align 1
|
|
store %any { ptr null, i64 ptrtoint (ptr @"$ct.void" to i64) }, ptr %a, align 8
|
|
%2 = load %any, ptr %a, align 8
|
|
store %any %2, ptr %z, align 8
|
|
store %any { ptr null, i64 ptrtoint (ptr @"$ct.void" to i64) }, ptr %z, align 8
|
|
ret void
|
|
} |