mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
41 lines
839 B
C
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)
|