blob: fd0c3764b4707d060da7bdbad28384f80ca501ed [file] [log] [blame]
Douglas Gregor3a2f7e42009-04-13 22:18:37 +00001// Test this without pch.
Daniel Dunbara5728872009-12-15 20:14:24 +00002// RUN: %clang_cc1 -include %S/functions.h -fsyntax-only -verify %s
Douglas Gregor3a2f7e42009-04-13 22:18:37 +00003
4// Test with pch.
Daniel Dunbara5728872009-12-15 20:14:24 +00005// RUN: %clang_cc1 -emit-pch -o %t %S/functions.h
6// RUN: %clang_cc1 -include-pch %t -fsyntax-only -verify %s
Douglas Gregor3a2f7e42009-04-13 22:18:37 +00007
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}