summaryrefslogtreecommitdiff
path: root/test/libcxx/localization
diff options
context:
space:
mode:
Diffstat (limited to 'test/libcxx/localization')
-rw-r--r--test/libcxx/localization/c.locales/version.pass.cpp11
-rw-r--r--test/libcxx/localization/locale.categories/__scan_keyword.pass.cpp11
-rw-r--r--test/libcxx/localization/locale.stdcvt/version.pass.cpp11
-rw-r--r--test/libcxx/localization/locales/locale.abort.pass.cpp34
-rw-r--r--test/libcxx/localization/locales/locale.category.abort.pass.cpp34
-rw-r--r--test/libcxx/localization/locales/locale.convenience/conversions/conversions.string/ctor_move.pass.cpp11
-rw-r--r--test/libcxx/localization/locales/locale/locale.types/locale.facet/facet.pass.cpp11
-rw-r--r--test/libcxx/localization/locales/locale/locale.types/locale.id/id.pass.cpp11
-rw-r--r--test/libcxx/localization/locales/use_facet.abort.pass.cpp37
-rw-r--r--test/libcxx/localization/version.pass.cpp11
10 files changed, 147 insertions, 35 deletions
diff --git a/test/libcxx/localization/c.locales/version.pass.cpp b/test/libcxx/localization/c.locales/version.pass.cpp
index 0fce59e2b..2dfc76dd9 100644
--- a/test/libcxx/localization/c.locales/version.pass.cpp
+++ b/test/libcxx/localization/c.locales/version.pass.cpp
@@ -1,9 +1,8 @@
//===----------------------------------------------------------------------===//
//
-// 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.
+// 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
//
//===----------------------------------------------------------------------===//
@@ -15,6 +14,8 @@
#error _LIBCPP_VERSION not defined
#endif
-int main()
+int main(int, char**)
{
+
+ return 0;
}
diff --git a/test/libcxx/localization/locale.categories/__scan_keyword.pass.cpp b/test/libcxx/localization/locale.categories/__scan_keyword.pass.cpp
index b33aab9a7..b85bd8a58 100644
--- a/test/libcxx/localization/locale.categories/__scan_keyword.pass.cpp
+++ b/test/libcxx/localization/locale.categories/__scan_keyword.pass.cpp
@@ -1,9 +1,8 @@
//===----------------------------------------------------------------------===//
//
-// 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.
+// 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
//
//===----------------------------------------------------------------------===//
@@ -39,7 +38,7 @@
#include <locale>
#include <cassert>
-int main()
+int main(int, char**)
{
const std::ctype<char>& ct = std::use_facet<std::ctype<char> >(std::locale::classic());
std::ios_base::iostate err = std::ios_base::goodbit;
@@ -115,4 +114,6 @@ int main()
assert(in == input+3);
assert(err == std::ios_base::goodbit);
}
+
+ return 0;
}
diff --git a/test/libcxx/localization/locale.stdcvt/version.pass.cpp b/test/libcxx/localization/locale.stdcvt/version.pass.cpp
index 388538085..738ab5e41 100644
--- a/test/libcxx/localization/locale.stdcvt/version.pass.cpp
+++ b/test/libcxx/localization/locale.stdcvt/version.pass.cpp
@@ -1,9 +1,8 @@
//===----------------------------------------------------------------------===//
//
-// 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.
+// 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
//
//===----------------------------------------------------------------------===//
@@ -15,6 +14,8 @@
#error _LIBCPP_VERSION not defined
#endif
-int main()
+int main(int, char**)
{
+
+ return 0;
}
diff --git a/test/libcxx/localization/locales/locale.abort.pass.cpp b/test/libcxx/localization/locales/locale.abort.pass.cpp
new file mode 100644
index 000000000..5817ebdfd
--- /dev/null
+++ b/test/libcxx/localization/locales/locale.abort.pass.cpp
@@ -0,0 +1,34 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class locale;
+
+// explicit locale( const char* std_name );
+
+// REQUIRES: libcpp-no-exceptions
+
+// Make sure we abort() when we construct a locale with a null name and
+// exceptions are disabled.
+
+#include <csignal>
+#include <cstdlib>
+#include <locale>
+
+
+void exit_success(int) {
+ std::_Exit(EXIT_SUCCESS);
+}
+
+int main(int, char**) {
+ std::signal(SIGABRT, exit_success);
+ std::locale loc(NULL);
+ (void)loc;
+ return EXIT_FAILURE;
+}
diff --git a/test/libcxx/localization/locales/locale.category.abort.pass.cpp b/test/libcxx/localization/locales/locale.category.abort.pass.cpp
new file mode 100644
index 000000000..cf50415a2
--- /dev/null
+++ b/test/libcxx/localization/locales/locale.category.abort.pass.cpp
@@ -0,0 +1,34 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// class locale;
+
+// locale(const locale& other, const char* std_name, category cat);
+
+// REQUIRES: libcpp-no-exceptions
+
+// Make sure we abort() when we construct a locale with a null name and
+// exceptions are disabled.
+
+#include <csignal>
+#include <cstdlib>
+#include <locale>
+
+
+void exit_success(int) {
+ std::_Exit(EXIT_SUCCESS);
+}
+
+int main(int, char**) {
+ std::signal(SIGABRT, exit_success);
+ std::locale loc(std::locale(), NULL, std::locale::ctype);
+ (void)loc;
+ return EXIT_FAILURE;
+}
diff --git a/test/libcxx/localization/locales/locale.convenience/conversions/conversions.string/ctor_move.pass.cpp b/test/libcxx/localization/locales/locale.convenience/conversions/conversions.string/ctor_move.pass.cpp
index 18cc0ca97..3aac6f532 100644
--- a/test/libcxx/localization/locales/locale.convenience/conversions/conversions.string/ctor_move.pass.cpp
+++ b/test/libcxx/localization/locales/locale.convenience/conversions/conversions.string/ctor_move.pass.cpp
@@ -1,9 +1,8 @@
//===----------------------------------------------------------------------===//
//
-// 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.
+// 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
//
//===----------------------------------------------------------------------===//
@@ -22,7 +21,7 @@
#include <codecvt>
#include <cassert>
-int main()
+int main(int, char**)
{
typedef std::codecvt_utf8<wchar_t> Codecvt;
typedef std::wstring_convert<Codecvt> Myconv;
@@ -35,4 +34,6 @@ int main()
// move construct a new converter and make sure the state is the same.
Myconv myconv2(std::move(myconv));
assert(myconv2.converted() == old_converted);
+
+ return 0;
}
diff --git a/test/libcxx/localization/locales/locale/locale.types/locale.facet/facet.pass.cpp b/test/libcxx/localization/locales/locale/locale.types/locale.facet/facet.pass.cpp
index 4a7f77ad5..7be14d6be 100644
--- a/test/libcxx/localization/locales/locale/locale.types/locale.facet/facet.pass.cpp
+++ b/test/libcxx/localization/locales/locale/locale.types/locale.facet/facet.pass.cpp
@@ -1,9 +1,8 @@
//===----------------------------------------------------------------------===//
//
-// 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.
+// 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
//
//===----------------------------------------------------------------------===//
@@ -36,7 +35,7 @@ struct my_facet
int my_facet::count = 0;
-int main()
+int main(int, char**)
{
my_facet* f = new my_facet;
f->__add_shared();
@@ -50,4 +49,6 @@ int main()
assert(my_facet::count == 1);
f->__release_shared();
assert(my_facet::count == 0);
+
+ return 0;
}
diff --git a/test/libcxx/localization/locales/locale/locale.types/locale.id/id.pass.cpp b/test/libcxx/localization/locales/locale/locale.types/locale.id/id.pass.cpp
index 3233624d8..758d7f8b8 100644
--- a/test/libcxx/localization/locales/locale/locale.types/locale.id/id.pass.cpp
+++ b/test/libcxx/localization/locales/locale/locale.types/locale.id/id.pass.cpp
@@ -1,9 +1,8 @@
//===----------------------------------------------------------------------===//
//
-// 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.
+// 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
//
//===----------------------------------------------------------------------===//
@@ -26,7 +25,7 @@ std::locale::id id0;
std::locale::id id2;
std::locale::id id1;
-int main()
+int main(int, char**)
{
long id = id0.__get();
assert(id0.__get() == id+0);
@@ -47,4 +46,6 @@ int main()
assert(id2.__get() == id+2);
assert(id2.__get() == id+2);
assert(id2.__get() == id+2);
+
+ return 0;
}
diff --git a/test/libcxx/localization/locales/use_facet.abort.pass.cpp b/test/libcxx/localization/locales/use_facet.abort.pass.cpp
new file mode 100644
index 000000000..64700eab9
--- /dev/null
+++ b/test/libcxx/localization/locales/use_facet.abort.pass.cpp
@@ -0,0 +1,37 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+// <locale>
+
+// template <class Facet> const Facet& use_facet(const locale& loc);
+
+// REQUIRES: libcpp-no-exceptions
+
+// Make sure we abort() when we pass a facet not associated to the locale to
+// use_facet() and exceptions are disabled.
+
+#include <csignal>
+#include <cstdlib>
+#include <locale>
+
+
+struct my_facet : public std::locale::facet {
+ static std::locale::id id;
+};
+
+std::locale::id my_facet::id;
+
+void exit_success(int) {
+ std::_Exit(EXIT_SUCCESS);
+}
+
+int main(int, char**) {
+ std::signal(SIGABRT, exit_success);
+ std::use_facet<my_facet>(std::locale());
+ return EXIT_FAILURE;
+}
diff --git a/test/libcxx/localization/version.pass.cpp b/test/libcxx/localization/version.pass.cpp
index a64534c9f..1d1294593 100644
--- a/test/libcxx/localization/version.pass.cpp
+++ b/test/libcxx/localization/version.pass.cpp
@@ -1,9 +1,8 @@
//===----------------------------------------------------------------------===//
//
-// 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.
+// 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
//
//===----------------------------------------------------------------------===//
@@ -15,6 +14,8 @@
#error _LIBCPP_VERSION not defined
#endif
-int main()
+int main(int, char**)
{
+
+ return 0;
}