From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- clang/test/Index/warning-flags.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 clang/test/Index/warning-flags.c (limited to 'clang/test/Index/warning-flags.c') diff --git a/clang/test/Index/warning-flags.c b/clang/test/Index/warning-flags.c new file mode 100644 index 0000000..b76662e --- /dev/null +++ b/clang/test/Index/warning-flags.c @@ -0,0 +1,16 @@ +int foo() { } +int *bar(float *f) { return f; } + +// RUN: c-index-test -test-load-source all %s 2>&1|FileCheck -check-prefix=CHECK-BOTH-WARNINGS %s +// RUN: c-index-test -test-load-source-reparse 5 all %s 2>&1|FileCheck -check-prefix=CHECK-BOTH-WARNINGS %s +// RUN: c-index-test -test-load-source all -Wno-return-type %s 2>&1|FileCheck -check-prefix=CHECK-SECOND-WARNING %s +// RUN: c-index-test -test-load-source-reparse 5 all -Wno-return-type %s 2>&1|FileCheck -check-prefix=CHECK-SECOND-WARNING %s +// RUN: c-index-test -test-load-source all -w %s 2>&1|not grep warning: +// RUN: c-index-test -test-load-source-reparse 5 all -w %s 2>&1|not grep warning: + +// CHECK-BOTH-WARNINGS: warning: control reaches end of non-void function +// CHECK-BOTH-WARNINGS: warning: incompatible pointer types returning 'float *' from a function with result type 'int *' + +// CHECK-SECOND-WARNING-NOT:control reaches end of non-void +// CHECK-SECOND-WARNING: warning: incompatible pointer types returning 'float *' from a function with result type 'int *' + -- cgit v1.2.3