annotate clang/test/Sema/warn-unused-parameters.c @ 207:2e18cbf3894f

LLVM12
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 08 Jun 2021 06:07:14 +0900
parents 0572611fdcc8
children c4bab56944e8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang_cc1 -fblocks -fsyntax-only -Wunused-parameter %s 2>&1 | FileCheck %s
anatofuz
parents:
diff changeset
2 // RUN: %clang_cc1 -fblocks -fsyntax-only -Wunused %s 2>&1 | FileCheck -check-prefix=CHECK-unused %s
anatofuz
parents:
diff changeset
3
anatofuz
parents:
diff changeset
4 int f0(int x,
anatofuz
parents:
diff changeset
5 int y,
anatofuz
parents:
diff changeset
6 int z __attribute__((unused))) {
anatofuz
parents:
diff changeset
7 return x;
anatofuz
parents:
diff changeset
8 }
anatofuz
parents:
diff changeset
9
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
10 void f1(void) {
150
anatofuz
parents:
diff changeset
11 (void)^(int x,
anatofuz
parents:
diff changeset
12 int y,
anatofuz
parents:
diff changeset
13 int z __attribute__((unused))) { return x; };
anatofuz
parents:
diff changeset
14 }
anatofuz
parents:
diff changeset
15
anatofuz
parents:
diff changeset
16 // Used when testing '-Wunused' to see that we only emit one diagnostic, and no
anatofuz
parents:
diff changeset
17 // warnings for the above cases.
anatofuz
parents:
diff changeset
18 static void achor() {};
anatofuz
parents:
diff changeset
19
anatofuz
parents:
diff changeset
20 // CHECK: 5:12: warning: unused parameter 'y'
anatofuz
parents:
diff changeset
21 // CHECK: 12:15: warning: unused parameter 'y'
anatofuz
parents:
diff changeset
22 // CHECK-unused: 1 warning generated
anatofuz
parents:
diff changeset
23
anatofuz
parents:
diff changeset
24 // RUN: %clang_cc1 -fblocks -fsyntax-only -Weverything %s 2>&1 | FileCheck -check-prefix=CHECK-everything %s
anatofuz
parents:
diff changeset
25 // RUN: not %clang_cc1 -fblocks -fsyntax-only -Weverything -Werror %s 2>&1 | FileCheck -check-prefix=CHECK-everything-error %s
anatofuz
parents:
diff changeset
26 // RUN: %clang_cc1 -fblocks -fsyntax-only -Weverything -Wno-unused %s 2>&1 | FileCheck -check-prefix=CHECK-everything-no-unused %s
anatofuz
parents:
diff changeset
27 // CHECK-everything: 6 warnings generated
anatofuz
parents:
diff changeset
28 // CHECK-everything-error: 5 errors generated
anatofuz
parents:
diff changeset
29 // CHECK-everything-no-unused: 5 warnings generated
anatofuz
parents:
diff changeset
30