Ted Kremenek | 355fa3a | 2010-04-08 23:17:16 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fblocks -fsyntax-only -Wunused-parameter %s 2>&1 | FileCheck %s |
| 2 | // RUN: %clang_cc1 -fblocks -fsyntax-only -Wunused %s 2>&1 | FileCheck -check-prefix=CHECK-unused %s |
Douglas Gregor | e0762c9 | 2009-06-19 23:52:42 +0000 | [diff] [blame] | 3 | |
| 4 | int f0(int x, |
Ted Kremenek | b4c0c2d | 2010-04-08 21:10:56 +0000 | [diff] [blame] | 5 | int y, |
Douglas Gregor | e0762c9 | 2009-06-19 23:52:42 +0000 | [diff] [blame] | 6 | int z __attribute__((unused))) { |
| 7 | return x; |
| 8 | } |
| 9 | |
| 10 | void f1() { |
| 11 | (void)^(int x, |
Ted Kremenek | b4c0c2d | 2010-04-08 21:10:56 +0000 | [diff] [blame] | 12 | int y, |
Douglas Gregor | e0762c9 | 2009-06-19 23:52:42 +0000 | [diff] [blame] | 13 | int z __attribute__((unused))) { return x; }; |
Douglas Gregor | 6aed766 | 2009-06-20 00:29:46 +0000 | [diff] [blame] | 14 | } |
Ted Kremenek | b4c0c2d | 2010-04-08 21:10:56 +0000 | [diff] [blame] | 15 | |
| 16 | // Used when testing '-Wunused' to see that we only emit one diagnostic, and no |
| 17 | // warnings for the above cases. |
| 18 | static void achor() {}; |
| 19 | |
| 20 | // CHECK: 5:12: warning: unused parameter 'y' |
| 21 | // CHECK: 12:15: warning: unused parameter 'y' |
Ted Kremenek | 1e473cc | 2011-08-18 01:12:56 +0000 | [diff] [blame] | 22 | // CHECK-unused: 1 warning generated |
| 23 | |
| 24 | // RUN: %clang_cc1 -fblocks -fsyntax-only -Weverything %s 2>&1 | FileCheck -check-prefix=CHECK-everything %s |
| 25 | // RUN: %clang_cc1 -fblocks -fsyntax-only -Weverything -Werror %s 2>&1 | FileCheck -check-prefix=CHECK-everything-error %s |
| 26 | // RUN: %clang_cc1 -fblocks -fsyntax-only -Weverything -Wno-unused %s 2>&1 | FileCheck -check-prefix=CHECK-everything-no-unused %s |
| 27 | // CHECK-everything: 6 warnings generated |
| 28 | // CHECK-everything-error: 5 errors generated |
| 29 | // CHECK-everything-no-unused: 5 warnings generated |
| 30 | |