xref: /minix3/external/bsd/llvm/dist/clang/test/Index/warning-flags.c (revision 0b98e8aad89f2bd4ba80b523d73cf29e9dd82ce1)
1 int foo() { }
2 int *bar(float *f) { return f; }
3 
4 // RUN: c-index-test -test-load-source all %s 2>&1|FileCheck -check-prefix=CHECK-BOTH-WARNINGS %s
5 // RUN: c-index-test -test-load-source-reparse 5 all %s 2>&1|FileCheck -check-prefix=CHECK-BOTH-WARNINGS %s
6 // RUN: c-index-test -test-load-source all -Wno-return-type  %s 2>&1|FileCheck -check-prefix=CHECK-SECOND-WARNING %s
7 // RUN: c-index-test -test-load-source-reparse 5 all -Wno-return-type %s 2>&1|FileCheck -check-prefix=CHECK-SECOND-WARNING %s
8 // RUN: c-index-test -test-load-source all -w %s 2>&1|not grep warning:
9 // RUN: c-index-test -test-load-source-reparse 5 all -w %s 2>&1|not grep warning:
10 
11 // CHECK-BOTH-WARNINGS: warning: control reaches end of non-void function
12 // CHECK-BOTH-WARNINGS: warning: incompatible pointer types returning 'float *' from a function with result type 'int *'
13 
14 // CHECK-SECOND-WARNING-NOT:control reaches end of non-void
15 // CHECK-SECOND-WARNING: warning: incompatible pointer types returning 'float *' from a function with result type 'int *'
16 
17