blob: 2121b9aaa107f9ede3d0e5616d60b40b8735a985 [file] [log] [blame]
Douglas Gregor3a2f7e42009-04-13 22:18:37 +00001// Test this without pch.
Daniel Dunbar4fcfde42009-11-08 01:45:36 +00002// RUN: clang-cc -include %S/functions.h -fsyntax-only -verify %s
Douglas Gregor3a2f7e42009-04-13 22:18:37 +00003
4// Test with pch.
Daniel Dunbar4fcfde42009-11-08 01:45:36 +00005// RUN: clang-cc -emit-pch -o %t %S/functions.h
Douglas Gregor3a2f7e42009-04-13 22:18:37 +00006// RUN: clang-cc -include-pch %t -fsyntax-only -verify %s
7
8int f0(int x0, int y0, ...) { return x0 + y0; }
9
10float *test_f1(int val, double x, double y) {
11 if (val > 5)
12 return f1(x, y);
13 else
14 return f1(x); // expected-error{{too few arguments to function call}}
Douglas Gregor3a2f7e42009-04-13 22:18:37 +000015}
16
17void test_g0(int *x, float * y) {
18 g0(y); // expected-warning{{incompatible pointer types passing 'float *', expected 'int *'}}
19 g0(x);
20}