diff options
author | Ted Kremenek <kremenek@apple.com> | 2011-01-25 22:57:41 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2011-01-25 22:57:41 +0000 |
commit | 8b3b3db2f6eef4080c9c99c3c3af582f9e8fa41e (patch) | |
tree | af908b211f5a441e65b1b79f5aa73cb9389084b8 | |
parent | f39e6a388aaa2f155b46c61e655784b2473218eb (diff) |
Tweak return-noreturn.cpp test to have its original
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
-rw-r--r-- | test/SemaCXX/return-noreturn-XFAIL.cpp | 18 | ||||
-rw-r--r-- | test/SemaCXX/return-noreturn.cpp | 25 | ||||
-rw-r--r-- | test/SemaCXX/warn-missing-noreturn.cpp | 13 |
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}} + |