aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/SemaCXX/return-noreturn-XFAIL.cpp18
-rw-r--r--test/SemaCXX/return-noreturn.cpp25
-rw-r--r--test/SemaCXX/warn-missing-noreturn.cpp13
3 files changed, 28 insertions, 28 deletions
diff --git a/test/SemaCXX/return-noreturn-XFAIL.cpp b/test/SemaCXX/return-noreturn-XFAIL.cpp
deleted file mode 100644
index ee76dcb270..0000000000
--- a/test/SemaCXX/return-noreturn-XFAIL.cpp
+++ /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;
- }
-}
diff --git a/test/SemaCXX/return-noreturn.cpp b/test/SemaCXX/return-noreturn.cpp
index 5045d1b4c3..7e0a69c266 100644
--- a/test/SemaCXX/return-noreturn.cpp
+++ b/test/SemaCXX/return-noreturn.cpp
@@ -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;
+ }
+}
diff --git a/test/SemaCXX/warn-missing-noreturn.cpp b/test/SemaCXX/warn-missing-noreturn.cpp
index 54485fb5b1..08a20b627c 100644
--- a/test/SemaCXX/warn-missing-noreturn.cpp
+++ b/test/SemaCXX/warn-missing-noreturn.cpp
@@ -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}}
+