blob: 35e39210585b64f8eeb50e0b5135d8dec1307e3f [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
Peter Collingbourne9aab1482011-07-29 00:24:42 +00007// expected-note{{'f1' declared here}}
Douglas Gregor3a2f7e42009-04-13 22:18:37 +00008int f0(int x0, int y0, ...) { return x0 + y0; }
Douglas Gregora41a8c52010-04-22 00:20:18 +00009// expected-note{{passing argument to parameter here}}
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}}
Douglas Gregor3a2f7e42009-04-13 22:18:37 +000015}
16
17void test_g0(int *x, float * y) {
Douglas Gregord4eea832010-04-09 00:35:39 +000018 g0(y); // expected-warning{{incompatible pointer types passing 'float *' to parameter of type 'int *'}}
Douglas Gregor3a2f7e42009-04-13 22:18:37 +000019 g0(x);
20}
Douglas Gregor91236662009-12-22 18:11:50 +000021
22void __attribute__((noreturn)) test_abort(int code) {
23 do_abort(code);
24}
25