Douglas Gregor | 3a2f7e4 | 2009-04-13 22:18:37 +0000 | [diff] [blame] | 1 | // Test this without pch. |
Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 2 | // RUN: %clang_cc1 -include %S/functions.h -fsyntax-only -verify %s |
Douglas Gregor | 3a2f7e4 | 2009-04-13 22:18:37 +0000 | [diff] [blame] | 3 | |
| 4 | // Test with pch. |
Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 5 | // RUN: %clang_cc1 -emit-pch -o %t %S/functions.h |
| 6 | // RUN: %clang_cc1 -include-pch %t -fsyntax-only -verify %s |
Douglas Gregor | 3a2f7e4 | 2009-04-13 22:18:37 +0000 | [diff] [blame] | 7 | |
| 8 | int f0(int x0, int y0, ...) { return x0 + y0; } |
| 9 | |
| 10 | float *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 Gregor | 3a2f7e4 | 2009-04-13 22:18:37 +0000 | [diff] [blame] | 15 | } |
| 16 | |
| 17 | void test_g0(int *x, float * y) { |
| 18 | g0(y); // expected-warning{{incompatible pointer types passing 'float *', expected 'int *'}} |
| 19 | g0(x); |
| 20 | } |