[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.
This commit is contained in:
Louis Dionne 2020-04-14 12:16:58 -04:00
parent 61ec4cdf6b
commit d58107c3bf
8 changed files with 6 additions and 96 deletions

View File

@ -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() { }

View File

@ -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() { }

View File

@ -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() { }

View File

@ -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() { }

View File

@ -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

View File

@ -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

View File

@ -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'

View File

@ -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