lt.pass.cpp revision f5256e16dfc425c1d466f6308d4026d529ce9e0b
1//===----------------------------------------------------------------------===//
2//
3//                     The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10// <typeindex>
11
12// class type_index
13
14// bool operator< (const type_index& rhs) const;
15// bool operator<=(const type_index& rhs) const;
16// bool operator> (const type_index& rhs) const;
17// bool operator>=(const type_index& rhs) const;
18
19#include <typeindex>
20#include <cassert>
21
22int main()
23{
24    std::type_index t1 = typeid(int);
25    std::type_index t2 = typeid(int);
26    std::type_index t3 = typeid(long);
27    assert(!(t1 <  t2));
28    assert( (t1 <= t2));
29    assert(!(t1 >  t2));
30    assert( (t1 >= t2));
31    assert(!(t1 <  t3));
32    assert(!(t1 <= t3));
33    assert( (t1 >  t3));
34    assert( (t1 >= t3));
35}
36