1 //===----------------------------------------------------------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 // UNSUPPORTED: libcpp-no-rtti
11 
12 // "support/test_macros.hpp"
13 
14 // #define TEST_HAS_NO_RTTI
15 
16 #include "test_macros.h"
17 
18 #if defined(TEST_HAS_NO_RTTI)
19 #error Macro defined unexpectedly
20 #endif
21 
~AA22 struct A { virtual ~A() {} };
23 struct B : A {};
24 
main()25 int main() {
26     A* ptr = new B;
27     (void)dynamic_cast<B*>(ptr);
28     delete ptr;
29 }
30