[cfe-commits] r82842 - /cfe/trunk/test/Sema/return-noreturn.c

Ted Kremenek kremenek at apple.com
Fri Sep 25 20:54:10 PDT 2009


Author: kremenek
Date: Fri Sep 25 22:54:06 2009
New Revision: 82842

URL: http://llvm.org/viewvc/llvm-project?rev=82842&view=rev
Log:
Add a "positive" matching test case for attribute 'noreturn' that involves a nested infinite loop.

Modified:
    cfe/trunk/test/Sema/return-noreturn.c

Modified: cfe/trunk/test/Sema/return-noreturn.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/return-noreturn.c?rev=82842&r1=82841&r2=82842&view=diff

==============================================================================
--- cfe/trunk/test/Sema/return-noreturn.c (original)
+++ cfe/trunk/test/Sema/return-noreturn.c Fri Sep 25 22:54:06 2009
@@ -11,6 +11,12 @@
   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();





More information about the cfe-commits mailing list