diff options
| author | Tom Care <tcare@apple.com> | 2010-07-23 23:04:53 +0000 |
|---|---|---|
| committer | Tom Care <tcare@apple.com> | 2010-07-23 23:04:53 +0000 |
| commit | cba9f517acfb0d7c3438eed71cf0db6229cd9671 (patch) | |
| tree | d06d39031894e6c17d07be0cc3209bbd9fe89c25 /clang/test/Analysis/bstring.c | |
| parent | 28499f76c953a38bd8c8bcb634f25188bf02715f (diff) | |
| download | bcm5719-llvm-cba9f517acfb0d7c3438eed71cf0db6229cd9671.tar.gz bcm5719-llvm-cba9f517acfb0d7c3438eed71cf0db6229cd9671.zip | |
Added an path-sensitive unreachable code checker to the experimental analyzer checks.
- Created a new class to do post-analysis
- Updated several test cases with unreachable code to expect a warning
- Added some general tests
llvm-svn: 109286
Diffstat (limited to 'clang/test/Analysis/bstring.c')
| -rw-r--r-- | clang/test/Analysis/bstring.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/clang/test/Analysis/bstring.c b/clang/test/Analysis/bstring.c index f4ddb0a3d08..3a5dfab33df 100644 --- a/clang/test/Analysis/bstring.c +++ b/clang/test/Analysis/bstring.c @@ -53,7 +53,7 @@ void memcpy0 () { memcpy(dst, src, 4); // no-warning if (memcpy(dst, src, 4) != dst) { - (void)*(char*)0; // no-warning -- should be unreachable + (void)*(char*)0; // expected-warning{{never executed}} } } @@ -155,7 +155,7 @@ void memmove0 () { memmove(dst, src, 4); // no-warning if (memmove(dst, src, 4) != dst) { - (void)*(char*)0; // no-warning -- should be unreachable + (void)*(char*)0; // expected-warning{{never executed}} } } @@ -217,7 +217,7 @@ void memcmp3 () { char a[] = {1, 2, 3, 4}; if (memcmp(a, a, 4)) - (void)*(char*)0; // no-warning + (void)*(char*)0; // expected-warning{{never executed}} } void memcmp4 (char *input) { @@ -231,11 +231,11 @@ void memcmp5 (char *input) { char a[] = {1, 2, 3, 4}; if (memcmp(a, 0, 0)) // no-warning - (void)*(char*)0; // no-warning + (void)*(char*)0; // expected-warning{{never executed}} if (memcmp(0, a, 0)) // no-warning - (void)*(char*)0; // no-warning + (void)*(char*)0; // expected-warning{{never executed}} if (memcmp(a, input, 0)) // no-warning - (void)*(char*)0; // no-warning + (void)*(char*)0; // expected-warning{{never executed}} } void memcmp6 (char *a, char *b, size_t n) { |

