]> granicus.if.org Git - clang/commitdiff
Add a "positive" matching test case for attribute 'noreturn' that involves a nested...
authorTed Kremenek <kremenek@apple.com>
Sat, 26 Sep 2009 03:54:06 +0000 (03:54 +0000)
committerTed Kremenek <kremenek@apple.com>
Sat, 26 Sep 2009 03:54:06 +0000 (03:54 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82842 91177308-0d34-0410-b5e6-96231b3b80d8

test/Sema/return-noreturn.c

index 20df857d3bcd68627568651bde38e0e526ab7865..e2452f407f4fb4009af129b537288ea6129835ee 100644 (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();