Add a "positive" matching test case for attribute 'noreturn' that involves a nested infinite loop.

llvm-svn: 82842
This commit is contained in:
Ted Kremenek 2009-09-26 03:54:06 +00:00
parent 9fa2eefa4c
commit 7226af69cb
1 changed files with 6 additions and 0 deletions

View File

@ -11,6 +11,12 @@ void test2() {
if (j) while (1) { }
}
__attribute__((__noreturn__))
void test2_positive() {
if (j) while (1) { }
} // expected-warning{{function declared 'noreturn' should not return}}
// This test case illustrates that we don't warn about the missing return
// because the function is marked noreturn and there is an infinite loop.
extern int foo_test_3();