File: invalid-checker-option.c

package info (click to toggle)
llvm-toolchain-13 1%3A13.0.1-11
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,418,840 kB
  • sloc: cpp: 5,290,826; ansic: 996,570; asm: 544,593; python: 188,212; objc: 72,027; lisp: 30,291; f90: 25,395; sh: 24,898; javascript: 9,780; pascal: 9,398; perl: 7,484; ml: 5,432; awk: 3,523; makefile: 2,913; xml: 953; cs: 573; fortran: 539
file content (97 lines) | stat: -rw-r--r-- 3,938 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
// RUN: not %clang_analyze_cc1 -verify %s \
// RUN:   -analyzer-checker=core \
// RUN:   -analyzer-config RetainOneTwoThree:CheckOSObject=false \
// RUN:   2>&1 | FileCheck %s -check-prefix=CHECK-NON-EXISTENT-CHECKER

// Note that non-existent packages and checkers were always reported.

// RUN: not %clang_analyze_cc1 -verify %s \
// RUN:   -analyzer-checker=core \
// RUN:   -analyzer-config-compatibility-mode=true \
// RUN:   -analyzer-config RetainOneTwoThree:CheckOSObject=false \
// RUN:   2>&1 | FileCheck %s -check-prefix=CHECK-NON-EXISTENT-CHECKER

// CHECK-NON-EXISTENT-CHECKER: (frontend): no analyzer checkers or packages
// CHECK-NON-EXISTENT-CHECKER-SAME: are associated with 'RetainOneTwoThree'


// RUN: %clang_analyze_cc1 -verify %s \
// RUN:   -analyzer-checker=core \
// RUN:   -analyzer-checker=debug.ConfigDumper \
// RUN:   -analyzer-checker=debug.AnalysisOrder \
// RUN:   -analyzer-config-compatibility-mode=true \
// RUN:   -analyzer-config debug.AnalysisOrder:*=yesplease \
// RUN:   2>&1 | FileCheck %s -check-prefix=CHECK-CORRECTED-BOOL-VALUE

// CHECK-CORRECTED-BOOL-VALUE: debug.AnalysisOrder:* = false
//
// RUN: %clang_analyze_cc1 -verify %s \
// RUN:   -analyzer-checker=core \
// RUN:   -analyzer-checker=debug.ConfigDumper \
// RUN:   -analyzer-checker=optin.performance.Padding \
// RUN:   -analyzer-config-compatibility-mode=true \
// RUN:   -analyzer-config optin.performance.Padding:AllowedPad=surpriseme \
// RUN:   2>&1 | FileCheck %s -check-prefix=CHECK-CORRECTED-INT-VALUE

// CHECK-CORRECTED-INT-VALUE: optin.performance.Padding:AllowedPad = 24


// Every other error should be avoidable in compatiblity mode.


// RUN: not %clang_analyze_cc1 -verify %s \
// RUN:   -analyzer-checker=core \
// RUN:   -analyzer-config debug.AnalysisOrder:Everything=false \
// RUN:   2>&1 | FileCheck %s -check-prefix=CHECK-NON-EXISTENT-CHECKER-OPTION

// CHECK-NON-EXISTENT-CHECKER-OPTION: (frontend): checker 'debug.AnalysisOrder'
// CHECK-NON-EXISTENT-CHECKER-OPTION-SAME: has no option called 'Everything'

// RUN: %clang_analyze_cc1 -verify %s \
// RUN:   -analyzer-checker=core \
// RUN:   -analyzer-config-compatibility-mode=true \
// RUN:   -analyzer-config debug.AnalysisOrder:Everything=false


// RUN: not %clang_analyze_cc1 -verify %s \
// RUN:   -analyzer-checker=core \
// RUN:   -analyzer-config debug.AnalysisOrder:*=nothankyou \
// RUN:   2>&1 | FileCheck %s -check-prefix=CHECK-INVALID-BOOL-VALUE

// CHECK-INVALID-BOOL-VALUE: (frontend): invalid input for checker option
// CHECK-INVALID-BOOL-VALUE-SAME: 'debug.AnalysisOrder:*', that expects a
// CHECK-INVALID-BOOL-VALUE-SAME: boolean value

// RUN: %clang_analyze_cc1 -verify %s \
// RUN:   -analyzer-checker=core \
// RUN:   -analyzer-config-compatibility-mode=true \
// RUN:   -analyzer-config debug.AnalysisOrder:*=nothankyou


// RUN: not %clang_analyze_cc1 -verify %s \
// RUN:   -analyzer-checker=core \
// RUN:   -analyzer-config optin.performance.Padding:AllowedPad=surpriseme \
// RUN:   2>&1 | FileCheck %s -check-prefix=CHECK-INVALID-INT-VALUE

// CHECK-INVALID-INT-VALUE: (frontend): invalid input for checker option
// CHECK-INVALID-INT-VALUE-SAME: 'optin.performance.Padding:AllowedPad', that
// CHECK-INVALID-INT-VALUE-SAME: expects an integer value

// RUN: %clang_analyze_cc1 -verify %s \
// RUN:   -analyzer-checker=core \
// RUN:   -analyzer-config-compatibility-mode=true \
// RUN:   -analyzer-config optin.performance.Padding:AllowedPad=surpriseme


// RUN: not %clang_analyze_cc1 -verify %s \
// RUN:   -analyzer-checker=core \
// RUN:   -analyzer-config nullability:NoDiagnoseCallsToSystemHeaders=sure \
// RUN:   2>&1 | FileCheck %s -check-prefix=CHECK-PACKAGE-VALUE

// CHECK-PACKAGE-VALUE: (frontend): invalid input for checker option
// CHECK-PACKAGE-VALUE-SAME: 'nullability:NoDiagnoseCallsToSystemHeaders', that
// CHECK-PACKAGE-VALUE-SAME: expects a boolean value

// expected-no-diagnostics

int main() {}