xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGen/windows-struct-abi.c (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -triple i686-windows-itanium -emit-llvm -o - %s | FileCheck %s
2*0a6a1f1dSLionel Sambuc 
3*0a6a1f1dSLionel Sambuc struct f1 {
4*0a6a1f1dSLionel Sambuc   float f;
5*0a6a1f1dSLionel Sambuc };
6*0a6a1f1dSLionel Sambuc 
return_f1(void)7*0a6a1f1dSLionel Sambuc struct f1 return_f1(void) { while (1); }
8*0a6a1f1dSLionel Sambuc 
9*0a6a1f1dSLionel Sambuc // CHECK: define i32 @return_f1()
10*0a6a1f1dSLionel Sambuc 
receive_f1(struct f1 a0)11*0a6a1f1dSLionel Sambuc void receive_f1(struct f1 a0) { }
12*0a6a1f1dSLionel Sambuc 
13*0a6a1f1dSLionel Sambuc // CHECK: define void @receive_f1(%struct.f1* byval align 4 %a0)
14*0a6a1f1dSLionel Sambuc 
15*0a6a1f1dSLionel Sambuc struct f2 {
16*0a6a1f1dSLionel Sambuc   float f;
17*0a6a1f1dSLionel Sambuc   float g;
18*0a6a1f1dSLionel Sambuc };
19*0a6a1f1dSLionel Sambuc 
return_f2(void)20*0a6a1f1dSLionel Sambuc struct f2 return_f2(void) { while (1); }
21*0a6a1f1dSLionel Sambuc 
22*0a6a1f1dSLionel Sambuc // CHECK: define i64 @return_f2()
23*0a6a1f1dSLionel Sambuc 
receive_f2(struct f2 a0)24*0a6a1f1dSLionel Sambuc void receive_f2(struct f2 a0) { }
25*0a6a1f1dSLionel Sambuc 
26*0a6a1f1dSLionel Sambuc // CHECK: define void @receive_f2(%struct.f2* byval align 4 %a0)
27*0a6a1f1dSLionel Sambuc 
28*0a6a1f1dSLionel Sambuc struct f4 {
29*0a6a1f1dSLionel Sambuc   float f;
30*0a6a1f1dSLionel Sambuc   float g;
31*0a6a1f1dSLionel Sambuc   float h;
32*0a6a1f1dSLionel Sambuc   float i;
33*0a6a1f1dSLionel Sambuc };
34*0a6a1f1dSLionel Sambuc 
return_f4(void)35*0a6a1f1dSLionel Sambuc struct f4 return_f4(void) { while (1); }
36*0a6a1f1dSLionel Sambuc 
37*0a6a1f1dSLionel Sambuc // CHECK: define void @return_f4(%struct.f4* noalias sret %agg.result)
38*0a6a1f1dSLionel Sambuc 
receive_f4(struct f4 a0)39*0a6a1f1dSLionel Sambuc void receive_f4(struct f4 a0) { }
40*0a6a1f1dSLionel Sambuc 
41*0a6a1f1dSLionel Sambuc // CHECK: define void @receive_f4(%struct.f4* byval align 4 %a0)
42*0a6a1f1dSLionel Sambuc 
43