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
+++ /dev/null
-// 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;
- }
-}
-// 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;
+ }
+}
-// 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'}}
~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}}
+