1*67e74705SXin Li // Test this without pch.
2*67e74705SXin Li // RUN: %clang_cc1 -include %S/functions.h -fsyntax-only -verify %s
3*67e74705SXin Li
4*67e74705SXin Li // Test with pch.
5*67e74705SXin Li // RUN: %clang_cc1 -emit-pch -o %t %S/functions.h
6*67e74705SXin Li // RUN: %clang_cc1 -include-pch %t -fsyntax-only -verify %s
7*67e74705SXin Li
f0(int x0,int y0,...)8*67e74705SXin Li int f0(int x0, int y0, ...) { return x0 + y0; }
9*67e74705SXin Li
test_f1(int val,double x,double y)10*67e74705SXin Li float *test_f1(int val, double x, double y) {
11*67e74705SXin Li if (val > 5)
12*67e74705SXin Li return f1(x, y);
13*67e74705SXin Li else
14*67e74705SXin Li return f1(x); // expected-error{{too few arguments to function call}}
15*67e74705SXin Li // [email protected]:7{{'f1' declared here}}
16*67e74705SXin Li }
17*67e74705SXin Li
test_g0(int * x,float * y)18*67e74705SXin Li void test_g0(int *x, float * y) {
19*67e74705SXin Li g0(y); // expected-warning{{incompatible pointer types passing 'float *' to parameter of type 'int *'}}
20*67e74705SXin Li // [email protected]:9{{passing argument to parameter here}}
21*67e74705SXin Li g0(x);
22*67e74705SXin Li }
23*67e74705SXin Li
test_abort(int code)24*67e74705SXin Li void __attribute__((noreturn)) test_abort(int code) {
25*67e74705SXin Li do_abort(code);
26*67e74705SXin Li }
27*67e74705SXin Li
28