Index: vendor/libc++/dist/test/libcxx/test/format.py =================================================================== --- vendor/libc++/dist/test/libcxx/test/format.py (revision 295595) +++ vendor/libc++/dist/test/libcxx/test/format.py (revision 295596) @@ -1,177 +1,177 @@ #===----------------------------------------------------------------------===## # # The LLVM Compiler Infrastructure # # This file is dual licensed under the MIT and the University of Illinois Open # Source Licenses. See LICENSE.TXT for details. # #===----------------------------------------------------------------------===## import errno import os import time import lit.Test # pylint: disable=import-error import lit.TestRunner # pylint: disable=import-error import lit.util # pylint: disable=import-error from libcxx.test.executor import LocalExecutor as LocalExecutor import libcxx.util class LibcxxTestFormat(object): """ Custom test format handler for use with the test format use by libc++. Tests fall into two categories: FOO.pass.cpp - Executable test which should compile, run, and exit with code 0. FOO.fail.cpp - Negative test case which is expected to fail compilation. FOO.sh.cpp - A test that uses LIT's ShTest format. """ def __init__(self, cxx, use_verify_for_fail, execute_external, executor, exec_env): self.cxx = cxx self.use_verify_for_fail = use_verify_for_fail self.execute_external = execute_external self.executor = executor self.exec_env = dict(exec_env) # TODO: Move this into lit's FileBasedTest def getTestsInDirectory(self, testSuite, path_in_suite, litConfig, localConfig): source_path = testSuite.getSourcePath(path_in_suite) for filename in os.listdir(source_path): # Ignore dot files and excluded tests. if filename.startswith('.') or filename in localConfig.excludes: continue filepath = os.path.join(source_path, filename) if not os.path.isdir(filepath): if any([filename.endswith(ext) for ext in localConfig.suffixes]): yield lit.Test.Test(testSuite, path_in_suite + (filename,), localConfig) def execute(self, test, lit_config): while True: try: return self._execute(test, lit_config) except OSError as oe: if oe.errno != errno.ETXTBSY: raise time.sleep(0.1) def _execute(self, test, lit_config): name = test.path_in_suite[-1] is_sh_test = name.endswith('.sh.cpp') is_pass_test = name.endswith('.pass.cpp') is_fail_test = name.endswith('.fail.cpp') if test.config.unsupported: return (lit.Test.UNSUPPORTED, "A lit.local.cfg marked this unsupported") script = lit.TestRunner.parseIntegratedTestScript( test, require_script=is_sh_test) # Check if a result for the test was returned. If so return that # result. if isinstance(script, lit.Test.Result): return script if lit_config.noExecute: return lit.Test.Result(lit.Test.PASS) # Check that we don't have run lines on tests that don't support them. if not is_sh_test and len(script) != 0: lit_config.fatal('Unsupported RUN line found in test %s' % name) tmpDir, tmpBase = lit.TestRunner.getTempPaths(test) substitutions = lit.TestRunner.getDefaultSubstitutions(test, tmpDir, tmpBase) script = lit.TestRunner.applySubstitutions(script, substitutions) # Dispatch the test based on its suffix. if is_sh_test: if not isinstance(self.executor, LocalExecutor): # We can't run ShTest tests with a executor yet. # For now, bail on trying to run them return lit.Test.UNSUPPORTED, 'ShTest format not yet supported' return lit.TestRunner._runShTest(test, lit_config, self.execute_external, script, tmpBase) elif is_fail_test: return self._evaluate_fail_test(test) elif is_pass_test: return self._evaluate_pass_test(test, tmpBase, lit_config) else: # No other test type is supported assert False def _clean(self, exec_path): # pylint: disable=no-self-use libcxx.util.cleanFile(exec_path) def _evaluate_pass_test(self, test, tmpBase, lit_config): execDir = os.path.dirname(test.getExecPath()) source_path = test.getSourcePath() exec_path = tmpBase + '.exe' object_path = tmpBase + '.o' # Create the output directory if it does not already exist. lit.util.mkdir_p(os.path.dirname(tmpBase)) try: # Compile the test cmd, out, err, rc = self.cxx.compileLinkTwoSteps( source_path, out=exec_path, object_file=object_path, cwd=execDir) compile_cmd = cmd if rc != 0: report = libcxx.util.makeReport(cmd, out, err, rc) report += "Compilation failed unexpectedly!" return lit.Test.FAIL, report # Run the test local_cwd = os.path.dirname(source_path) env = None if self.exec_env: env = self.exec_env # TODO: Only list actually needed files in file_deps. # Right now we just mark all of the .dat files in the same # directory as dependencies, but it's likely less than that. We # should add a `// FILE-DEP: foo.dat` to each test to track this. data_files = [os.path.join(local_cwd, f) for f in os.listdir(local_cwd) if f.endswith('.dat')] cmd, out, err, rc = self.executor.run(exec_path, [exec_path], local_cwd, data_files, env) if rc != 0: report = libcxx.util.makeReport(cmd, out, err, rc) report = "Compiled With: %s\n%s" % (compile_cmd, report) report += "Compiled test failed unexpectedly!" return lit.Test.FAIL, report return lit.Test.PASS, '' finally: # Note that cleanup of exec_file happens in `_clean()`. If you # override this, cleanup is your reponsibility. libcxx.util.cleanFile(object_path) self._clean(exec_path) def _evaluate_fail_test(self, test): source_path = test.getSourcePath() with open(source_path, 'r') as f: contents = f.read() verify_tags = ['expected-note', 'expected-remark', 'expected-warning', 'expected-error', 'expected-no-diagnostics'] use_verify = self.use_verify_for_fail and \ any([tag in contents for tag in verify_tags]) - extra_flags = [] + extra_flags = ['-fsyntax-only'] if use_verify: extra_flags += ['-Xclang', '-verify', '-Xclang', '-verify-ignore-unexpected=note'] cmd, out, err, rc = self.cxx.compile(source_path, out=os.devnull, flags=extra_flags) expected_rc = 0 if use_verify else 1 if rc == expected_rc: return lit.Test.PASS, '' else: report = libcxx.util.makeReport(cmd, out, err, rc) report_msg = ('Expected compilation to fail!' if not use_verify else 'Expected compilation using verify to pass!') return lit.Test.FAIL, report + report_msg + '\n' Index: vendor/libc++/dist/test/std/localization/locale.categories/category.collate/locale.collate.byname/compare.pass.cpp =================================================================== --- vendor/libc++/dist/test/std/localization/locale.categories/category.collate/locale.collate.byname/compare.pass.cpp (revision 295595) +++ vendor/libc++/dist/test/std/localization/locale.categories/category.collate/locale.collate.byname/compare.pass.cpp (revision 295596) @@ -1,87 +1,89 @@ //===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// +// REQUIRES: locale.en_US.UTF-8 + // // template class collate_byname // int compare(const charT* low1, const charT* high1, // const charT* low2, const charT* high2) const; // I'm currently unable to confirm that collation based on named locales // has any difference from "C" collation. But I do believe I'm picking // up the OS's collation files. // TODO investigation needed. // Glibc seems to collate files differently from the way Apple's C library does // it. // XFAIL: linux-gnu #include #include #include #include #include "platform_support.h" // locale name macros int main() { { std::locale l(LOCALE_en_US_UTF_8); { const std::collate& f = std::use_facet >(l); std::string s2("aaaaaaA"); std::string s3("BaaaaaA"); assert(f.compare(s2.data(), s2.data() + s2.size(), s3.data(), s3.data() + s3.size()) == 1); } { const std::collate& f = std::use_facet >(l); std::wstring s2(L"aaaaaaA"); std::wstring s3(L"BaaaaaA"); assert(f.compare(s2.data(), s2.data() + s2.size(), s3.data(), s3.data() + s3.size()) == 1); } } { std::locale l(""); { const std::collate& f = std::use_facet >(l); std::string s2("aaaaaaA"); std::string s3("BaaaaaA"); assert(f.compare(s2.data(), s2.data() + s2.size(), s3.data(), s3.data() + s3.size()) == 1); } { const std::collate& f = std::use_facet >(l); std::wstring s2(L"aaaaaaA"); std::wstring s3(L"BaaaaaA"); assert(f.compare(s2.data(), s2.data() + s2.size(), s3.data(), s3.data() + s3.size()) == 1); } } { std::locale l("C"); { const std::collate& f = std::use_facet >(l); std::string s2("aaaaaaA"); std::string s3("BaaaaaA"); assert(f.compare(s2.data(), s2.data() + s2.size(), s3.data(), s3.data() + s3.size()) == 1); } { const std::collate& f = std::use_facet >(l); std::wstring s2(L"aaaaaaA"); std::wstring s3(L"BaaaaaA"); assert(f.compare(s2.data(), s2.data() + s2.size(), s3.data(), s3.data() + s3.size()) == 1); } } } Index: vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp =================================================================== --- vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp (revision 295595) +++ vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp (revision 295596) @@ -1,91 +1,93 @@ //===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// +// REQUIRES: locale.en_US.UTF-8 + // // template class ctype_byname; // charT tolower(charT) const; // XFAIL: with_system_cxx_lib=x86_64-apple-darwin11 // XFAIL: with_system_cxx_lib=x86_64-apple-darwin12 // XFAIL: linux #include #include #include "platform_support.h" // locale name macros int main() { { std::locale l(LOCALE_en_US_UTF_8); { typedef std::ctype F; const F& f = std::use_facet(l); assert(f.tolower(' ') == ' '); assert(f.tolower('A') == 'a'); assert(f.tolower('\x07') == '\x07'); assert(f.tolower('.') == '.'); assert(f.tolower('a') == 'a'); assert(f.tolower('1') == '1'); assert(f.tolower('\xDA') == '\xFA'); assert(f.tolower('\xFA') == '\xFA'); } } { std::locale l("C"); { typedef std::ctype F; const F& f = std::use_facet(l); assert(f.tolower(' ') == ' '); assert(f.tolower('A') == 'a'); assert(f.tolower('\x07') == '\x07'); assert(f.tolower('.') == '.'); assert(f.tolower('a') == 'a'); assert(f.tolower('1') == '1'); assert(f.tolower('\xDA') == '\xDA'); assert(f.tolower('\xFA') == '\xFA'); } } { std::locale l(LOCALE_en_US_UTF_8); { typedef std::ctype F; const F& f = std::use_facet(l); assert(f.tolower(L' ') == L' '); assert(f.tolower(L'A') == L'a'); assert(f.tolower(L'\x07') == L'\x07'); assert(f.tolower(L'.') == L'.'); assert(f.tolower(L'a') == L'a'); assert(f.tolower(L'1') == L'1'); assert(f.tolower(L'\xDA') == L'\xFA'); assert(f.tolower(L'\xFA') == L'\xFA'); } } { std::locale l("C"); { typedef std::ctype F; const F& f = std::use_facet(l); assert(f.tolower(L' ') == L' '); assert(f.tolower(L'A') == L'a'); assert(f.tolower(L'\x07') == L'\x07'); assert(f.tolower(L'.') == L'.'); assert(f.tolower(L'a') == L'a'); assert(f.tolower(L'1') == L'1'); assert(f.tolower(L'\xDA') == L'\xDA'); assert(f.tolower(L'\xFA') == L'\xFA'); } } } Index: vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp =================================================================== --- vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp (revision 295595) +++ vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp (revision 295596) @@ -1,96 +1,98 @@ //===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// +// REQUIRES: locale.en_US.UTF-8 + // // template class ctype_byname; // const charT* tolower(charT* low, const charT* high) const; // XFAIL: with_system_cxx_lib=x86_64-apple-darwin11 // XFAIL: with_system_cxx_lib=x86_64-apple-darwin12 // XFAIL: linux #include #include #include #include "platform_support.h" // locale name macros int main() { { std::locale l(LOCALE_en_US_UTF_8); { typedef std::ctype F; const F& f = std::use_facet(l); std::string in("\xDA A\x07.a1"); assert(f.tolower(&in[0], in.data() + in.size()) == in.data() + in.size()); assert(in[0] == '\xFA'); assert(in[1] == ' '); assert(in[2] == 'a'); assert(in[3] == '\x07'); assert(in[4] == '.'); assert(in[5] == 'a'); assert(in[6] == '1'); } } { std::locale l("C"); { typedef std::ctype F; const F& f = std::use_facet(l); std::string in("\xDA A\x07.a1"); assert(f.tolower(&in[0], in.data() + in.size()) == in.data() + in.size()); assert(in[0] == '\xDA'); assert(in[1] == ' '); assert(in[2] == 'a'); assert(in[3] == '\x07'); assert(in[4] == '.'); assert(in[5] == 'a'); assert(in[6] == '1'); } } { std::locale l(LOCALE_en_US_UTF_8); { typedef std::ctype F; const F& f = std::use_facet(l); std::wstring in(L"\xDA A\x07.a1"); assert(f.tolower(&in[0], in.data() + in.size()) == in.data() + in.size()); assert(in[0] == L'\xFA'); assert(in[1] == L' '); assert(in[2] == L'a'); assert(in[3] == L'\x07'); assert(in[4] == L'.'); assert(in[5] == L'a'); assert(in[6] == L'1'); } } { std::locale l("C"); { typedef std::ctype F; const F& f = std::use_facet(l); std::wstring in(L"\xDA A\x07.a1"); assert(f.tolower(&in[0], in.data() + in.size()) == in.data() + in.size()); assert(in[0] == L'\xDA'); assert(in[1] == L' '); assert(in[2] == L'a'); assert(in[3] == L'\x07'); assert(in[4] == L'.'); assert(in[5] == L'a'); assert(in[6] == L'1'); } } } Index: vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp =================================================================== --- vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp (revision 295595) +++ vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp (revision 295596) @@ -1,91 +1,93 @@ //===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// +// REQUIRES: locale.en_US.UTF-8 + // // template class ctype_byname; // charT toupper(charT) const; // XFAIL: with_system_cxx_lib=x86_64-apple-darwin11 // XFAIL: with_system_cxx_lib=x86_64-apple-darwin12 // XFAIL: linux #include #include #include "platform_support.h" // locale name macros int main() { { std::locale l(LOCALE_en_US_UTF_8); { typedef std::ctype F; const F& f = std::use_facet(l); assert(f.toupper(' ') == ' '); assert(f.toupper('A') == 'A'); assert(f.toupper('\x07') == '\x07'); assert(f.toupper('.') == '.'); assert(f.toupper('a') == 'A'); assert(f.toupper('1') == '1'); assert(f.toupper('\xDA') == '\xDA'); assert(f.toupper('\xFA') == '\xDA'); } } { std::locale l("C"); { typedef std::ctype F; const F& f = std::use_facet(l); assert(f.toupper(' ') == ' '); assert(f.toupper('A') == 'A'); assert(f.toupper('\x07') == '\x07'); assert(f.toupper('.') == '.'); assert(f.toupper('a') == 'A'); assert(f.toupper('1') == '1'); assert(f.toupper('\xDA') == '\xDA'); assert(f.toupper('\xFA') == '\xFA'); } } { std::locale l(LOCALE_en_US_UTF_8); { typedef std::ctype F; const F& f = std::use_facet(l); assert(f.toupper(L' ') == L' '); assert(f.toupper(L'A') == L'A'); assert(f.toupper(L'\x07') == L'\x07'); assert(f.toupper(L'.') == L'.'); assert(f.toupper(L'a') == L'A'); assert(f.toupper(L'1') == L'1'); assert(f.toupper(L'\xDA') == L'\xDA'); assert(f.toupper(L'\xFA') == L'\xDA'); } } { std::locale l("C"); { typedef std::ctype F; const F& f = std::use_facet(l); assert(f.toupper(L' ') == L' '); assert(f.toupper(L'A') == L'A'); assert(f.toupper(L'\x07') == L'\x07'); assert(f.toupper(L'.') == L'.'); assert(f.toupper(L'a') == L'A'); assert(f.toupper(L'1') == L'1'); assert(f.toupper(L'\xDA') == L'\xDA'); assert(f.toupper(L'\xFA') == L'\xFA'); } } } Index: vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp =================================================================== --- vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp (revision 295595) +++ vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp (revision 295596) @@ -1,96 +1,98 @@ //===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// +// REQUIRES: locale.en_US.UTF-8 + // // template class ctype_byname; // const charT* toupper(charT* low, const charT* high) const; // XFAIL: with_system_cxx_lib=x86_64-apple-darwin11 // XFAIL: with_system_cxx_lib=x86_64-apple-darwin12 // XFAIL: linux #include #include #include #include "platform_support.h" // locale name macros int main() { { std::locale l(LOCALE_en_US_UTF_8); { typedef std::ctype F; const F& f = std::use_facet(l); std::string in("\xFA A\x07.a1"); assert(f.toupper(&in[0], in.data() + in.size()) == in.data() + in.size()); assert(in[0] == '\xDA'); assert(in[1] == ' '); assert(in[2] == 'A'); assert(in[3] == '\x07'); assert(in[4] == '.'); assert(in[5] == 'A'); assert(in[6] == '1'); } } { std::locale l("C"); { typedef std::ctype F; const F& f = std::use_facet(l); std::string in("\xFA A\x07.a1"); assert(f.toupper(&in[0], in.data() + in.size()) == in.data() + in.size()); assert(in[0] == '\xFA'); assert(in[1] == ' '); assert(in[2] == 'A'); assert(in[3] == '\x07'); assert(in[4] == '.'); assert(in[5] == 'A'); assert(in[6] == '1'); } } { std::locale l(LOCALE_en_US_UTF_8); { typedef std::ctype F; const F& f = std::use_facet(l); std::wstring in(L"\xFA A\x07.a1"); assert(f.toupper(&in[0], in.data() + in.size()) == in.data() + in.size()); assert(in[0] == L'\xDA'); assert(in[1] == L' '); assert(in[2] == L'A'); assert(in[3] == L'\x07'); assert(in[4] == L'.'); assert(in[5] == L'A'); assert(in[6] == L'1'); } } { std::locale l("C"); { typedef std::ctype F; const F& f = std::use_facet(l); std::wstring in(L"\xFA A\x07.a1"); assert(f.toupper(&in[0], in.data() + in.size()) == in.data() + in.size()); assert(in[0] == L'\xFA'); assert(in[1] == L' '); assert(in[2] == L'A'); assert(in[3] == L'\x07'); assert(in[4] == L'.'); assert(in[5] == L'A'); assert(in[6] == L'1'); } } } Index: vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp =================================================================== --- vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp (revision 295595) +++ vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_1.pass.cpp (revision 295596) @@ -1,58 +1,60 @@ //===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// +// REQUIRES: locale.en_US.UTF-8 + // // template class ctype_byname; // charT widen(char c) const; // I doubt this test is portable // XFAIL: linux #include #include #include #include "platform_support.h" // locale name macros int main() { { std::locale l(LOCALE_en_US_UTF_8); { typedef std::ctype F; const F& f = std::use_facet(l); assert(f.widen(' ') == L' '); assert(f.widen('A') == L'A'); assert(f.widen('\x07') == L'\x07'); assert(f.widen('.') == L'.'); assert(f.widen('a') == L'a'); assert(f.widen('1') == L'1'); assert(f.widen(char(-5)) == wchar_t(-1)); } } { std::locale l("C"); { typedef std::ctype F; const F& f = std::use_facet(l); assert(f.widen(' ') == L' '); assert(f.widen('A') == L'A'); assert(f.widen('\x07') == L'\x07'); assert(f.widen('.') == L'.'); assert(f.widen('a') == L'a'); assert(f.widen('1') == L'1'); assert(f.widen(char(-5)) == wchar_t(251)); } } } Index: vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp =================================================================== --- vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp (revision 295595) +++ vendor/libc++/dist/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/widen_many.pass.cpp (revision 295596) @@ -1,65 +1,67 @@ //===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// +// REQUIRES: locale.en_US.UTF-8 + // // template class ctype_byname; // const char* widen(const char* low, const char* high, charT* to) const; // I doubt this test is portable // XFAIL: linux #include #include #include #include #include "platform_support.h" // locale name macros int main() { { std::locale l(LOCALE_en_US_UTF_8); { typedef std::ctype F; const F& f = std::use_facet(l); std::string in(" A\x07.a1\x85"); std::vector v(in.size()); assert(f.widen(&in[0], in.data() + in.size(), v.data()) == in.data() + in.size()); assert(v[0] == L' '); assert(v[1] == L'A'); assert(v[2] == L'\x07'); assert(v[3] == L'.'); assert(v[4] == L'a'); assert(v[5] == L'1'); assert(v[6] == wchar_t(-1)); } } { std::locale l("C"); { typedef std::ctype F; const F& f = std::use_facet(l); std::string in(" A\x07.a1\x85"); std::vector v(in.size()); assert(f.widen(&in[0], in.data() + in.size(), v.data()) == in.data() + in.size()); assert(v[0] == L' '); assert(v[1] == L'A'); assert(v[2] == L'\x07'); assert(v[3] == L'.'); assert(v[4] == L'a'); assert(v[5] == L'1'); assert(v[6] == wchar_t(133)); } } }