Add test case for PR 9774, which got fixed along the way.

llvm-svn: 147479
This commit is contained in:
Ted Kremenek 2012-01-03 21:02:04 +00:00
parent 228f5b4ba3
commit b74c909b3c
1 changed files with 6 additions and 0 deletions

View File

@ -125,4 +125,10 @@ void test_assert() {
return; // no-warning
}
// Test case for PR 9774. Tests that dead code in macros aren't warned about.
#define MY_MAX(a,b) ((a) >= (b) ? (a) : (b))
void PR9774(int *s) {
for (int i = 0; i < MY_MAX(2, 3); i++) // no-warning
s[i] = 0;
}