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
36 lines
731 B
Plaintext
36 lines
731 B
Plaintext
// #target: macos-x64
|
|
module hello(<Type, FOO>);
|
|
|
|
fn Type x(Type t)
|
|
{
|
|
return t * t + FOO;
|
|
}
|
|
|
|
module test;
|
|
import hello;
|
|
def xint = hello::x(<int, -123>);
|
|
|
|
import std::io;
|
|
|
|
fn void main()
|
|
{
|
|
io::printfn("%d", xint(4));
|
|
}
|
|
|
|
/* #expect: test.ll
|
|
|
|
define void @test.main() #0 {
|
|
entry:
|
|
%varargslots = alloca [1 x %any], align 16
|
|
%taddr = alloca i32, align 4
|
|
%retparam = alloca i64, align 8
|
|
%0 = call i32 @"hello$int$_123$.x"(i32 4)
|
|
store i32 %0, ptr %taddr, align 4
|
|
%1 = insertvalue %any undef, ptr %taddr, 0
|
|
%2 = insertvalue %any %1, i64 ptrtoint (ptr @"$ct.int" to i64), 1
|
|
store %any %2, ptr %varargslots, align 16
|
|
%3 = call i64 @std.io.printfn(ptr %retparam, ptr @.str, i64 2, ptr %varargslots, i64 1)
|
|
ret void
|
|
}
|
|
|