xref: /llvm-project/clang/test/Analysis/unified-sources/source1.cpp (revision 516837f2a1585d4a2a620162cc996ca763046e7d)
1 // 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.
foo(int x)6 int foo(int x) {
7   if (x) {}
8   return 1 / x; // expected-warning{{}}
9 }
10 
11 // Let's see if the container inlining heuristic still works.
12 #include "container.h"
testContainerMethodInHeaderFile(ContainerInHeaderFile Cont)13 int testContainerMethodInHeaderFile(ContainerInHeaderFile Cont) {
14   return 1 / Cont.method(); // no-warning
15 }
16