Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / libcxx / test / std / experimental / utilities / propagate_const / propagate_const.nonmembers / hash.pass.cpp
blob65208ffd8b1fb5730b518c99258cf464641bac03
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: c++03, c++11
11 // <propagate_const>
13 // template <class T> struct hash<experimental::fundamentals_v2::propagate_const<T>>;
15 #include <experimental/propagate_const>
16 #include "test_macros.h"
17 #include "propagate_const_helpers.h"
18 #include <cassert>
20 using std::experimental::propagate_const;
22 namespace std {
23 template <> struct hash<X>
25 typedef X first_argument_type;
27 std::size_t operator()(const first_argument_type&) const
29 return 99;
33 } // namespace std
35 int main(int, char**) {
37 typedef propagate_const<X> P;
39 P p(1);
41 auto h = std::hash<P>();
43 assert(h(p)==99);
45 return 0;