150
|
1 // Tests for static analyzer checkers that the driver enables by default based
|
|
2 // on the target triple.
|
|
3
|
|
4 // RUN: %clang -### -target x86_64-apple-darwin10 --analyze %s 2>&1 | FileCheck --check-prefix=CHECK-DARWIN %s
|
|
5
|
|
6 // CHECK-DARWIN: "-analyzer-checker=core"
|
|
7 // CHECK-DARWIN-SAME: "-analyzer-checker=apiModeling"
|
|
8 // CHECK-DARWIN-SAME: "-analyzer-checker=unix"
|
|
9 // CHECK-DARWIN-SAME: "-analyzer-checker=osx"
|
|
10 // CHECK-DARWIN-SAME: "-analyzer-checker=deadcode"
|
|
11 // CHECK-DARWIN-SAME: "-analyzer-checker=cplusplus"
|
|
12 // CHECK-DARWIN-SAME: "-analyzer-checker=security.insecureAPI.UncheckedReturn"
|
|
13 // CHECK-DARWIN-SAME: "-analyzer-checker=security.insecureAPI.getpw"
|
|
14 // CHECK-DARWIN-SAME: "-analyzer-checker=security.insecureAPI.gets"
|
|
15 // CHECK-DARWIN-SAME: "-analyzer-checker=security.insecureAPI.mktemp"
|
|
16 // CHECK-DARWIN-SAME: "-analyzer-checker=security.insecureAPI.mkstemp"
|
|
17 // CHECK-DARWIN-SAME: "-analyzer-checker=security.insecureAPI.vfork"
|
|
18 // CHECK-DARWIN-SAME: "-analyzer-checker=nullability.NullPassedToNonnull"
|
|
19 // CHECK-DARWIN-SAME: "-analyzer-checker=nullability.NullReturnedFromNonnull"
|
|
20
|
|
21
|
|
22 // RUN: %clang -### -target x86_64-unknown-linux --analyze %s 2>&1 | FileCheck --check-prefix=CHECK-LINUX %s
|
|
23
|
|
24 // CHECK-LINUX: "-analyzer-checker=core"
|
|
25 // CHECK-LINUX-SAME: "-analyzer-checker=apiModeling"
|
|
26 // CHECK-LINUX-SAME: "-analyzer-checker=unix"
|
|
27 // CHECK-LINUX-NOT: "-analyzer-checker=osx"
|
|
28 // CHECK-LINUX-SAME: "-analyzer-checker=deadcode"
|
|
29 // CHECK-LINUX-SAME: "-analyzer-checker=cplusplus"
|
|
30 // CHECK-LINUX-SAME: "-analyzer-checker=security.insecureAPI.UncheckedReturn"
|
|
31 // CHECK-LINUX-SAME: "-analyzer-checker=security.insecureAPI.getpw"
|
|
32 // CHECK-LINUX-SAME: "-analyzer-checker=security.insecureAPI.gets"
|
|
33 // CHECK-LINUX-SAME: "-analyzer-checker=security.insecureAPI.mktemp"
|
|
34 // CHECK-LINUX-SAME: "-analyzer-checker=security.insecureAPI.mkstemp"
|
|
35 // CHECK-LINUX-SAME: "-analyzer-checker=security.insecureAPI.vfork"
|
|
36 // CHECK-LINUX-SAME: "-analyzer-checker=nullability.NullPassedToNonnull"
|
|
37 // CHECK-LINUX-SAME: "-analyzer-checker=nullability.NullReturnedFromNonnull"
|
|
38
|
|
39
|
|
40 // RUN: %clang -### -target x86_64-windows --analyze %s 2>&1 | FileCheck --check-prefix=CHECK-WINDOWS %s
|
|
41
|
|
42 // CHECK-WINDOWS: "-analyzer-checker=core"
|
|
43 // CHECK-WINDOWS-SAME: "-analyzer-checker=apiModeling"
|
|
44 // CHECK-WINDOWS-SAME: "-analyzer-checker=unix.API"
|
|
45 // CHECK-WINDOWS-SAME: "-analyzer-checker=unix.Malloc"
|
|
46 // CHECK-WINDOWS-SAME: "-analyzer-checker=unix.MallocSizeof"
|
|
47 // CHECK-WINDOWS-SAME: "-analyzer-checker=unix.MismatchedDeallocator"
|
|
48 // CHECK-WINDOWS-SAME: "-analyzer-checker=unix.cstring.BadSizeArg"
|
|
49 // CHECK-WINDOWS-SAME: "-analyzer-checker=unix.cstring.NullArg"
|
|
50 // CHECK-WINDOWS-NOT: "-analyzer-checker=osx"
|
|
51 // CHECK-WINDOWS-SAME: "-analyzer-checker=deadcode"
|
|
52 // CHECK-WINDOWS-SAME: "-analyzer-checker=cplusplus"
|
|
53 // CHECK-WINDOWS-SAME: "-analyzer-checker=security.insecureAPI.UncheckedReturn"
|
|
54 // CHECK-WINDOWS-SAME: "-analyzer-checker=security.insecureAPI.getpw"
|
|
55 // CHECK-WINDOWS-SAME: "-analyzer-checker=security.insecureAPI.gets"
|
|
56 // CHECK-WINDOWS-SAME: "-analyzer-checker=security.insecureAPI.mktemp"
|
|
57 // CHECK-WINDOWS-SAME: "-analyzer-checker=security.insecureAPI.mkstemp"
|
|
58 // CHECK-WINDOWS-SAME: "-analyzer-checker=security.insecureAPI.vfork"
|
|
59 // CHECK-WINDOWS-SAME: "-analyzer-checker=nullability.NullPassedToNonnull"
|
|
60 // CHECK-WINDOWS-SAME: "-analyzer-checker=nullability.NullReturnedFromNonnull"
|