]> granicus.if.org Git - clang/commitdiff
Tweak return-noreturn.cpp test to have its original
authorTed Kremenek <kremenek@apple.com>
Tue, 25 Jan 2011 22:57:41 +0000 (22:57 +0000)
committerTed Kremenek <kremenek@apple.com>
Tue, 25 Jan 2011 22:57:41 +0000 (22:57 +0000)
contents, with the additional warning flag (and still marked XFAIL).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124239 91177308-0d34-0410-b5e6-96231b3b80d8

test/SemaCXX/return-noreturn-XFAIL.cpp [deleted file]
test/SemaCXX/return-noreturn.cpp
test/SemaCXX/warn-missing-noreturn.cpp

diff --git a/test/SemaCXX/return-noreturn-XFAIL.cpp b/test/SemaCXX/return-noreturn-XFAIL.cpp
deleted file mode 100644 (file)
index ee76dcb..0000000
+++ /dev/null
@@ -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;
-  }
-}
index 5045d1b4c3d3cca0d64de84c81fd3c98b2d5af5c..7e0a69c266b53eefa53af892125919e1bbe1575e 100644 (file)
@@ -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;
+  }
+}
index 54485fb5b1496fdd1a5475732b9a5543e3e74b2b..08a20b627c54e04102e92643d6a95a07c506da7d 100644 (file)
@@ -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 @@ namespace test3 {
     ~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}}
+