Files
c3c/test/test_suite/compile_time/ct_declaration_in_if.c3t
Christoffer Lerno 4e66693065 - Refactored @simd implementation.
- Regression vector ABI: npot vectors would load incorrectly from pointers and other things. #2576
2025-11-16 01:37:39 +01:00

44 lines
976 B
Plaintext

// #target: macos-x64
module test;
import std;
struct Vector3
{
float x, y, z;
}
macro @printVecs(Vector3... vectors)
{
for (int $i = 0; $i < vectors.len; ++$i)
{
// do something
}
}
fn void main()
{
@printVecs({10, 5, 3}, {9, 6, 4}, {5, 4, 3});
}
/* #expect: test.ll
define void @test.main() #0 {
entry:
%literal = alloca [3 x %Vector3], align 16
call void @llvm.memcpy.p0.p0.i32(ptr align 16 %literal, ptr align 16 @.__const, i32 36, i1 false)
%0 = insertvalue %"Vector3[]" undef, ptr %literal, 0
%1 = insertvalue %"Vector3[]" %0, i64 3, 1
br label %loop.cond
loop.cond: ; preds = %loop.inc, %entry
%2 = extractvalue %"Vector3[]" %1, 1
%lt = icmp ult i64 0, %2
br i1 %lt, label %loop.inc, label %loop.exit
loop.inc: ; preds = %loop.cond
br label %loop.cond
loop.exit: ; preds = %loop.cond
ret void
}