xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGen/2002-02-17-ArgumentAddress.c (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -emit-llvm %s  -o /dev/null
2*f4a2713aSLionel Sambuc 
test(int X)3*f4a2713aSLionel Sambuc int test(int X) {
4*f4a2713aSLionel Sambuc   return X;
5*f4a2713aSLionel Sambuc }
6*f4a2713aSLionel Sambuc 
7*f4a2713aSLionel Sambuc void abc(int *X);
def(int Y,int Z)8*f4a2713aSLionel Sambuc int def(int Y, int Z) {
9*f4a2713aSLionel Sambuc   abc(&Z);
10*f4a2713aSLionel Sambuc   return Y;
11*f4a2713aSLionel Sambuc }
12*f4a2713aSLionel Sambuc 
13*f4a2713aSLionel Sambuc struct Test { short X, x; int Y, Z; };
14*f4a2713aSLionel Sambuc 
Testing(struct Test * A)15*f4a2713aSLionel Sambuc int Testing(struct Test *A) {
16*f4a2713aSLionel Sambuc   return A->X+A->Y;
17*f4a2713aSLionel Sambuc }
18*f4a2713aSLionel Sambuc 
Test2(int X,struct Test A,int Y)19*f4a2713aSLionel Sambuc int Test2(int X, struct Test A, int Y) {
20*f4a2713aSLionel Sambuc   return X+Y+A.X+A.Y;
21*f4a2713aSLionel Sambuc }
Test3(struct Test A,struct Test B)22*f4a2713aSLionel Sambuc int Test3(struct Test A, struct Test B) {
23*f4a2713aSLionel Sambuc   return A.X+A.Y+B.Y+B.Z;
24*f4a2713aSLionel Sambuc }
25*f4a2713aSLionel Sambuc 
Test4(struct Test A)26*f4a2713aSLionel Sambuc struct Test Test4(struct Test A) {
27*f4a2713aSLionel Sambuc   return A;
28*f4a2713aSLionel Sambuc }
29*f4a2713aSLionel Sambuc 
Test6()30*f4a2713aSLionel Sambuc int Test6() {
31*f4a2713aSLionel Sambuc   int B[200];
32*f4a2713aSLionel Sambuc   return B[4];
33*f4a2713aSLionel Sambuc }
34*f4a2713aSLionel Sambuc 
35*f4a2713aSLionel Sambuc struct STest2 { int X; short Y[4]; double Z; };
36*f4a2713aSLionel Sambuc 
Test7(struct STest2 X)37*f4a2713aSLionel Sambuc struct STest2 Test7(struct STest2 X) {
38*f4a2713aSLionel Sambuc   return X;
39*f4a2713aSLionel Sambuc }
40