diff --git a/libcxx/test/libcxx/language.support/support.c.headers/support.c.headers.other/math.lerp.verify.cpp b/libcxx/test/libcxx/language.support/support.c.headers/support.c.headers.other/math.lerp.verify.cpp deleted file mode 100644 index 1b84a9bfe47da..0000000000000 --- a/libcxx/test/libcxx/language.support/support.c.headers/support.c.headers.other/math.lerp.verify.cpp +++ /dev/null @@ -1,39 +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 -// -//===----------------------------------------------------------------------===// - -// When built with modules, this test gives diagnostics like -// declaration of 'lerp' must be imported from module 'std.compat.cmath' -// before it is required -// therefore disable the test in this configuration. -// UNSUPPORTED: clang-modules-build - -// - -// [support.c.headers.other]/1 -// ... except for the functions described in [sf.cmath], the -// std::lerp function overloads ([c.math.lerp]) ... - -#include - -void f() { - { - float f; - ::lerp(f, f, f); // expected-error {{no member named 'lerp' in the global namespace}} - std::lerp(f, f, f); // expected-error {{no member named 'lerp' in namespace 'std'}} - } - { - double d; - ::lerp(d, d, d); // expected-error {{no member named 'lerp' in the global namespace}} - std::lerp(d, d, d); // expected-error {{no member named 'lerp' in namespace 'std'}} - } - { - long double l; - ::lerp(l, l, l); // expected-error {{no member named 'lerp' in the global namespace}} - std::lerp(l, l, l); // expected-error {{no member named 'lerp' in namespace 'std'}} - } -} diff --git a/libcxx/test/libcxx/utilities/meta/stress_tests/stress_test_is_same.sh.cpp b/libcxx/test/libcxx/utilities/meta/stress_tests/stress_test_is_same.sh.cpp deleted file mode 100644 index cfd8adb52d854..0000000000000 --- a/libcxx/test/libcxx/utilities/meta/stress_tests/stress_test_is_same.sh.cpp +++ /dev/null @@ -1,55 +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 -// -//===----------------------------------------------------------------------===// -// -// This is a dummy feature that prevents this test from running by default. -// REQUIRES: template-cost-testing - -// The table below compares the compile time and object size for each of the -// variants listed in the RUN script. -// -// Impl Compile Time Object Size -// ------------------------------------------- -// std::_IsSame: 689.634 ms 356 K -// std::is_same: 8,129.180 ms 560 K -// -// RUN: %{cxx} %{flags} %{compile_flags} -c %s -o %S/orig.o -ggdb -ggnu-pubnames -ftemplate-depth=5000 -ftime-trace -std=c++17 -// RUN: %{cxx} %{flags} %{compile_flags} -c %s -o %S/new.o -ggdb -ggnu-pubnames -ftemplate-depth=5000 -ftime-trace -std=c++17 -DTEST_NEW - -#include -#include - -#include "test_macros.h" -#include "template_cost_testing.h" - -template struct Arg { enum { value = 1 }; }; - -#ifdef TEST_NEW -#define IS_SAME std::_IsSame -#else -#define IS_SAME std::is_same -#endif - -#define TEST_CASE_NOP() IS_SAME < Arg< __COUNTER__ >, Arg < __COUNTER__ > >::value, -#define TEST_CASE_TYPE() IS_SAME < Arg< __COUNTER__ >, Arg < __COUNTER__ > >, - -int sink(...); - -int x = sink( - REPEAT_10000(TEST_CASE_NOP) - REPEAT_10000(TEST_CASE_NOP) 42 -); - -void Foo( REPEAT_1000(TEST_CASE_TYPE) int) { } - -static_assert(__COUNTER__ > 10000, ""); - -void escape() { - -sink(&x); -sink(&Foo); -} diff --git a/libcxx/test/libcxx/utilities/meta/stress_tests/stress_test_metafunctions.sh.cpp b/libcxx/test/libcxx/utilities/meta/stress_tests/stress_test_metafunctions.sh.cpp deleted file mode 100644 index 4815ce37b0883..0000000000000 --- a/libcxx/test/libcxx/utilities/meta/stress_tests/stress_test_metafunctions.sh.cpp +++ /dev/null @@ -1,65 +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 -// -//===----------------------------------------------------------------------===// -// -// This is a dummy feature that prevents this test from running by default. -// REQUIRES: template-cost-testing - -// The table below compares the compile time and object size for each of the -// variants listed in the RUN script. -// -// Impl Compile Time Object Size -// ------------------------------------------- -// _And: 3,498.639 ms 158 M -// __lazy_and: 10,138.982 ms 334 M -// __and_: 14,181.851 ms 648 M -// - -// RUN: %{cxx} %{flags} %{compile_flags} -c %s -o %S/new.o -ggdb -ggnu-pubnames -ftemplate-depth=5000 -ftime-trace -std=c++17 -// RUN: %{cxx} %{flags} %{compile_flags} -c %s -o %S/lazy.o -ggdb -ggnu-pubnames -ftemplate-depth=5000 -ftime-trace -std=c++17 -DTEST_LAZY_AND -// RUN: %{cxx} %{flags} %{compile_flags} -c %s -o %S/std.o -ggdb -ggnu-pubnames -ftemplate-depth=5000 -ftime-trace -std=c++17 -DTEST_STD_AND - -#include -#include - -#include "test_macros.h" -#include "template_cost_testing.h" -using std::true_type; -using std::false_type; - -#define FALSE_T() std::false_type, -#define TRUE_T() std::true_type, - -#ifdef TEST_LAZY_AND -#define TEST_AND std::__lazy_and -#define TEST_OR std::__lazy_or -#elif defined(TEST_STD_AND) -#define TEST_AND std::__and_ -#define TEST_OR std::__or_ -#else -#define TEST_AND std::_And -#define TEST_OR std::_Or -#endif - -void sink(...); - -void Foo1(TEST_AND < REPEAT_1000(TRUE_T) true_type > t1) { sink(&t1); } -void Foo2(TEST_AND < REPEAT_1000(TRUE_T) REPEAT_1000(TRUE_T) true_type > t2) { sink(&t2); } -void Foo3(TEST_AND < REPEAT_1000(TRUE_T) true_type, false_type > t3) { sink(&t3); } -void Foo4(TEST_AND < REPEAT_1000(TRUE_T) REPEAT_1000(TRUE_T) true_type, false_type > t4) { sink(&t4); } -void Foo5(TEST_AND < false_type, REPEAT_1000(TRUE_T) true_type > t5) { sink(&t5); } -void Foo6(TEST_AND < false_type, REPEAT_1000(TRUE_T) REPEAT_1000(TRUE_T) true_type > t6) { sink(&t6); } - -void escape() { - -sink(&Foo1); -sink(&Foo2); -sink(&Foo3); -sink(&Foo4); -sink(&Foo5); -sink(&Foo6); -} diff --git a/libcxx/test/libcxx/utilities/meta/stress_tests/stress_test_variant_overloads_impl.sh.cpp b/libcxx/test/libcxx/utilities/meta/stress_tests/stress_test_variant_overloads_impl.sh.cpp deleted file mode 100644 index b0512325d4c2c..0000000000000 --- a/libcxx/test/libcxx/utilities/meta/stress_tests/stress_test_variant_overloads_impl.sh.cpp +++ /dev/null @@ -1,119 +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 -// -//===----------------------------------------------------------------------===// -// -// This is a dummy feature that prevents this test from running by default. -// REQUIRES: template-cost-testing - -// Test the cost of the mechanism used to create an overload set used by variant -// to determine which alternative to construct. - -// The table below compares the compile time and object size for each of the -// variants listed in the RUN script. -// -// Impl Compile Time Object Size -// ----------------------------------------------------- -// flat: 959 ms 792 KiB -// recursive: 23,444 ms 23,000 KiB -// ----------------------------------------------------- -// variant_old: 16,894 ms 17,000 KiB -// variant_new: 1,105 ms 828 KiB - - -// RUN: %{cxx} %{flags} %{compile_flags} -std=c++17 -c %s \ -// RUN: -ggdb -ggnu-pubnames -ftemplate-depth=5000 -ftime-trace -g \ -// RUN: -DTEST_NS=flat_impl -o %S/flat.o -// RUN: %{cxx} %{flags} %{compile_flags} -std=c++17 -c %s \ -// RUN: -ggdb -ggnu-pubnames -ftemplate-depth=5000 -ftime-trace -g \ -// RUN: -DTEST_NS=rec_impl -o %S/rec.o -// RUN: %{cxx} %{flags} %{compile_flags} -std=c++17 -c %s \ -// RUN: -ggdb -ggnu-pubnames -ftemplate-depth=5000 -ftime-trace -g \ -// RUN: -DTEST_NS=variant_impl -o %S/variant.o - -#include -#include -#include -#include - -#include "test_macros.h" -#include "template_cost_testing.h" - -template -struct TestType {}; - -template -struct ID { - using type = T; -}; - -namespace flat_impl { - -struct OverloadBase { void operator()() const; }; - -template -struct Overload { - auto operator()(Tp, Tp) const -> ID; -}; - -template -struct AllOverloads : OverloadBase, Bases... {}; - -template -struct MakeOverloads; - -template -struct MakeOverloads > { - template - using Apply = AllOverloads...>; -}; - -template -using Overloads = typename MakeOverloads< - std::__make_indices_imp >::template Apply; - -} // namespace flat_impl - - -namespace rec_impl { - -template struct Overload; - -template <> -struct Overload<> { void operator()() const; }; - -template -struct Overload : Overload { - using Overload::operator(); - auto operator()(Tp, Tp) const -> ID; -}; - -template -using Overloads = Overload; - -} // namespace rec_impl - -namespace variant_impl { - template - using Overloads = std::__variant_detail::_MakeOverloads; - } // namespace variant_impl - -#ifndef TEST_NS -#error TEST_NS must be defined -#endif - -#define TEST_TYPE() TestType< __COUNTER__ >, -using T1 = TEST_NS::Overloads, TestType<1>, int>; -static_assert(__COUNTER__ >= 1000, ""); - -void fn1(T1 x) { DoNotOptimize(&x); } -void fn2(typename std::invoke_result_t::type x) { DoNotOptimize(&x); } - -int main(int, char**) { - DoNotOptimize(&fn1); - DoNotOptimize(&fn2); - return 0; -} diff --git a/libcxx/test/libcxx/utilities/template.bitset/includes.pass.cpp b/libcxx/test/libcxx/utilities/template.bitset/includes.pass.cpp deleted file mode 100644 index ae8464ac946a9..0000000000000 --- a/libcxx/test/libcxx/utilities/template.bitset/includes.pass.cpp +++ /dev/null @@ -1,33 +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 -// -//===----------------------------------------------------------------------===// - -// test that includes , and - -// XFAIL: FROZEN-CXX03-HEADERS-FIXME - -#include - -#include "test_macros.h" - -#ifndef _LIBCPP_STRING -#error has not been included -#endif - -#ifndef _LIBCPP_STDEXCEPT -#error has not been included -#endif - -#ifndef _LIBCPP_IOSFWD -#error has not been included -#endif - -int main(int, char**) -{ - - return 0; -} diff --git a/libcxx/test/std/language.support/support.c.headers/support.c.headers.other/math.lerp.pass.cpp b/libcxx/test/std/language.support/support.c.headers/support.c.headers.other/math.lerp.pass.cpp new file mode 100644 index 0000000000000..f1dd021d28b87 --- /dev/null +++ b/libcxx/test/std/language.support/support.c.headers/support.c.headers.other/math.lerp.pass.cpp @@ -0,0 +1,39 @@ +//===----------------------------------------------------------------------===// +// +// 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 +// +//===----------------------------------------------------------------------===// + +// + +// [support.c.headers.other]/1 +// ... except for the functions described in [sf.cmath], the +// std::lerp function overloads ([c.math.lerp]) ... + +#include +#include + +template +int lerp(float, float, float) { + return 32; +} + +template +int lerp(double, double, double) { + return 32; +} + +template +int lerp(long double, long double, long double) { + return 32; +} + +int main(int, char**) { + assert(lerp(0.f, 0.f, 0.f) == 32); + assert(lerp(0., 0., 0.) == 32); + assert(lerp(0.l, 0.l, 0.l) == 32); + + return 0; +} diff --git a/libcxx/test/libcxx/thread/thread.threads/thread.thread.this/sleep_for.pass.cpp b/libcxx/test/std/thread/thread.threads/thread.thread.this/sleep_for.pass.cpp similarity index 100% rename from libcxx/test/libcxx/thread/thread.threads/thread.thread.this/sleep_for.pass.cpp rename to libcxx/test/std/thread/thread.threads/thread.thread.this/sleep_for.pass.cpp diff --git a/libcxx/test/libcxx/thread/thread.threads/thread.thread.this/sleep_for.signals.pass.cpp b/libcxx/test/std/thread/thread.threads/thread.thread.this/sleep_for.signals.pass.cpp similarity index 100% rename from libcxx/test/libcxx/thread/thread.threads/thread.thread.this/sleep_for.signals.pass.cpp rename to libcxx/test/std/thread/thread.threads/thread.thread.this/sleep_for.signals.pass.cpp diff --git a/libcxx/test/std/thread/thread.threads/thread.thread.this/sleep_for_tested_elsewhere.pass.cpp b/libcxx/test/std/thread/thread.threads/thread.thread.this/sleep_for_tested_elsewhere.pass.cpp deleted file mode 100644 index 2be9cb4187fa2..0000000000000 --- a/libcxx/test/std/thread/thread.threads/thread.thread.this/sleep_for_tested_elsewhere.pass.cpp +++ /dev/null @@ -1,22 +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 -// -//===----------------------------------------------------------------------===// - -// - -// template -// void sleep_for(const chrono::duration& rel_time); - -// The std::this_thread::sleep_for test requires POSIX specific headers and -// is therefore non-standard. For this reason the test lives under the 'libcxx' -// subdirectory. - -int main(int, char**) -{ - - return 0; -} diff --git a/libcxx/test/libcxx/vendor/ibm/bad_function_call.pass.cpp b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.badcall/visibility_inlines_hidden.cpp similarity index 97% rename from libcxx/test/libcxx/vendor/ibm/bad_function_call.pass.cpp rename to libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.badcall/visibility_inlines_hidden.cpp index 3714e4037a2dc..fe5e49f715787 100644 --- a/libcxx/test/libcxx/vendor/ibm/bad_function_call.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.badcall/visibility_inlines_hidden.cpp @@ -6,7 +6,6 @@ // //===----------------------------------------------------------------------===// -// REQUIRES: target={{.+}}-aix{{.*}} // ADDITIONAL_COMPILE_FLAGS: -fvisibility-inlines-hidden // When there is a weak hidden symbol in user code and a strong definition diff --git a/libcxx/test/libcxx/utilities/function.objects/refwrap/binary.pass.cpp b/libcxx/test/std/utilities/function.objects/refwrap/binary.pass.cpp similarity index 100% rename from libcxx/test/libcxx/utilities/function.objects/refwrap/binary.pass.cpp rename to libcxx/test/std/utilities/function.objects/refwrap/binary.pass.cpp diff --git a/libcxx/test/libcxx/utilities/function.objects/refwrap/unary.pass.cpp b/libcxx/test/std/utilities/function.objects/refwrap/unary.pass.cpp similarity index 100% rename from libcxx/test/libcxx/utilities/function.objects/refwrap/unary.pass.cpp rename to libcxx/test/std/utilities/function.objects/refwrap/unary.pass.cpp diff --git a/libcxx/test/libcxx/utilities/memory/util.smartptr/race_condition.pass.cpp b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/race_condition.pass.cpp similarity index 100% rename from libcxx/test/libcxx/utilities/memory/util.smartptr/race_condition.pass.cpp rename to libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/race_condition.pass.cpp diff --git a/libcxx/test/libcxx/utilities/utility/pairs/pairs.pair/pair.incomplete.compile.pass.cpp b/libcxx/test/std/utilities/utility/pairs/pairs.pair/pair.incomplete.compile.pass.cpp similarity index 100% rename from libcxx/test/libcxx/utilities/utility/pairs/pairs.pair/pair.incomplete.compile.pass.cpp rename to libcxx/test/std/utilities/utility/pairs/pairs.pair/pair.incomplete.compile.pass.cpp