[HLSL] Implement RWBuffer::operator[] via __builtin_hlsl_resource_getpointer (#117017)
[llvm-project.git] / libcxx / test / support / test.support / test_macros_header.no_rtti.verify.cpp
blob8790c73416e08aa4d8f2afb4507eda8a7746eae3
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 // Make sure the TEST_HAS_NO_RTTI macro is defined when the no-rtti Lit feature
10 // is defined.
12 // REQUIRES: no-rtti
14 #include "test_macros.h"
16 #ifndef TEST_HAS_NO_RTTI
17 # error "TEST_HAS_NO_RTTI should be defined"
18 #endif
20 struct A { virtual ~A() { } };
21 struct B : A { };
23 void f() {
24 A* ptr = new B;
25 (void)dynamic_cast<B*>(ptr); // expected-error{{use of dynamic_cast requires -frtti}}