Files
c3c/test/test_suite/arrays/index_into_global.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

33 lines
453 B
Plaintext

// #target: macos-x64
module foo;
struct Bar {
int a;
}
Bar[6] bar;
fn int main()
{
test_bar(0);
return 0;
}
fn void test_bar(int idx)
{
bar[idx].a = 0;
bar[0].a = idx;
}
/* #expect: foo.ll
define void @foo.test_bar(i32 %0) #0 {
entry:
%sext = sext i32 %0 to i64
%ptroffset = getelementptr inbounds [4 x i8], ptr @foo.bar, i64 %sext
store i32 0, ptr %ptroffset, align 4
store i32 %0, ptr @foo.bar, align 16
ret void
}