1 // RUN: %llvmgcc -w -S %s -o - | llvm-as -f -o /dev/null
5 void *malloc(unsigned);
8 int puts(const char *s
);
10 struct FunStructTest
{
23 struct SubStruct
*SSP
;
28 struct Quad GlobalQuad
= { 4, {1, 2}, 0, 3, 156 };
30 typedef int (*FuncPtr
)(int);
32 unsigned PtrFunc(int (*Func
)(int), int X
) {
36 char PtrFunc2(FuncPtr FuncTab
[30], int Num
) {
37 return FuncTab
[Num
]('b');
40 extern char SmallArgs2(char w
, char x
, long long Zrrk
, char y
, char z
);
41 extern int SomeFunc(void);
42 char SmallArgs(char w
, char x
, char y
, char z
) {
44 return SmallArgs2(w
-1, x
+1, y
, z
, w
);
47 static int F0(struct Quad Q
, int i
) { /* Pass Q by value */
52 return Q
.SS
.Y
+ i
+ R
.y
- Q
.c
;
55 int F1(struct Quad
*Q
, int i
) { /* Pass Q by address */
62 Q
->w
= Q
->y
= Q
->c
= 1;
63 return Q
->SS
.Y
+i
+R
.y
-Q
->c
;
67 int BadFunc(float Val
) {
69 if (Val
> 12.345) Result
= 4;
70 return Result
; /* Test use of undefined value */
74 return SomeUndefinedFunction(1, 4, 5);
77 extern int EF1(int *, char *, int *);
79 int Func(int Param
, long long Param2
) {
87 { // c & X are duplicate names!
97 short FunFunc(long long x
, char z
) {
101 unsigned castTest(int X
) { return X
; }
103 double TestAdd(double X
, float Y
) {
107 int func(int i
, int j
) {
112 return (i
* 3 + j
*2)*j
;
115 int SumArray(int Array
[], int Num
) {
117 for (i
= 0; i
< Num
; ++i
)
123 int ArrayParam(int Values
[100]) {
124 return EF1((int*)Values
[50], (char*)1, &Values
[50]);
127 int ArrayToSum(void) {
129 for (i
= 0; i
< 100; ++i
)
132 return A
[A
[0]]; //SumArray(A, 100);
136 int ExternFunc(long long, unsigned*, short, unsigned char);
138 int main(int argc
, char *argv
[]) {
140 puts("Hello world!\n");
142 ExternFunc(-1, 0, (short)argc
, 2);
145 for (i
= 0; i
< 10; i
++)
150 double MathFunc(double X
, double Y
, double Z
,
151 double AA
, double BB
, double CC
, double DD
,
152 double EE
, double FF
, double GG
, double HH
,
153 double aAA
, double aBB
, double aCC
, double aDD
,
154 double aEE
, double aFF
) {
155 return X
+ Y
+ Z
+ AA
+ BB
+ CC
+ DD
+ EE
+ FF
+ GG
+ HH
156 + aAA
+ aBB
+ aCC
+ aDD
+ aEE
+ aFF
;
161 void strcpy(char *s1
, char *s2
) {
162 while (*s1
++ = *s2
++);
165 void strcat(char *s1
, char *s2
) {
168 while (*s1
++ = *s2
++);
171 int strcmp(char *s1
, char *s2
) {
172 while (*s1
++ == *s2
++);
183 return (*(--s1
) - *(--s2
));