[clang-cl] Ignore /Wv and /Wv:17 flags
[llvm-project.git] / clang / test / Analysis / analyze-function-guide.cpp
blob96f1001057eb6eb8e7cf93e3a002526c0bc7c897
1 int fizzbuzz(int x, bool y) {
2 return x + y;
5 // C++ but not uses parentheses in the '-analyze-function' option.
6 //
7 // RUN: %clang_analyze_cc1 -analyzer-checker=core \
8 // RUN: -analyze-function='missing_fn' -x c++ \
9 // RUN: -triple x86_64-pc-linux-gnu 2>&1 %s \
10 // RUN: | FileCheck %s -check-prefix=CHECK-CXX
12 // CHECK-CXX: Every top-level function was skipped.
13 // CHECK-CXX-NEXT: Pass the -analyzer-display-progress for tracking which functions are analyzed.
14 // CHECK-CXX-NEXT: For analyzing C++ code you need to pass the function parameter list: -analyze-function="foobar(int, _Bool)"
16 // C but uses parentheses in the '-analyze-function' option.
18 // RUN: %clang_analyze_cc1 -analyzer-checker=core \
19 // RUN: -analyze-function='missing_fn()' -x c -Dbool=_Bool \
20 // RUN: -triple x86_64-pc-linux-gnu 2>&1 %s \
21 // RUN: | FileCheck %s -check-prefix=CHECK-C
23 // CHECK-C: Every top-level function was skipped.
24 // CHECK-C-NEXT: Pass the -analyzer-display-progress for tracking which functions are analyzed.
25 // CHECK-C-NEXT: For analyzing C code you shouldn't pass the function parameter list, only the name of the function: -analyze-function=foobar
27 // The user passed the '-analyzer-display-progress' option, we don't need to advocate it.
29 // RUN: %clang_analyze_cc1 -analyzer-checker=core \
30 // RUN: -analyze-function=missing_fn \
31 // RUN: -analyzer-display-progress -x c -Dbool=_Bool \
32 // RUN: -triple x86_64-pc-linux-gnu 2>&1 %s \
33 // RUN: | FileCheck %s -check-prefix=CHECK-DONT-ADVOCATE-DISPLAY-PROGRESS
35 // CHECK-DONT-ADVOCATE-DISPLAY-PROGRESS: Every top-level function was skipped.
36 // CHECK-DONT-ADVOCATE-DISPLAY-PROGRESS-NOT: Pass the -analyzer-display-progress
38 // The user passed the '-analyze-function' option but that doesn't mach to any declaration.
40 // RUN: %clang_analyze_cc1 -analyzer-checker=core \
41 // RUN: -analyze-function='missing_fn()' -x c++ \
42 // RUN: -triple x86_64-pc-linux-gnu 2>&1 %s \
43 // RUN: | FileCheck %s -check-prefix=CHECK-ADVOCATE-DISPLAY-PROGRESS
45 // CHECK-ADVOCATE-DISPLAY-PROGRESS: Every top-level function was skipped.
46 // CHECK-ADVOCATE-DISPLAY-PROGRESS-NEXT: Pass the -analyzer-display-progress for tracking which functions are analyzed.
47 // CHECK-ADVOCATE-DISPLAY-PROGRESS-NOT: For analyzing
49 // Same as the previous but syntax mode only.
50 // FIXME: This should have empty standard output.
52 // RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-config ipa=none \
53 // RUN: -analyze-function='fizzbuzz(int, _Bool)' -x c++ \
54 // RUN: -triple x86_64-pc-linux-gnu 2>&1 %s \
55 // RUN: | FileCheck %s -check-prefix=CHECK-EMPTY3 --allow-empty
57 // FIXME: This should have empty standard output.
58 // CHECK-EMPTY3: Every top-level function was skipped.
59 // CHECK-EMPTY3-NEXT: Pass the -analyzer-display-progress for tracking which functions are analyzed.