diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-09-26 03:54:06 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-09-26 03:54:06 +0000 |
commit | e7c9645c002d2ff639f7d24f94ffe793795eabcc (patch) | |
tree | 207d3128ee20e849f8c3a60bb6681b95f665c3fe | |
parent | f679a986df5514bb42e001a5afd149f839ebed03 (diff) |
Add a "positive" matching test case for attribute 'noreturn' that involves a nested infinite loop.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82842 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | test/Sema/return-noreturn.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/Sema/return-noreturn.c b/test/Sema/return-noreturn.c index 20df857d3b..e2452f407f 100644 --- a/test/Sema/return-noreturn.c +++ b/test/Sema/return-noreturn.c @@ -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(); |