functions.c 819 B

123456789101112131415161718192021222324252627
  1. // Test this without pch.
  2. // RUN: %clang_cc1 -include %S/functions.h -fsyntax-only -verify %s
  3. // Test with pch.
  4. // RUN: %clang_cc1 -emit-pch -o %t %S/functions.h
  5. // RUN: %clang_cc1 -include-pch %t -fsyntax-only -verify %s
  6. int f0(int x0, int y0, ...) { return x0 + y0; }
  7. float *test_f1(int val, double x, double y) {
  8. if (val > 5)
  9. return f1(x, y);
  10. else
  11. return f1(x); // expected-error{{too few arguments to function call}}
  12. // [email protected]:7{{'f1' declared here}}
  13. }
  14. void test_g0(int *x, float * y) {
  15. g0(y); // expected-warning{{incompatible pointer types passing 'float *' to parameter of type 'int *'}}
  16. // [email protected]:9{{passing argument to parameter here}}
  17. g0(x);
  18. }
  19. void __attribute__((noreturn)) test_abort(int code) {
  20. do_abort(code);
  21. }