blob: e47ddd5e00d515554583ffc3f2d7648ab05ad125 [file] [log] [blame]
Ted Kremenek355fa3a2010-04-08 23:17:16 +00001// 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 Gregore0762c92009-06-19 23:52:42 +00003
4int f0(int x,
Ted Kremenekb4c0c2d2010-04-08 21:10:56 +00005 int y,
Douglas Gregore0762c92009-06-19 23:52:42 +00006 int z __attribute__((unused))) {
7 return x;
8}
9
10void f1() {
11 (void)^(int x,
Ted Kremenekb4c0c2d2010-04-08 21:10:56 +000012 int y,
Douglas Gregore0762c92009-06-19 23:52:42 +000013 int z __attribute__((unused))) { return x; };
Douglas Gregor6aed7662009-06-20 00:29:46 +000014}
Ted Kremenekb4c0c2d2010-04-08 21:10:56 +000015
16// Used when testing '-Wunused' to see that we only emit one diagnostic, and no
17// warnings for the above cases.
18static void achor() {};
19
20// CHECK: 5:12: warning: unused parameter 'y'
21// CHECK: 12:15: warning: unused parameter 'y'
22// CHECK-unused: 1 warning generated