[RISCV] Fix mgather -> riscv.masked.strided.load combine not extending indices (...
[llvm-project.git] / libcxx / test / std / thread / futures / futures.task / futures.task.members / ctad.compile.pass.cpp
blob0389ed8fccf0a82993bbb37b8b42f10c53f30f4c
1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: no-threads
10 // UNSUPPORTED: c++03, c++11, c++14
12 // checks that CTAD works properly
14 #include <future>
15 #include <type_traits>
17 int func(char*);
18 static_assert(std::is_same_v<decltype(std::packaged_task{func}), std::packaged_task<int(char*)>>);
20 int funcn(char*) noexcept;
21 static_assert(std::is_same_v<decltype(std::packaged_task{funcn}), std::packaged_task<int(char*)>>);
23 template <bool Noexcept>
24 struct Callable {
25 int operator()(char*) noexcept(Noexcept);
27 static_assert(std::is_same_v<decltype(std::packaged_task{Callable<true>{}}), std::packaged_task<int(char*)>>);
28 static_assert(std::is_same_v<decltype(std::packaged_task{Callable<false>{}}), std::packaged_task<int(char*)>>);
30 template <bool Noexcept>
31 struct CallableC {
32 int operator()(char*) const noexcept(Noexcept);
34 static_assert(std::is_same_v<decltype(std::packaged_task{CallableC<true>{}}), std::packaged_task<int(char*)>>);
35 static_assert(std::is_same_v<decltype(std::packaged_task{CallableC<false>{}}), std::packaged_task<int(char*)>>);
37 template <bool Noexcept>
38 struct CallableV {
39 int operator()(char*) const noexcept(Noexcept);
41 static_assert(std::is_same_v<decltype(std::packaged_task{CallableV<true>{}}), std::packaged_task<int(char*)>>);
42 static_assert(std::is_same_v<decltype(std::packaged_task{CallableV<false>{}}), std::packaged_task<int(char*)>>);
44 template <bool Noexcept>
45 struct CallableCV {
46 int operator()(char*) const volatile noexcept(Noexcept);
48 static_assert(std::is_same_v<decltype(std::packaged_task{CallableCV<true>{}}), std::packaged_task<int(char*)>>);
49 static_assert(std::is_same_v<decltype(std::packaged_task{CallableCV<false>{}}), std::packaged_task<int(char*)>>);
51 template <bool Noexcept>
52 struct CallableL {
53 int operator()(char*) & noexcept(Noexcept);
55 static_assert(std::is_same_v<decltype(std::packaged_task{CallableL<true>{}}), std::packaged_task<int(char*)>>);
56 static_assert(std::is_same_v<decltype(std::packaged_task{CallableL<false>{}}), std::packaged_task<int(char*)>>);
58 template <bool Noexcept>
59 struct CallableCL {
60 int operator()(char*) const & noexcept(Noexcept);
62 static_assert(std::is_same_v<decltype(std::packaged_task{CallableCL<true>{}}), std::packaged_task<int(char*)>>);
63 static_assert(std::is_same_v<decltype(std::packaged_task{CallableCL<false>{}}), std::packaged_task<int(char*)>>);
65 template <bool Noexcept>
66 struct CallableVL {
67 int operator()(char*) const noexcept(Noexcept);
69 static_assert(std::is_same_v<decltype(std::packaged_task{CallableVL<true>{}}), std::packaged_task<int(char*)>>);
70 static_assert(std::is_same_v<decltype(std::packaged_task{CallableVL<false>{}}), std::packaged_task<int(char*)>>);
72 template <bool Noexcept>
73 struct CallableCVL {
74 int operator()(char*) const volatile & noexcept(Noexcept);
76 static_assert(std::is_same_v<decltype(std::packaged_task{CallableCVL<true>{}}), std::packaged_task<int(char*)>>);
77 static_assert(std::is_same_v<decltype(std::packaged_task{CallableCVL<false>{}}), std::packaged_task<int(char*)>>);