From: Louis Dionne Date: Tue, 14 Apr 2020 16:16:58 +0000 (-0400) Subject: [libc++] Remove support for .fail.mm tests X-Git-Tag: llvmorg-12-init~9093 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d58107c3bf6b5437c13a4dee3b90a7fe80cf4205;p=platform%2Fupstream%2Fllvm.git [libc++] Remove support for .fail.mm tests There are no such tests in the libc++ test suite, and I want to move away from `.fail.cpp` tests (in favour of something else) too, which require a workaround. --- diff --git a/libcxx/test/libcxx/selftest/newformat/fail.mm/compile-error-with-verify.fail.mm b/libcxx/test/libcxx/selftest/newformat/fail.mm/compile-error-with-verify.fail.mm deleted file mode 100644 index a45f05e..0000000 --- a/libcxx/test/libcxx/selftest/newformat/fail.mm/compile-error-with-verify.fail.mm +++ /dev/null @@ -1,16 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// REQUIRES: objective-c++ - -// Make sure the test passes if it fails at compile-time, with verify - -struct Foo { }; -typedef Foo::x x; // expected-error{{no type named 'x' in 'Foo'}} - -int main() { } diff --git a/libcxx/test/libcxx/selftest/newformat/fail.mm/compile-error-without-verify.fail.mm b/libcxx/test/libcxx/selftest/newformat/fail.mm/compile-error-without-verify.fail.mm deleted file mode 100644 index 57edb18..0000000 --- a/libcxx/test/libcxx/selftest/newformat/fail.mm/compile-error-without-verify.fail.mm +++ /dev/null @@ -1,16 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// REQUIRES: objective-c++ - -// Make sure the test passes if it fails at compile-time, without verify - -struct Foo { }; -typedef Foo::x x; - -int main() { } diff --git a/libcxx/test/libcxx/selftest/newformat/fail.mm/compile-success.fail.mm b/libcxx/test/libcxx/selftest/newformat/fail.mm/compile-success.fail.mm deleted file mode 100644 index a802d9c..0000000 --- a/libcxx/test/libcxx/selftest/newformat/fail.mm/compile-success.fail.mm +++ /dev/null @@ -1,15 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// REQUIRES: objective-c++ - -// XFAIL: * - -// Make sure the test DOES NOT pass if it succeeds at compile-time - -int main() { } diff --git a/libcxx/test/libcxx/selftest/newformat/fail.mm/wrong-expected.fail.cpp b/libcxx/test/libcxx/selftest/newformat/fail.mm/wrong-expected.fail.cpp deleted file mode 100644 index d0f0f93..0000000 --- a/libcxx/test/libcxx/selftest/newformat/fail.mm/wrong-expected.fail.cpp +++ /dev/null @@ -1,19 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// REQUIRES: objective-c++ - -// XFAIL: * - -// Make sure the test DOES NOT pass if it fails at compile-time, but the -// expected-error is wrong. - -struct Foo { }; -typedef Foo::x x; // expected-error{{this is not found in the errors}} - -int main() { } diff --git a/libcxx/test/libcxx/selftest/test.arc.fail.mm b/libcxx/test/libcxx/selftest/test.arc.fail.mm deleted file mode 100644 index 0e8b62c..0000000 --- a/libcxx/test/libcxx/selftest/test.arc.fail.mm +++ /dev/null @@ -1,14 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -// ADDITIONAL_COMPILE_FLAGS: -fobjc-arc - -#if __has_feature(objc_arc) -#error This test should not compile. -#endif diff --git a/libcxx/test/libcxx/selftest/test.fail.mm b/libcxx/test/libcxx/selftest/test.fail.mm deleted file mode 100644 index ea3a054..0000000 --- a/libcxx/test/libcxx/selftest/test.fail.mm +++ /dev/null @@ -1,12 +0,0 @@ -// -*- C++ -*- -//===----------------------------------------------------------------------===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#if __has_feature(objc_arc) == 0 -#error This test should not compile. -#endif diff --git a/libcxx/utils/libcxx/test/format.py b/libcxx/utils/libcxx/test/format.py index 0316835..0ec68e9 100644 --- a/libcxx/utils/libcxx/test/format.py +++ b/libcxx/utils/libcxx/test/format.py @@ -95,7 +95,7 @@ class LibcxxTestFormat(object): is_libcxx_test = test.path_in_suite[0] == 'libcxx' is_sh_test = name_root.endswith('.sh') is_pass_test = name.endswith('.pass.cpp') or name.endswith('.pass.mm') - is_fail_test = name.endswith('.fail.cpp') or name.endswith('.fail.mm') + is_fail_test = name.endswith('.fail.cpp') is_objcxx_test = name.endswith('.mm') assert is_sh_test or name_ext == '.cpp' or name_ext == '.mm', \ 'non-cpp file must be sh test' diff --git a/libcxx/utils/libcxx/test/newformat.py b/libcxx/utils/libcxx/test/newformat.py index f1518df..88aa29f 100644 --- a/libcxx/utils/libcxx/test/newformat.py +++ b/libcxx/utils/libcxx/test/newformat.py @@ -22,11 +22,14 @@ class CxxStandardLibraryTest(lit.formats.TestFormat): FOO.pass.cpp - Compiles, links and runs successfully FOO.pass.mm - Same as .pass.cpp, but for Objective-C++ FOO.run.fail.cpp - Compiles and links successfully, but fails at runtime + FOO.compile.pass.cpp - Compiles successfully, link and run not attempted FOO.compile.fail.cpp - Does not compile successfully. These tests run with clang-verify. + FOO.link.pass.cpp - Compiles and links successfully, run not attempted FOO.link.fail.cpp - Compiles successfully, but fails to link + FOO.sh.cpp - A builtin lit Shell test FOO.sh.s - A builtin lit Shell test @@ -34,7 +37,6 @@ class CxxStandardLibraryTest(lit.formats.TestFormat): if any expected-meow appears in the file, otherwise just test that compilation fails. This is supported only for backwards compatibility with the test suite - FOO.fail.mm - Same as .fail.cpp, but for Objective-C++ The test format operates by assuming that each test's configuration provides the following substitutions, which it will reuse in the shell scripts it @@ -89,7 +91,7 @@ class CxxStandardLibraryTest(lit.formats.TestFormat): '.compile.pass.cpp', '.compile.fail.cpp', '.link.pass.cpp', '.link.fail.cpp', '.sh.cpp', '.sh.s', - '.fail.cpp', '.fail.mm'] + '.fail.cpp'] sourcePath = testSuite.getSourcePath(pathInSuite) for filename in os.listdir(sourcePath): # Ignore dot files and excluded tests. @@ -184,7 +186,7 @@ class CxxStandardLibraryTest(lit.formats.TestFormat): return self._executeShTest(test, litConfig, steps, fileDependencies=['%t.exe']) # This is the same as .compile.fail.cpp, provided for backwards # compatibility with the test suite. - elif filename.endswith('.fail.cpp') or filename.endswith('.fail.mm'): + elif filename.endswith('.fail.cpp'): if self._useVerify(test, litConfig): steps = [ "%dbg(COMPILED WITH) %{cxx} %s %{flags} %{compile_flags} -fsyntax-only " + VERIFY_FLAGS