Files
c3c/test/test_suite2/abi/sysv_abi_noavx.c3t
2022-10-15 02:45:19 +02:00

41 lines
839 B
C

// #target: linux-x64
// #opt: --x86vec=none
module foo;
struct StringRef
{
char* str;
usize size;
}
char gc;
extern fn void take_stringref(StringRef s);
fn void callit()
{
StringRef s = { "asdf" , 4};
take_stringref(s);
}
extern fn float[<8>] get_m256();
extern fn void take_m256(float[<8>] x);
extern fn float[<16>] get_m512();
extern fn void take_m512(float[<16>] x);
fn void use_vectors()
{
float[<8>] v1 = get_m256();
take_m256(v1);
float[<16>] v2 = get_m512();
take_m512(v2);
}
/* #expect: foo.ll
declare void @take_stringref(ptr, i64) #0
call void @take_stringref(ptr %lo, i64 %hi)
define void @foo_use_vectors() #0 {
%0 = call <8 x float> @get_m256()
call void @take_m256(ptr byval(<8 x float>) align 32 %v1)
%1 = call <16 x float> @get_m512()
call void @take_m512(ptr byval(<16 x float>) align 64 %v2)