1 | // Test this without pch. |
2 | // RUN: %clang_cc1 -include %S/functions.h -fsyntax-only -verify %s |
3 | |
4 | // Test with pch. |
5 | // RUN: %clang_cc1 -emit-pch -o %t %S/functions.h |
6 | // RUN: %clang_cc1 -include-pch %t -fsyntax-only -verify %s |
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}} |
15 | // expected-note@functions.h:7{{'f1' declared here}} |
16 | } |
17 | |
18 | void test_g0(int *x, float * y) { |
19 | g0(y); // expected-warning{{incompatible pointer types passing 'float *' to parameter of type 'int *'}} |
20 | // expected-note@functions.h:9{{passing argument to parameter here}} |
21 | g0(x); |
22 | } |
23 | |
24 | void __attribute__((noreturn)) test_abort(int code) { |
25 | do_abort(code); |
26 | } |
27 | |
28 | |