summaryrefslogtreecommitdiff
path: root/test/Analysis/unified-sources/source1.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/Analysis/unified-sources/source1.cpp')
-rw-r--r--test/Analysis/unified-sources/source1.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/Analysis/unified-sources/source1.cpp b/test/Analysis/unified-sources/source1.cpp
new file mode 100644
index 000000000000..886afed8d417
--- /dev/null
+++ b/test/Analysis/unified-sources/source1.cpp
@@ -0,0 +1,15 @@
+// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
+
+// This test tests that the warning is here when it is included from
+// the unified sources file. The run-line in this file is there
+// only to suppress LIT warning for the complete lack of run-line.
+int foo(int x) {
+ if (x) {}
+ return 1 / x; // expected-warning{{}}
+}
+
+// Let's see if the container inlining heuristic still works.
+#include "container.h"
+int testContainerMethodInHeaderFile(ContainerInHeaderFile Cont) {
+ return 1 / Cont.method(); // no-warning
+}