mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
- Raw vaargs with optional return not lowered correctly #2819
This commit is contained in:
24
test/test_suite/abi/raw_vaarg_with_optional_return.c3t
Normal file
24
test/test_suite/abi/raw_vaarg_with_optional_return.c3t
Normal file
@@ -0,0 +1,24 @@
|
||||
// #target: linux-aarch64
|
||||
module test;
|
||||
extern fn float? printf(char*,...);
|
||||
fn int main()
|
||||
{
|
||||
float a = 12.3;
|
||||
(void)printf("", a);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* #expect: test.ll
|
||||
|
||||
declare i64 @printf(ptr, ptr, ...) #0
|
||||
|
||||
define i32 @main() #0 {
|
||||
entry:
|
||||
%a = alloca float, align 4
|
||||
%retparam = alloca float, align 4
|
||||
store float 0x40289999A0000000, ptr %a, align 4
|
||||
%0 = load float, ptr %a, align 4
|
||||
%fpfpext = fpext float %0 to double
|
||||
%1 = call i64 (ptr, ptr, ...) @printf(ptr %retparam, ptr @.str, double %fpfpext)
|
||||
ret i32 0
|
||||
}
|
||||
Reference in New Issue
Block a user