1 // RUN: %clang_cc1 -Wno-implicit-function-declaration -w -emit-llvm %s -o /dev/null
3 void *malloc(unsigned);
4 int puts(const char *s
);
19 struct SubStruct
*SSP
;
24 struct Quad GlobalQuad
= { 4, {1, 2}, 0, 3, 156 };
26 typedef int (*FuncPtr
)(int);
28 unsigned PtrFunc(int (*Func
)(int), int X
) {
32 char PtrFunc2(FuncPtr FuncTab
[30], int Num
) {
33 return FuncTab
[Num
]('b');
36 extern char SmallArgs2(char w
, char x
, long long Zrrk
, char y
, char z
);
37 extern int SomeFunc(void);
38 char SmallArgs(char w
, char x
, char y
, char z
) {
40 return SmallArgs2(w
-1, x
+1, y
, z
, w
);
43 static int F0(struct Quad Q
, int i
) { /* Pass Q by value */
48 return Q
.SS
.Y
+ i
+ R
.y
- Q
.c
;
51 int F1(struct Quad
*Q
, int i
) { /* Pass Q by address */
58 Q
->w
= Q
->y
= Q
->c
= 1;
59 return Q
->SS
.Y
+i
+R
.y
-Q
->c
;
63 int BadFunc(float Val
) {
65 if (Val
> 12.345) Result
= 4;
66 return Result
; /* Test use of undefined value */
70 return SomeUndefinedFunction(1, 4, 5);
73 extern int EF1(int *, char *, int *);
75 int Func(int Param
, long long Param2
) {
83 { // c & X are duplicate names!
93 short FunFunc(long long x
, char z
) {
97 unsigned castTest(int X
) { return X
; }
99 double TestAdd(double X
, float Y
) {
103 int func(int i
, int j
) {
108 return (i
* 3 + j
*2)*j
;
111 int SumArray(int Array
[], int Num
) {
113 for (i
= 0; i
< Num
; ++i
)
119 int ArrayParam(int Values
[100]) {
120 return EF1((int*)Values
[50], (char*)1, &Values
[50]);
123 int ArrayToSum(void) {
125 for (i
= 0; i
< 100; ++i
)
128 return A
[A
[0]]; //SumArray(A, 100);
132 int ExternFunc(long long, unsigned*, short, unsigned char);
134 int main(int argc
, char *argv
[]) {
136 puts("Hello world!\n");
138 ExternFunc(-1, 0, (short)argc
, 2);
141 for (i
= 0; i
< 10; i
++)
146 double MathFunc(double X
, double Y
, double Z
,
147 double AA
, double BB
, double CC
, double DD
,
148 double EE
, double FF
, double GG
, double HH
,
149 double aAA
, double aBB
, double aCC
, double aDD
,
150 double aEE
, double aFF
) {
151 return X
+ Y
+ Z
+ AA
+ BB
+ CC
+ DD
+ EE
+ FF
+ GG
+ HH
152 + aAA
+ aBB
+ aCC
+ aDD
+ aEE
+ aFF
;
157 void strcpy(char *s1
, char *s2
) {
158 while (*s1
++ = *s2
++);
161 void strcat(char *s1
, char *s2
) {
164 while (*s1
++ = *s2
++);
167 int strcmp(char *s1
, char *s2
) {
168 while (*s1
++ == *s2
++);
179 return (*(--s1
) - *(--s2
));