blob: cd85e3522343f6da9a81ac9f1aad49633b1ee901 [file] [log] [blame]
Artem Dergachev516837f2018-04-25 21:51:26 +00001// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
2
3// This test tests that the warning is here when it is included from
4// the unified sources file. The run-line in this file is there
5// only to suppress LIT warning for the complete lack of run-line.
6int testNullDereference() {
7 int *x = 0;
8 return *x; // expected-warning{{}}
9}
10
11// Let's see if the container inlining heuristic still works.
12class ContainerInCodeFile {
13 class Iterator {
14 };
15
16public:
17 Iterator begin() const;
18 Iterator end() const;
19
20 int method() { return 0; }
21};
22
23int testContainerMethodInCodeFile(ContainerInCodeFile Cont) {
24 return 1 / Cont.method(); // expected-warning{{}}
25}