blob: fa2ba8d29c038e77be0ee6718e4e8a0ef1567c09 [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
Andy Gibbsb42f2002013-04-17 08:06:46 +00007
Douglas Gregor3a2f7e42009-04-13 22:18:37 +00008int f0(int x0, int y0, ...) { return x0 + y0; }
Andy Gibbsb42f2002013-04-17 08:06:46 +00009
Douglas Gregor3a2f7e42009-04-13 22:18:37 +000010float *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}}
Andy Gibbsb42f2002013-04-17 08:06:46 +000015 // expected-note@functions.h:7{{'f1' declared here}}
Douglas Gregor3a2f7e42009-04-13 22:18:37 +000016}
17
18void test_g0(int *x, float * y) {
Douglas Gregord4eea832010-04-09 00:35:39 +000019 g0(y); // expected-warning{{incompatible pointer types passing 'float *' to parameter of type 'int *'}}
Andy Gibbsb42f2002013-04-17 08:06:46 +000020 // expected-note@functions.h:9{{passing argument to parameter here}}
Douglas Gregor3a2f7e42009-04-13 22:18:37 +000021 g0(x);
22}
Douglas Gregor91236662009-12-22 18:11:50 +000023
24void __attribute__((noreturn)) test_abort(int code) {
25 do_abort(code);
26}
27