[cfe-commits] r124239 - in /cfe/trunk/test/SemaCXX: return-noreturn-XFAIL.cpp return-noreturn.cpp warn-missing-noreturn.cpp

Ted Kremenek kremenek at apple.com
Tue Jan 25 14:57:41 PST 2011


Author: kremenek
Date: Tue Jan 25 16:57:41 2011
New Revision: 124239

URL: http://llvm.org/viewvc/llvm-project?rev=124239&view=rev
Log:
Tweak return-noreturn.cpp test to have its original
contents, with the additional warning flag (and still marked XFAIL).

Removed:
    cfe/trunk/test/SemaCXX/return-noreturn-XFAIL.cpp
Modified:
    cfe/trunk/test/SemaCXX/return-noreturn.cpp
    cfe/trunk/test/SemaCXX/warn-missing-noreturn.cpp

Removed: cfe/trunk/test/SemaCXX/return-noreturn-XFAIL.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/return-noreturn-XFAIL.cpp?rev=124238&view=auto
==============================================================================
--- cfe/trunk/test/SemaCXX/return-noreturn-XFAIL.cpp (original)
+++ cfe/trunk/test/SemaCXX/return-noreturn-XFAIL.cpp (removed)
@@ -1,18 +0,0 @@
-// RUN: %clang_cc1 %s -fsyntax-only -verify -Wreturn-type -Wno-unreachable-code
-// XFAIL: *
-
-// A destructor may be marked noreturn and should still influence the CFG.
-namespace PR6884 {
-  struct abort_struct {
-    abort_struct() {} // Make this non-POD so the destructor is invoked.
-    ~abort_struct() __attribute__((noreturn));
-  };
-
-  int f() {
-    abort_struct();
-  }
-
-  int f2() {
-    abort_struct s;
-  }
-}

Modified: cfe/trunk/test/SemaCXX/return-noreturn.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/return-noreturn.cpp?rev=124239&r1=124238&r2=124239&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/return-noreturn.cpp (original)
+++ cfe/trunk/test/SemaCXX/return-noreturn.cpp Tue Jan 25 16:57:41 2011
@@ -1,11 +1,18 @@
-// RUN: %clang_cc1 %s -fsyntax-only -verify -Wreturn-type -Wno-unreachable-code
+// RUN: %clang_cc1 %s -fsyntax-only -verify -Wreturn-type -Wmissing-noreturn -Wno-unreachable-code
+// XFAIL: *
 
-// <rdar://problem/8875247> - Properly handle CFGs with destructors.
-struct rdar8875247 {
-  ~rdar8875247 ();
-};
-void rdar8875247_aux();
+// A destructor may be marked noreturn and should still influence the CFG.
+namespace PR6884 {
+  struct abort_struct {
+    abort_struct() {} // Make this non-POD so the destructor is invoked.
+    ~abort_struct() __attribute__((noreturn));
+  };
 
-int rdar8875247_test() {
-  rdar8875247 f;
-} // expected-warning{{control reaches end of non-void function}}
+  int f() {
+    abort_struct();
+  }
+
+  int f2() {
+    abort_struct s;
+  }
+}

Modified: cfe/trunk/test/SemaCXX/warn-missing-noreturn.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/warn-missing-noreturn.cpp?rev=124239&r1=124238&r2=124239&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/warn-missing-noreturn.cpp (original)
+++ cfe/trunk/test/SemaCXX/warn-missing-noreturn.cpp Tue Jan 25 16:57:41 2011
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s -Wmissing-noreturn
+// RUN: %clang_cc1 -fsyntax-only -verify %s -Wmissing-noreturn -Wreturn-type
 void f() __attribute__((noreturn));
 
 template<typename T> void g(T) { // expected-warning {{function could be attribute 'noreturn'}}
@@ -82,3 +82,14 @@
     ~C() { }
   };
 }
+
+// <rdar://problem/8875247> - Properly handle CFGs with destructors.
+struct rdar8875247 {
+  ~rdar8875247 ();
+};
+void rdar8875247_aux();
+
+int rdar8875247_test() {
+  rdar8875247 f;
+} // expected-warning{{control reaches end of non-void function}}
+





More information about the cfe-commits mailing list