From 8b3b3db2f6eef4080c9c99c3c3af582f9e8fa41e Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Tue, 25 Jan 2011 22:57:41 +0000 Subject: [PATCH] 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 --- test/SemaCXX/return-noreturn-XFAIL.cpp | 18 ------------------ test/SemaCXX/return-noreturn.cpp | 25 ++++++++++++++++--------- test/SemaCXX/warn-missing-noreturn.cpp | 13 ++++++++++++- 3 files changed, 28 insertions(+), 28 deletions(-) delete mode 100644 test/SemaCXX/return-noreturn-XFAIL.cpp 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: * -// - 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 void g(T) { // expected-warning {{function could be attribute 'noreturn'}} @@ -82,3 +82,14 @@ namespace test3 { ~C() { } }; } + +// - 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}} + -- 2.50.1