2 // Test rtti pointer flags
3 // Copyright (C) 2000, 2002 Free Software Foundation, Inc.
4 // Contributed by Nathan Sidwell 15 Apr 2000 <nathan@nathan@codesourcery.com>
8 #if defined (__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100
16 int expect (int flags, std::type_info const &info)
18 abi::__pbase_type_info const *ptr =
19 dynamic_cast <abi::__pbase_type_info const *> (&info);
22 if (ptr->__flags != flags)
29 if (! expect (0, typeid (A *)))
31 if (! expect (1, typeid (A const *)))
33 if (! expect (2, typeid (A volatile *)))
35 if (! expect (4, typeid (A *__restrict__ *)))
37 if (! expect (0, typeid (int A::*)))
39 if (! expect (0, typeid (int A::**)))
42 if (! expect (8 | 0, typeid (B *)))
44 if (! expect (8 | 1, typeid (B const *)))
46 if (! expect (8 | 2, typeid (B volatile *)))
48 if (! expect (8 | 4, typeid (B *__restrict__ *)))
50 if (! expect (16 | 0, typeid (int B::*)))
52 if (! expect (8 | 0, typeid (int B::**)))
54 if (! expect (8 | 0, typeid (B A::*)))
56 if (! expect (24, typeid (B B::*)))