annotate clang/test/Analysis/unified-sources/source1.cpp @ 222:81f6424ef0e3 llvm-original

LLVM original branch
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 18 Jul 2021 22:10:01 +0900
parents 1d019706d866
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang_analyze_cc1 -analyzer-checker=core -verify %s
anatofuz
parents:
diff changeset
2
anatofuz
parents:
diff changeset
3 // This test tests that the warning is here when it is included from
anatofuz
parents:
diff changeset
4 // the unified sources file. The run-line in this file is there
anatofuz
parents:
diff changeset
5 // only to suppress LIT warning for the complete lack of run-line.
anatofuz
parents:
diff changeset
6 int foo(int x) {
anatofuz
parents:
diff changeset
7 if (x) {}
anatofuz
parents:
diff changeset
8 return 1 / x; // expected-warning{{}}
anatofuz
parents:
diff changeset
9 }
anatofuz
parents:
diff changeset
10
anatofuz
parents:
diff changeset
11 // Let's see if the container inlining heuristic still works.
anatofuz
parents:
diff changeset
12 #include "container.h"
anatofuz
parents:
diff changeset
13 int testContainerMethodInHeaderFile(ContainerInHeaderFile Cont) {
anatofuz
parents:
diff changeset
14 return 1 / Cont.method(); // no-warning
anatofuz
parents:
diff changeset
15 }