diff options
| author | Ted Kremenek <kremenek@apple.com> | 2012-09-06 22:32:48 +0000 |
|---|---|---|
| committer | Ted Kremenek <kremenek@apple.com> | 2012-09-06 22:32:48 +0000 |
| commit | cadd9f186a4a2c6dfc510ce011b0ee59270abdce (patch) | |
| tree | 44822db5aa3b3b64aaccd4014c7084eae3b41ac5 /clang/test | |
| parent | c30a73adf671532c21b573a9009f20ca15e6180d (diff) | |
| download | bcm5719-llvm-cadd9f186a4a2c6dfc510ce011b0ee59270abdce.tar.gz bcm5719-llvm-cadd9f186a4a2c6dfc510ce011b0ee59270abdce.zip | |
Tweak DeadStoresChecker to not warn about dead stores to variables that
are used in EH code. Right now the CFG doesn't support exceptions well,
so we need this hack to avoid bogus dead store warnings.
Fixes <rdar://problem/12147586>
llvm-svn: 163353
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/Analysis/dead-stores.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/test/Analysis/dead-stores.cpp b/clang/test/Analysis/dead-stores.cpp index 67bc8b5a232..341363afaa8 100644 --- a/clang/test/Analysis/dead-stores.cpp +++ b/clang/test/Analysis/dead-stores.cpp @@ -109,3 +109,20 @@ namespace foo { } } +//===----------------------------------------------------------------------===// +// Dead stores in with EH code. +//===----------------------------------------------------------------------===// + +void test_5_Aux(); +int test_5() { + int x = 0; + try { + x = 2; // no-warning + test_5_Aux(); + } + catch (int z) { + return x + z; + } + return 1; +} + |

