diff options
Diffstat (limited to 'test/Sema/warn-unused-parameters.c')
-rw-r--r-- | test/Sema/warn-unused-parameters.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/test/Sema/warn-unused-parameters.c b/test/Sema/warn-unused-parameters.c index c6458cf..e47ddd5 100644 --- a/test/Sema/warn-unused-parameters.c +++ b/test/Sema/warn-unused-parameters.c @@ -1,13 +1,22 @@ -// RUN: %clang -fblocks -fsyntax-only -Wunused-parameter %s -Xclang -verify +// RUN: %clang_cc1 -fblocks -fsyntax-only -Wunused-parameter %s 2>&1 | FileCheck %s +// RUN: %clang_cc1 -fblocks -fsyntax-only -Wunused %s 2>&1 | FileCheck -check-prefix=CHECK-unused %s int f0(int x, - int y, // expected-warning{{unused}} + int y, int z __attribute__((unused))) { return x; } void f1() { (void)^(int x, - int y, // expected-warning{{unused}} + int y, int z __attribute__((unused))) { return x; }; } + +// Used when testing '-Wunused' to see that we only emit one diagnostic, and no +// warnings for the above cases. +static void achor() {}; + +// CHECK: 5:12: warning: unused parameter 'y' +// CHECK: 12:15: warning: unused parameter 'y' +// CHECK-unused: 1 warning generated
\ No newline at end of file |