1 // RUN: clang-tidy %s -checks='-*,llvm-namespace-comment,clang-diagnostic*' \
2 // RUN: -- -Wunused-variable 2>&1 \
3 // RUN: | FileCheck %s --check-prefix=CHECK-WARN -implicit-check-not='{{warning|error}}:'
4 // RUN: not clang-tidy %s -checks='-*,llvm-namespace-comment,clang-diagnostic*' \
5 // RUN: -warnings-as-errors='clang-diagnostic*' -- -Wunused-variable 2>&1 \
6 // RUN: | FileCheck %s --check-prefix=CHECK-WERR -implicit-check-not='{{warning|error}}:'
7 // RUN: not clang-tidy %s -checks='-*,llvm-namespace-comment,clang-diagnostic*' \
8 // RUN: -warnings-as-errors='clang-diagnostic*' -quiet -- -Wunused-variable 2>&1 \
9 // RUN: | FileCheck %s --check-prefix=CHECK-WERR-QUIET -implicit-check-not='{{warning|error}}:'
10
f()11 void f() { int i; }
12 // CHECK-WARN: warning: unused variable 'i' [clang-diagnostic-unused-variable]
13 // CHECK-WERR: error: unused variable 'i' [clang-diagnostic-unused-variable,-warnings-as-errors]
14 // CHECK-WERR-QUIET: error: unused variable 'i' [clang-diagnostic-unused-variable,-warnings-as-errors]
15
16 // CHECK-WARN-NOT: treated as
17 // CHECK-WERR: 1 warning treated as error
18 // CHECK-WERR-QUIET-NOT: treated as
19