diff options
author | Jordan Rose <jordan_rose@apple.com> | 2013-08-19 17:03:12 +0000 |
---|---|---|
committer | Jordan Rose <jordan_rose@apple.com> | 2013-08-19 17:03:12 +0000 |
commit | 95cdf9d603802ef9ca66ac57ee49b75bd182fd38 (patch) | |
tree | 3dd69e19f2e9345a3cf81599ddf5d342edd8f6ff /clang/test/Analysis/unreachable-code-path.c | |
parent | 23b2f755ce56cc167f3aa48db7628f360a1c5142 (diff) | |
download | bcm5719-llvm-95cdf9d603802ef9ca66ac57ee49b75bd182fd38.tar.gz bcm5719-llvm-95cdf9d603802ef9ca66ac57ee49b75bd182fd38.zip |
[analyzer] Don't run unreachable code checker on inlined functions.
This is still an alpha checker, but we use it in certain tests to make sure
something is not being executed.
This should fix the buildbots.
llvm-svn: 188682
Diffstat (limited to 'clang/test/Analysis/unreachable-code-path.c')
-rw-r--r-- | clang/test/Analysis/unreachable-code-path.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/clang/test/Analysis/unreachable-code-path.c b/clang/test/Analysis/unreachable-code-path.c index 61a4fd490e9..08019d9cbe3 100644 --- a/clang/test/Analysis/unreachable-code-path.c +++ b/clang/test/Analysis/unreachable-code-path.c @@ -139,3 +139,22 @@ void test11(enum foobar fb) { error(); // expected-warning {{never executed}} } } + +void inlined(int condition) { + if (condition) { + foo(5); // no-warning + } else { + foo(6); + } +} + +void testInlined() { + extern int coin(); + int cond = coin(); + if (!cond) { + inlined(0); + if (cond) { + foo(5); // expected-warning {{never executed}} + } + } +} |