[libcxxabi] r226691 - Rename all of the tests in preparation for merging lit configs with libcxx
Jonathan Roelofs
jonathan at codesourcery.com
Wed Jan 21 11:05:38 PST 2015
Author: jroelofs
Date: Wed Jan 21 13:05:37 2015
New Revision: 226691
URL: http://llvm.org/viewvc/llvm-project?rev=226691&view=rev
Log:
Rename all of the tests in preparation for merging lit configs with libcxx
http://reviews.llvm.org/D7101
Added:
libcxxabi/trunk/test/backtrace_test.pass.cpp
- copied unchanged from r226682, libcxxabi/trunk/test/backtrace_test.cpp
libcxxabi/trunk/test/catch_array_01.pass.cpp
- copied unchanged from r226682, libcxxabi/trunk/test/catch_array_01.cpp
libcxxabi/trunk/test/catch_array_02.pass.cpp
- copied unchanged from r226682, libcxxabi/trunk/test/catch_array_02.cpp
libcxxabi/trunk/test/catch_class_01.pass.cpp
- copied unchanged from r226682, libcxxabi/trunk/test/catch_class_01.cpp
libcxxabi/trunk/test/catch_class_02.pass.cpp
- copied unchanged from r226682, libcxxabi/trunk/test/catch_class_02.cpp
libcxxabi/trunk/test/catch_class_03.pass.cpp
- copied unchanged from r226682, libcxxabi/trunk/test/catch_class_03.cpp
libcxxabi/trunk/test/catch_class_04.pass.cpp
- copied unchanged from r226682, libcxxabi/trunk/test/catch_class_04.cpp
libcxxabi/trunk/test/catch_const_pointer_nullptr.pass.cpp
- copied unchanged from r226682, libcxxabi/trunk/test/catch_const_pointer_nullptr.cpp
libcxxabi/trunk/test/catch_function_01.pass.cpp
- copied unchanged from r226682, libcxxabi/trunk/test/catch_function_01.cpp
libcxxabi/trunk/test/catch_function_02.pass.cpp
- copied unchanged from r226682, libcxxabi/trunk/test/catch_function_02.cpp
libcxxabi/trunk/test/catch_in_noexcept.pass.cpp
- copied unchanged from r226682, libcxxabi/trunk/test/catch_in_noexcept.cpp
libcxxabi/trunk/test/catch_member_data_pointer_01.pass.cpp
- copied unchanged from r226682, libcxxabi/trunk/test/catch_member_data_pointer_01.cpp
libcxxabi/trunk/test/catch_member_function_pointer_01.pass.cpp
- copied unchanged from r226682, libcxxabi/trunk/test/catch_member_function_pointer_01.cpp
libcxxabi/trunk/test/catch_member_pointer_nullptr.pass.cpp
- copied unchanged from r226682, libcxxabi/trunk/test/catch_member_pointer_nullptr.cpp
libcxxabi/trunk/test/catch_pointer_nullptr.pass.cpp
- copied unchanged from r226682, libcxxabi/trunk/test/catch_pointer_nullptr.cpp
libcxxabi/trunk/test/catch_pointer_reference.pass.cpp
- copied unchanged from r226682, libcxxabi/trunk/test/catch_pointer_reference.cpp
libcxxabi/trunk/test/catch_ptr.pass.cpp
- copied unchanged from r226682, libcxxabi/trunk/test/catch_ptr.cpp
libcxxabi/trunk/test/catch_ptr_02.pass.cpp
- copied unchanged from r226682, libcxxabi/trunk/test/catch_ptr_02.cpp
libcxxabi/trunk/test/cxa_thread_atexit_test.pass.cpp
- copied unchanged from r226682, libcxxabi/trunk/test/cxa_thread_atexit_test.cpp
libcxxabi/trunk/test/dynamic_cast14.pass.cpp
- copied unchanged from r226682, libcxxabi/trunk/test/dynamic_cast14.cpp
libcxxabi/trunk/test/dynamic_cast3.pass.cpp
- copied unchanged from r226682, libcxxabi/trunk/test/dynamic_cast3.cpp
libcxxabi/trunk/test/dynamic_cast5.pass.cpp
- copied unchanged from r226682, libcxxabi/trunk/test/dynamic_cast5.cpp
libcxxabi/trunk/test/dynamic_cast_stress.pass.cpp
- copied unchanged from r226682, libcxxabi/trunk/test/dynamic_cast_stress.cpp
libcxxabi/trunk/test/inherited_exception.pass.cpp
- copied unchanged from r226682, libcxxabi/trunk/test/inherited_exception.cpp
libcxxabi/trunk/test/test_aux_runtime.pass.cpp
- copied unchanged from r226682, libcxxabi/trunk/test/test_aux_runtime.cpp
libcxxabi/trunk/test/test_aux_runtime_op_array_new.pass.cpp
- copied unchanged from r226682, libcxxabi/trunk/test/test_aux_runtime_op_array_new.cpp
libcxxabi/trunk/test/test_demangle.pass.cpp
- copied unchanged from r226682, libcxxabi/trunk/test/test_demangle.cpp
libcxxabi/trunk/test/test_exception_storage.pass.cpp
- copied unchanged from r226682, libcxxabi/trunk/test/test_exception_storage.cpp
libcxxabi/trunk/test/test_fallback_malloc.pass.cpp
- copied unchanged from r226682, libcxxabi/trunk/test/test_fallback_malloc.cpp
libcxxabi/trunk/test/test_guard.pass.cpp
- copied unchanged from r226682, libcxxabi/trunk/test/test_guard.cpp
libcxxabi/trunk/test/test_vector1.pass.cpp
- copied unchanged from r226682, libcxxabi/trunk/test/test_vector1.cpp
libcxxabi/trunk/test/test_vector2.pass.cpp
- copied unchanged from r226682, libcxxabi/trunk/test/test_vector2.cpp
libcxxabi/trunk/test/test_vector3.pass.cpp
- copied unchanged from r226682, libcxxabi/trunk/test/test_vector3.cpp
libcxxabi/trunk/test/unwind_01.pass.cpp
- copied unchanged from r226682, libcxxabi/trunk/test/unwind_01.cpp
libcxxabi/trunk/test/unwind_02.pass.cpp
- copied unchanged from r226682, libcxxabi/trunk/test/unwind_02.cpp
libcxxabi/trunk/test/unwind_03.pass.cpp
- copied unchanged from r226682, libcxxabi/trunk/test/unwind_03.cpp
libcxxabi/trunk/test/unwind_04.pass.cpp
- copied unchanged from r226682, libcxxabi/trunk/test/unwind_04.cpp
libcxxabi/trunk/test/unwind_05.pass.cpp
- copied unchanged from r226682, libcxxabi/trunk/test/unwind_05.cpp
libcxxabi/trunk/test/unwind_06.pass.cpp
- copied unchanged from r226682, libcxxabi/trunk/test/unwind_06.cpp
Removed:
libcxxabi/trunk/test/backtrace_test.cpp
libcxxabi/trunk/test/catch_array_01.cpp
libcxxabi/trunk/test/catch_array_02.cpp
libcxxabi/trunk/test/catch_class_01.cpp
libcxxabi/trunk/test/catch_class_02.cpp
libcxxabi/trunk/test/catch_class_03.cpp
libcxxabi/trunk/test/catch_class_04.cpp
libcxxabi/trunk/test/catch_const_pointer_nullptr.cpp
libcxxabi/trunk/test/catch_function_01.cpp
libcxxabi/trunk/test/catch_function_02.cpp
libcxxabi/trunk/test/catch_in_noexcept.cpp
libcxxabi/trunk/test/catch_member_data_pointer_01.cpp
libcxxabi/trunk/test/catch_member_function_pointer_01.cpp
libcxxabi/trunk/test/catch_member_pointer_nullptr.cpp
libcxxabi/trunk/test/catch_pointer_nullptr.cpp
libcxxabi/trunk/test/catch_pointer_reference.cpp
libcxxabi/trunk/test/catch_ptr.cpp
libcxxabi/trunk/test/catch_ptr_02.cpp
libcxxabi/trunk/test/cxa_thread_atexit_test.cpp
libcxxabi/trunk/test/dynamic_cast14.cpp
libcxxabi/trunk/test/dynamic_cast3.cpp
libcxxabi/trunk/test/dynamic_cast5.cpp
libcxxabi/trunk/test/dynamic_cast_stress.cpp
libcxxabi/trunk/test/inherited_exception.cpp
libcxxabi/trunk/test/test_aux_runtime.cpp
libcxxabi/trunk/test/test_aux_runtime_op_array_new.cpp
libcxxabi/trunk/test/test_demangle.cpp
libcxxabi/trunk/test/test_exception_storage.cpp
libcxxabi/trunk/test/test_fallback_malloc.cpp
libcxxabi/trunk/test/test_guard.cpp
libcxxabi/trunk/test/test_vector1.cpp
libcxxabi/trunk/test/test_vector2.cpp
libcxxabi/trunk/test/test_vector3.cpp
libcxxabi/trunk/test/unwind_01.cpp
libcxxabi/trunk/test/unwind_02.cpp
libcxxabi/trunk/test/unwind_03.cpp
libcxxabi/trunk/test/unwind_04.cpp
libcxxabi/trunk/test/unwind_05.cpp
libcxxabi/trunk/test/unwind_06.cpp
Modified:
libcxxabi/trunk/test/testit
Removed: libcxxabi/trunk/test/backtrace_test.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/backtrace_test.cpp?rev=226690&view=auto
==============================================================================
--- libcxxabi/trunk/test/backtrace_test.cpp (original)
+++ libcxxabi/trunk/test/backtrace_test.cpp (removed)
@@ -1,63 +0,0 @@
-//===---------------------- backtrace_test.cpp ----------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-// XFAIL: arm
-#include <assert.h>
-#include <stddef.h>
-#include <unwind.h>
-
-extern "C" _Unwind_Reason_Code
-trace_function(struct _Unwind_Context* context, void* ntraced) {
- (*reinterpret_cast<size_t*>(ntraced))++;
- // We should never have a call stack this deep...
- assert(*reinterpret_cast<size_t*>(ntraced) < 20);
- return _URC_NO_REASON;
-}
-
-void call3_throw(size_t* ntraced) {
- try {
- _Unwind_Backtrace(trace_function, ntraced);
- } catch (...) {
- assert(false);
- }
-}
-
-void call3_nothrow(size_t* ntraced) {
- _Unwind_Backtrace(trace_function, ntraced);
-}
-
-void call2(size_t* ntraced, bool do_throw) {
- if (do_throw) {
- call3_throw(ntraced);
- } else {
- call3_nothrow(ntraced);
- }
-}
-
-void call1(size_t* ntraced, bool do_throw) {
- call2(ntraced, do_throw);
-}
-
-int main() {
- size_t throw_ntraced = 0;
- size_t nothrow_ntraced = 0;
-
- call1(¬hrow_ntraced, false);
-
- try {
- call1(&throw_ntraced, true);
- } catch (...) {
- assert(false);
- }
-
- // Different platforms (and different runtimes) will unwind a different number
- // of times, so we can't make any better assumptions than this.
- assert(nothrow_ntraced > 1);
- assert(throw_ntraced == nothrow_ntraced); // Make sure we unwind through catch
- return 0;
-}
Removed: libcxxabi/trunk/test/catch_array_01.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/catch_array_01.cpp?rev=226690&view=auto
==============================================================================
--- libcxxabi/trunk/test/catch_array_01.cpp (original)
+++ libcxxabi/trunk/test/catch_array_01.cpp (removed)
@@ -1,30 +0,0 @@
-//===---------------------- catch_array_01.cpp ----------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// Can you have a catch clause of array type that catches anything?
-
-#include <cassert>
-
-int main()
-{
- typedef char Array[4];
- Array a = {'H', 'i', '!', 0};
- try
- {
- throw a; // converts to char*
- assert(false);
- }
- catch (Array& b) // can't catch char*
- {
- assert(false);
- }
- catch (...)
- {
- }
-}
Removed: libcxxabi/trunk/test/catch_array_02.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/catch_array_02.cpp?rev=226690&view=auto
==============================================================================
--- libcxxabi/trunk/test/catch_array_02.cpp (original)
+++ libcxxabi/trunk/test/catch_array_02.cpp (removed)
@@ -1,30 +0,0 @@
-//===---------------------- catch_array_02.cpp ----------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// Can you have a catch clause of array type that catches anything?
-
-#include <cassert>
-
-int main()
-{
- typedef char Array[4];
- Array a = {'H', 'i', '!', 0};
- try
- {
- throw a; // converts to char*
- assert(false);
- }
- catch (Array b) // equivalent to char*
- {
- }
- catch (...)
- {
- assert(false);
- }
-}
Removed: libcxxabi/trunk/test/catch_class_01.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/catch_class_01.cpp?rev=226690&view=auto
==============================================================================
--- libcxxabi/trunk/test/catch_class_01.cpp (original)
+++ libcxxabi/trunk/test/catch_class_01.cpp (removed)
@@ -1,58 +0,0 @@
-//===---------------------- catch_class_01.cpp ----------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include <exception>
-#include <stdlib.h>
-#include <assert.h>
-
-struct A
-{
- static int count;
- int id_;
- explicit A(int id) : id_(id) {count++;}
- A(const A& a) : id_(a.id_) {count++;}
- ~A() {count--;}
-};
-
-int A::count = 0;
-
-void f1()
-{
- throw A(3);
-}
-
-void f2()
-{
- try
- {
- assert(A::count == 0);
- f1();
- }
- catch (A a)
- {
- assert(A::count != 0);
- assert(a.id_ == 3);
- throw;
- }
-}
-
-int main()
-{
- try
- {
- f2();
- assert(false);
- }
- catch (const A& a)
- {
- assert(A::count != 0);
- assert(a.id_ == 3);
- }
- assert(A::count == 0);
-}
Removed: libcxxabi/trunk/test/catch_class_02.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/catch_class_02.cpp?rev=226690&view=auto
==============================================================================
--- libcxxabi/trunk/test/catch_class_02.cpp (original)
+++ libcxxabi/trunk/test/catch_class_02.cpp (removed)
@@ -1,83 +0,0 @@
-//===---------------------- catch_class_02.cpp ----------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include <exception>
-#include <stdlib.h>
-#include <assert.h>
-
-struct B
-{
- static int count;
- int id_;
- explicit B(int id) : id_(id) {count++;}
- B(const B& a) : id_(a.id_) {count++;}
- ~B() {count--;}
-};
-
-int B::count = 0;
-
-struct A
- : B
-{
- static int count;
- int id_;
- explicit A(int id) : B(id-1), id_(id) {count++;}
- A(const A& a) : B(a.id_-1), id_(a.id_) {count++;}
- ~A() {count--;}
-};
-
-int A::count = 0;
-
-void f1()
-{
- assert(A::count == 0);
- assert(B::count == 0);
- A a(3);
- assert(A::count == 1);
- assert(B::count == 1);
- throw a;
- assert(false);
-}
-
-void f2()
-{
- try
- {
- assert(A::count == 0);
- f1();
- assert(false);
- }
- catch (A a)
- {
- assert(A::count != 0);
- assert(B::count != 0);
- assert(a.id_ == 3);
- throw;
- }
- catch (B b)
- {
- assert(false);
- }
-}
-
-int main()
-{
- try
- {
- f2();
- assert(false);
- }
- catch (const B& b)
- {
- assert(B::count != 0);
- assert(b.id_ == 2);
- }
- assert(A::count == 0);
- assert(B::count == 0);
-}
Removed: libcxxabi/trunk/test/catch_class_03.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/catch_class_03.cpp?rev=226690&view=auto
==============================================================================
--- libcxxabi/trunk/test/catch_class_03.cpp (original)
+++ libcxxabi/trunk/test/catch_class_03.cpp (removed)
@@ -1,190 +0,0 @@
-//===---------------------- catch_class_03.cpp ----------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-/*
- This test checks that adjustedPtr is correct as there exist offsets in this
- object for the various subobjects, all of which have a unique id_ to
- check against.
-*/
-
-#include <exception>
-#include <stdlib.h>
-#include <assert.h>
-
-struct B
-{
- static int count;
- int id_;
- explicit B(int id) : id_(id) {count++;}
- B(const B& a) : id_(a.id_) {count++;}
- ~B() {count--;}
-};
-
-int B::count = 0;
-
-struct C1
- : B
-{
- static int count;
- int id_;
- explicit C1(int id) : B(id-2), id_(id) {count++;}
- C1(const C1& a) : B(a.id_-2), id_(a.id_) {count++;}
- ~C1() {count--;}
-};
-
-int C1::count = 0;
-
-struct C2
- : B
-{
- static int count;
- int id_;
- explicit C2(int id) : B(id-2), id_(id) {count++;}
- C2(const C2& a) : B(a.id_-2), id_(a.id_) {count++;}
- ~C2() {count--;}
-};
-
-int C2::count = 0;
-
-struct A
- : C1, C2
-{
- static int count;
- int id_;
- explicit A(int id) : C1(id-1), C2(id-2), id_(id) {count++;}
- A(const A& a) : C1(a.id_-1), C2(a.id_-2), id_(a.id_) {count++;}
- ~A() {count--;}
-};
-
-int A::count = 0;
-
-void f1()
-{
- assert(A::count == 0);
- assert(C1::count == 0);
- assert(C2::count == 0);
- assert(B::count == 0);
- A a(5);
- assert(A::count == 1);
- assert(C1::count == 1);
- assert(C2::count == 1);
- assert(B::count == 2);
-
- assert(a.id_ == 5);
- assert(static_cast<C1&>(a).id_ == 4);
- assert(static_cast<C2&>(a).id_ == 3);
- assert(static_cast<B&>(static_cast<C1&>(a)).id_ == 2);
- assert(static_cast<B&>(static_cast<C2&>(a)).id_ == 1);
- throw a;
- assert(false);
-}
-
-void f2()
-{
- try
- {
- assert(A::count == 0);
- assert(C1::count == 0);
- assert(C2::count == 0);
- assert(B::count == 0);
- f1();
- assert(false);
- }
- catch (const A& a) // can catch A
- {
- assert(a.id_ == 5);
- assert(static_cast<const C1&>(a).id_ == 4);
- assert(static_cast<const C2&>(a).id_ == 3);
- assert(static_cast<const B&>(static_cast<const C1&>(a)).id_ == 2);
- assert(static_cast<const B&>(static_cast<const C2&>(a)).id_ == 1);
- throw;
- }
- catch (const C1&)
- {
- assert(false);
- }
- catch (const C2&)
- {
- assert(false);
- }
- catch (const B&)
- {
- assert(false);
- }
-}
-
-void f3()
-{
- try
- {
- assert(A::count == 0);
- assert(C1::count == 0);
- assert(C2::count == 0);
- assert(B::count == 0);
- f2();
- assert(false);
- }
- catch (const B& a) // can not catch B (ambiguous base)
- {
- assert(false);
- }
- catch (const C1& c1) // can catch C1
- {
- assert(c1.id_ == 4);
- assert(static_cast<const B&>(c1).id_ == 2);
- throw;
- }
- catch (const C2&)
- {
- assert(false);
- }
-}
-
-void f4()
-{
- try
- {
- assert(A::count == 0);
- assert(C1::count == 0);
- assert(C2::count == 0);
- assert(B::count == 0);
- f3();
- assert(false);
- }
- catch (const B& a) // can not catch B (ambiguous base)
- {
- assert(false);
- }
- catch (const C2& c2) // can catch C2
- {
- assert(c2.id_ == 3);
- assert(static_cast<const B&>(c2).id_ == 1);
- throw;
- }
- catch (const C1&)
- {
- assert(false);
- }
-}
-
-int main()
-{
- try
- {
- f4();
- assert(false);
- }
- catch (...)
- {
- }
- assert(A::count == 0);
- assert(C1::count == 0);
- assert(C2::count == 0);
- assert(B::count == 0);
-}
Removed: libcxxabi/trunk/test/catch_class_04.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/catch_class_04.cpp?rev=226690&view=auto
==============================================================================
--- libcxxabi/trunk/test/catch_class_04.cpp (original)
+++ libcxxabi/trunk/test/catch_class_04.cpp (removed)
@@ -1,213 +0,0 @@
-//===---------------------- catch_class_04.cpp ----------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-/*
- This test checks that adjustedPtr is correct as there exist offsets in this
- object for the various subobjects, all of which have a unique id_ to
- check against. It also checks that virtual bases work properly
-*/
-
-#include <exception>
-#include <stdlib.h>
-#include <assert.h>
-
-struct B
-{
- static int count;
- int id_;
- explicit B(int id) : id_(id) {count++;}
- B(const B& a) : id_(a.id_) {count++;}
- ~B() {count--;}
-};
-
-int B::count = 0;
-
-struct C1
- : virtual B
-{
- static int count;
- int id_;
- explicit C1(int id) : B(id-2), id_(id) {count++;}
- C1(const C1& a) : B(a.id_-2), id_(a.id_) {count++;}
- ~C1() {count--;}
-};
-
-int C1::count = 0;
-
-struct C2
- : virtual private B
-{
- static int count;
- int id_;
- explicit C2(int id) : B(id-2), id_(id) {count++;}
- C2(const C2& a) : B(a.id_-2), id_(a.id_) {count++;}
- ~C2() {count--;}
-};
-
-int C2::count = 0;
-
-struct A
- : C1, C2
-{
- static int count;
- int id_;
- explicit A(int id) : C1(id-1), C2(id-2), B(id+3), id_(id) {count++;}
- A(const A& a) : C1(a.id_-1), C2(a.id_-2), B(a.id_+3), id_(a.id_) {count++;}
- ~A() {count--;}
-};
-
-int A::count = 0;
-
-void f1()
-{
- assert(A::count == 0);
- assert(C1::count == 0);
- assert(C2::count == 0);
- assert(B::count == 0);
- A a(5);
- assert(A::count == 1);
- assert(C1::count == 1);
- assert(C2::count == 1);
- assert(B::count == 1);
-
- assert(a.id_ == 5);
- assert(static_cast<C1&>(a).id_ == 4);
- assert(static_cast<C2&>(a).id_ == 3);
- assert(static_cast<B&>(a).id_ == 8);
- throw a;
- assert(false);
-}
-
-void f2()
-{
- try
- {
- assert(A::count == 0);
- assert(C1::count == 0);
- assert(C2::count == 0);
- assert(B::count == 0);
- f1();
- assert(false);
- }
- catch (const A& a) // can catch A
- {
- assert(a.id_ == 5);
- assert(static_cast<const C1&>(a).id_ == 4);
- assert(static_cast<const C2&>(a).id_ == 3);
- assert(static_cast<const B&>(a).id_ == 8);
- throw;
- }
- catch (const C1&)
- {
- assert(false);
- }
- catch (const C2&)
- {
- assert(false);
- }
- catch (const B&)
- {
- assert(false);
- }
-}
-
-void f3()
-{
- try
- {
- assert(A::count == 0);
- assert(C1::count == 0);
- assert(C2::count == 0);
- assert(B::count == 0);
- f2();
- assert(false);
- }
- catch (const B& a) // can catch B
- {
- assert(static_cast<const B&>(a).id_ == 8);
- throw;
- }
- catch (const C1& c1)
- {
- assert(false);
- }
- catch (const C2&)
- {
- assert(false);
- }
-}
-
-void f4()
-{
- try
- {
- assert(A::count == 0);
- assert(C1::count == 0);
- assert(C2::count == 0);
- assert(B::count == 0);
- f3();
- assert(false);
- }
- catch (const C2& c2) // can catch C2
- {
- assert(c2.id_ == 3);
- throw;
- }
- catch (const B& a) // can not catch B (ambiguous base)
- {
- assert(false);
- }
- catch (const C1&)
- {
- assert(false);
- }
-}
-
-void f5()
-{
- try
- {
- assert(A::count == 0);
- assert(C1::count == 0);
- assert(C2::count == 0);
- assert(B::count == 0);
- f4();
- assert(false);
- }
- catch (const C1& c1) // can catch C1
- {
- assert(c1.id_ == 4);
- assert(static_cast<const B&>(c1).id_ == 8);
- throw;
- }
- catch (const B& a)
- {
- assert(false);
- }
- catch (const C2&)
- {
- assert(false);
- }
-}
-
-int main()
-{
- try
- {
- f5();
- assert(false);
- }
- catch (...)
- {
- }
- assert(A::count == 0);
- assert(C1::count == 0);
- assert(C2::count == 0);
- assert(B::count == 0);
-}
Removed: libcxxabi/trunk/test/catch_const_pointer_nullptr.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/catch_const_pointer_nullptr.cpp?rev=226690&view=auto
==============================================================================
--- libcxxabi/trunk/test/catch_const_pointer_nullptr.cpp (original)
+++ libcxxabi/trunk/test/catch_const_pointer_nullptr.cpp (removed)
@@ -1,133 +0,0 @@
-//===--------------------- catch_const_pointer_nullptr.cpp ----------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include <cassert>
-
-#if __has_feature(cxx_nullptr)
-
-struct A {};
-
-void test1()
-{
- try
- {
- throw nullptr;
- assert(false);
- }
- catch (A*)
- {
- }
- catch (const A*)
- {
- assert(false);
- }
-}
-
-
-void test2()
-{
- try
- {
- throw nullptr;
- assert(false);
- }
- catch (const A*)
- {
- }
- catch (A*)
- {
- assert(false);
- }
-}
-
-void test3()
-{
- try
- {
- throw nullptr;
- assert(false);
- }
- catch (const A* const)
- {
- }
- catch (A*)
- {
- assert(false);
- }
-}
-
-void test4()
-{
- try
- {
- throw nullptr;
- assert(false);
- }
- catch (A*)
- {
- }
- catch (const A* const)
- {
- assert(false);
- }
-}
-
-void test5()
-{
- try
- {
- throw nullptr;
- assert(false);
- }
- catch (A const*)
- {
- }
- catch (A*)
- {
- assert(false);
- }
-}
-
-void test6()
-{
- try
- {
- throw nullptr;
- assert(false);
- }
- catch (A*)
- {
- }
- catch (A const*)
- {
- assert(false);
- }
-}
-
-
-#else
-
-void test1() {}
-void test2() {}
-void test3() {}
-void test4() {}
-void test5() {}
-void test6() {}
-
-#endif
-
-int main()
-{
- test1();
- test2();
- test3();
- test4();
- test5();
- test6();
-}
Removed: libcxxabi/trunk/test/catch_function_01.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/catch_function_01.cpp?rev=226690&view=auto
==============================================================================
--- libcxxabi/trunk/test/catch_function_01.cpp (original)
+++ libcxxabi/trunk/test/catch_function_01.cpp (removed)
@@ -1,31 +0,0 @@
-//===----------------------- catch_function_01.cpp ------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// Can you have a catch clause of array type that catches anything?
-
-#include <cassert>
-
-void f() {}
-
-int main()
-{
- typedef void Function();
- try
- {
- throw f; // converts to void (*)()
- assert(false);
- }
- catch (Function& b) // can't catch void (*)()
- {
- assert(false);
- }
- catch (...)
- {
- }
-}
Removed: libcxxabi/trunk/test/catch_function_02.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/catch_function_02.cpp?rev=226690&view=auto
==============================================================================
--- libcxxabi/trunk/test/catch_function_02.cpp (original)
+++ libcxxabi/trunk/test/catch_function_02.cpp (removed)
@@ -1,31 +0,0 @@
-//===---------------------- catch_function_02.cpp -------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// Can you have a catch clause of array type that catches anything?
-
-#include <cassert>
-
-void f() {}
-
-int main()
-{
- typedef void Function();
- try
- {
- throw f; // converts to void (*)()
- assert(false);
- }
- catch (Function b) // equivalent to void (*)()
- {
- }
- catch (...)
- {
- assert(false);
- }
-}
Removed: libcxxabi/trunk/test/catch_in_noexcept.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/catch_in_noexcept.cpp?rev=226690&view=auto
==============================================================================
--- libcxxabi/trunk/test/catch_in_noexcept.cpp (original)
+++ libcxxabi/trunk/test/catch_in_noexcept.cpp (removed)
@@ -1,34 +0,0 @@
-//===---------------------- catch_in_noexcept.cpp--------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include <exception>
-#include <stdlib.h>
-#include <assert.h>
-
-struct A {};
-
-// Despite being marked as noexcept, this function must have an EHT entry that
-// is not 'cantunwind', so that the unwinder can correctly deal with the throw.
-void f1() noexcept
-{
- try {
- A a;
- throw a;
- assert(false);
- } catch (...) {
- assert(true);
- return;
- }
- assert(false);
-}
-
-int main()
-{
- f1();
-}
Removed: libcxxabi/trunk/test/catch_member_data_pointer_01.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/catch_member_data_pointer_01.cpp?rev=226690&view=auto
==============================================================================
--- libcxxabi/trunk/test/catch_member_data_pointer_01.cpp (original)
+++ libcxxabi/trunk/test/catch_member_data_pointer_01.cpp (removed)
@@ -1,57 +0,0 @@
-//===----------------- catch_member_data_pointer_01.cpp -------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include <cassert>
-
-struct A
-{
- const int i;
- int j;
-};
-
-typedef const int A::*md1;
-typedef int A::*md2;
-
-void test1()
-{
- try
- {
- throw &A::i;
- assert(false);
- }
- catch (md2)
- {
- assert(false);
- }
- catch (md1)
- {
- }
-}
-
-void test2()
-{
- try
- {
- throw &A::j;
- assert(false);
- }
- catch (md1)
- {
- assert(false);
- }
- catch (md2)
- {
- }
-}
-
-int main()
-{
- test1();
- test2();
-}
Removed: libcxxabi/trunk/test/catch_member_function_pointer_01.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/catch_member_function_pointer_01.cpp?rev=226690&view=auto
==============================================================================
--- libcxxabi/trunk/test/catch_member_function_pointer_01.cpp (original)
+++ libcxxabi/trunk/test/catch_member_function_pointer_01.cpp (removed)
@@ -1,57 +0,0 @@
-//===--------------- catch_member_function_pointer_01.cpp -----------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include <cassert>
-
-struct A
-{
- void foo() {}
- void bar() const {}
-};
-
-typedef void (A::*mf1)();
-typedef void (A::*mf2)() const;
-
-void test1()
-{
- try
- {
- throw &A::foo;
- assert(false);
- }
- catch (mf2)
- {
- assert(false);
- }
- catch (mf1)
- {
- }
-}
-
-void test2()
-{
- try
- {
- throw &A::bar;
- assert(false);
- }
- catch (mf1)
- {
- assert(false);
- }
- catch (mf2)
- {
- }
-}
-
-int main()
-{
- test1();
- test2();
-}
Removed: libcxxabi/trunk/test/catch_member_pointer_nullptr.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/catch_member_pointer_nullptr.cpp?rev=226690&view=auto
==============================================================================
--- libcxxabi/trunk/test/catch_member_pointer_nullptr.cpp (original)
+++ libcxxabi/trunk/test/catch_member_pointer_nullptr.cpp (removed)
@@ -1,71 +0,0 @@
-//===----------------- catch_member_pointer_nullptr.cpp -------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include <cassert>
-
-#if __has_feature(cxx_nullptr)
-
-struct A
-{
- const int i;
- int j;
-};
-
-typedef const int A::*md1;
-typedef int A::*md2;
-
-void test1()
-{
- try
- {
- throw nullptr;
- assert(false);
- }
- catch (md2)
- {
- }
- catch (md1)
- {
- assert(false);
- }
-}
-
-void test2()
-{
- try
- {
- throw nullptr;
- assert(false);
- }
- catch (md1)
- {
- }
- catch (md2)
- {
- assert(false);
- }
-}
-
-#else
-
-void test1()
-{
-}
-
-void test2()
-{
-}
-
-#endif
-
-int main()
-{
- test1();
- test2();
-}
Removed: libcxxabi/trunk/test/catch_pointer_nullptr.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/catch_pointer_nullptr.cpp?rev=226690&view=auto
==============================================================================
--- libcxxabi/trunk/test/catch_pointer_nullptr.cpp (original)
+++ libcxxabi/trunk/test/catch_pointer_nullptr.cpp (removed)
@@ -1,64 +0,0 @@
-//===--------------------- catch_pointer_nullptr.cpp ----------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include <cassert>
-
-#if __has_feature(cxx_nullptr)
-
-void test1()
-{
- try
- {
- throw nullptr;
- assert(false);
- }
- catch (int*)
- {
- }
- catch (long*)
- {
- assert(false);
- }
-}
-
-struct A {};
-
-void test2()
-{
- try
- {
- throw nullptr;
- assert(false);
- }
- catch (A*)
- {
- }
- catch (int*)
- {
- assert(false);
- }
-}
-
-#else
-
-void test1()
-{
-}
-
-void test2()
-{
-}
-
-#endif
-
-int main()
-{
- test1();
- test2();
-}
Removed: libcxxabi/trunk/test/catch_pointer_reference.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/catch_pointer_reference.cpp?rev=226690&view=auto
==============================================================================
--- libcxxabi/trunk/test/catch_pointer_reference.cpp (original)
+++ libcxxabi/trunk/test/catch_pointer_reference.cpp (removed)
@@ -1,444 +0,0 @@
-//===---------------------- catch_pointer_referece.cpp --------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This test case checks specifically the cases under bullet 3.1 & 3.2:
-//
-// C++ ABI 15.3:
-// A handler is a match for an exception object of type E if
-// * The handler is of type cv T or cv T& and E and T are the same type
-// (ignoring the top-level cv-qualifiers), or
-// * the handler is of type cv T or cv T& and T is an unambiguous base
-// class of E, or
-// / * the handler is of type cv1 T* cv2 and E is a pointer type that can \
-// | be converted to the type of the handler by either or both of |
-// | o a standard pointer conversion (4.10 [conv.ptr]) not involving |
-// | conversions to private or protected or ambiguous classes |
-// \ o a qualification conversion /
-// * the handler is a pointer or pointer to member type and E is
-// std::nullptr_t
-//
-//===----------------------------------------------------------------------===//
-
-#include <exception>
-#include <stdlib.h>
-#include <assert.h>
-#include <stdio.h>
-
-struct Base {};
-struct Derived : Base {};
-struct Derived2 : Base {};
-struct Ambiguous : Derived, Derived2 {};
-struct Private : private Base {};
-struct Protected : protected Base {};
-
-template <typename T // Handler type
- ,typename E // Thrown exception type
- ,typename O // Object type
- >
-void assert_catches()
-{
- try
- {
- O o;
- throw static_cast<E>(&o);
- printf("%s\n", __PRETTY_FUNCTION__);
- assert(false && "Statements after throw must be unreachable");
- }
- catch (T t)
- {
- assert(true);
- return;
- }
- catch (...)
- {
- printf("%s\n", __PRETTY_FUNCTION__);
- assert(false && "Should not have entered catch-all");
- }
-
- printf("%s\n", __PRETTY_FUNCTION__);
- assert(false && "The catch should have returned");
-}
-
-template <typename T // Handler type
- ,typename E // Thrown exception type
- ,typename O // Object type
- >
-void assert_cannot_catch()
-{
- try
- {
- O o;
- throw static_cast<E>(&o);
- printf("%s\n", __PRETTY_FUNCTION__);
- assert(false && "Statements after throw must be unreachable");
- }
- catch (T t)
- {
- printf("%s\n", __PRETTY_FUNCTION__);
- assert(false && "Should not have entered the catch");
- }
- catch (...)
- {
- assert(true);
- return;
- }
-
- printf("%s\n", __PRETTY_FUNCTION__);
- assert(false && "The catch-all should have returned");
-}
-
-void f1()
-{
- // Test that every combination of handler of type:
- // cv1 Base * cv2
- // catches an exception of type:
- // Derived *
- assert_catches< Base * , Derived *, Derived>();
- assert_catches<const Base * , Derived *, Derived>();
- assert_catches< volatile Base * , Derived *, Derived>();
- assert_catches<const volatile Base * , Derived *, Derived>();
- assert_catches< Base * const , Derived *, Derived>();
- assert_catches<const Base * const , Derived *, Derived>();
- assert_catches< volatile Base * const , Derived *, Derived>();
- assert_catches<const volatile Base * const , Derived *, Derived>();
- assert_catches< Base * volatile, Derived *, Derived>();
- assert_catches<const Base * volatile, Derived *, Derived>();
- assert_catches< volatile Base * volatile, Derived *, Derived>();
- assert_catches<const volatile Base * volatile, Derived *, Derived>();
- assert_catches< Base * const volatile, Derived *, Derived>();
- assert_catches<const Base * const volatile, Derived *, Derived>();
- assert_catches< volatile Base * const volatile, Derived *, Derived>();
- assert_catches<const volatile Base * const volatile, Derived *, Derived>();
-}
-
-void f2()
-{
- // Test that every combination of handler of type:
- // cv1 Base * cv2
- // catches an exception of type:
- // Base *
- assert_catches< Base * , Base *, Derived>();
- assert_catches<const Base * , Base *, Derived>();
- assert_catches< volatile Base * , Base *, Derived>();
- assert_catches<const volatile Base * , Base *, Derived>();
- assert_catches< Base * const , Base *, Derived>();
- assert_catches<const Base * const , Base *, Derived>();
- assert_catches< volatile Base * const , Base *, Derived>();
- assert_catches<const volatile Base * const , Base *, Derived>();
- assert_catches< Base * volatile, Base *, Derived>();
- assert_catches<const Base * volatile, Base *, Derived>();
- assert_catches< volatile Base * volatile, Base *, Derived>();
- assert_catches<const volatile Base * volatile, Base *, Derived>();
- assert_catches< Base * const volatile, Base *, Derived>();
- assert_catches<const Base * const volatile, Base *, Derived>();
- assert_catches< volatile Base * const volatile, Base *, Derived>();
- assert_catches<const volatile Base * const volatile, Base *, Derived>();
-}
-
-void f3()
-{
- // Test that every combination of handler of type:
- // cv1 Derived * cv2
- // catches an exception of type:
- // Derived *
- assert_catches< Derived * , Derived *, Derived>();
- assert_catches<const Derived * , Derived *, Derived>();
- assert_catches< volatile Derived * , Derived *, Derived>();
- assert_catches<const volatile Derived * , Derived *, Derived>();
- assert_catches< Derived * const , Derived *, Derived>();
- assert_catches<const Derived * const , Derived *, Derived>();
- assert_catches< volatile Derived * const , Derived *, Derived>();
- assert_catches<const volatile Derived * const , Derived *, Derived>();
- assert_catches< Derived * volatile, Derived *, Derived>();
- assert_catches<const Derived * volatile, Derived *, Derived>();
- assert_catches< volatile Derived * volatile, Derived *, Derived>();
- assert_catches<const volatile Derived * volatile, Derived *, Derived>();
- assert_catches< Derived * const volatile, Derived *, Derived>();
- assert_catches<const Derived * const volatile, Derived *, Derived>();
- assert_catches< volatile Derived * const volatile, Derived *, Derived>();
- assert_catches<const volatile Derived * const volatile, Derived *, Derived>();
-}
-
-void f4()
-{
- // Test that every combination of handler of type:
- // cv1 Derived * cv2
- // cannot catch an exception of type:
- // Base *
- assert_cannot_catch< Derived * , Base *, Derived>();
- assert_cannot_catch<const Derived * , Base *, Derived>();
- assert_cannot_catch< volatile Derived * , Base *, Derived>();
- assert_cannot_catch<const volatile Derived * , Base *, Derived>();
- assert_cannot_catch< Derived * const , Base *, Derived>();
- assert_cannot_catch<const Derived * const , Base *, Derived>();
- assert_cannot_catch< volatile Derived * const , Base *, Derived>();
- assert_cannot_catch<const volatile Derived * const , Base *, Derived>();
- assert_cannot_catch< Derived * volatile, Base *, Derived>();
- assert_cannot_catch<const Derived * volatile, Base *, Derived>();
- assert_cannot_catch< volatile Derived * volatile, Base *, Derived>();
- assert_cannot_catch<const volatile Derived * volatile, Base *, Derived>();
- assert_cannot_catch< Derived * const volatile, Base *, Derived>();
- assert_cannot_catch<const Derived * const volatile, Base *, Derived>();
- assert_cannot_catch< volatile Derived * const volatile, Base *, Derived>();
- assert_cannot_catch<const volatile Derived * const volatile, Base *, Derived>();
-}
-
-void f5()
-{
- // Test that every combination of handler of type:
- // cv1 Derived * cv2 &
- // catches an exception of type:
- // Derived *
- assert_catches< Derived * &, Derived *, Derived>();
- assert_catches<const Derived * &, Derived *, Derived>();
- assert_catches< volatile Derived * &, Derived *, Derived>();
- assert_catches<const volatile Derived * &, Derived *, Derived>();
- assert_catches< Derived * const &, Derived *, Derived>();
- assert_catches<const Derived * const &, Derived *, Derived>();
- assert_catches< volatile Derived * const &, Derived *, Derived>();
- assert_catches<const volatile Derived * const &, Derived *, Derived>();
- assert_catches< Derived * volatile &, Derived *, Derived>();
- assert_catches<const Derived * volatile &, Derived *, Derived>();
- assert_catches< volatile Derived * volatile &, Derived *, Derived>();
- assert_catches<const volatile Derived * volatile &, Derived *, Derived>();
- assert_catches< Derived * const volatile &, Derived *, Derived>();
- assert_catches<const Derived * const volatile &, Derived *, Derived>();
- assert_catches< volatile Derived * const volatile &, Derived *, Derived>();
- assert_catches<const volatile Derived * const volatile &, Derived *, Derived>();
-}
-
-void f6()
-{
- // Test that every combination of handler of type:
- // cv1 Base * cv2 &
- // catches an exception of type:
- // Base *
- assert_catches< Base * &, Base *, Derived>();
- assert_catches<const Base * &, Base *, Derived>();
- assert_catches< volatile Base * &, Base *, Derived>();
- assert_catches<const volatile Base * &, Base *, Derived>();
- assert_catches< Base * const &, Base *, Derived>();
- assert_catches<const Base * const &, Base *, Derived>();
- assert_catches< volatile Base * const &, Base *, Derived>();
- assert_catches<const volatile Base * const &, Base *, Derived>();
- assert_catches< Base * volatile &, Base *, Derived>();
- assert_catches<const Base * volatile &, Base *, Derived>();
- assert_catches< volatile Base * volatile &, Base *, Derived>();
- assert_catches<const volatile Base * volatile &, Base *, Derived>();
- assert_catches< Base * const volatile &, Base *, Derived>();
- assert_catches<const Base * const volatile &, Base *, Derived>();
- assert_catches< volatile Base * const volatile &, Base *, Derived>();
- assert_catches<const volatile Base * const volatile &, Base *, Derived>();
-
-}
-
-void f7()
-{
- // Test that every combination of handler of type:
- // cv1 Derived * cv2 &
- // cannot catch an exception of type:
- // Base *
- assert_cannot_catch< Derived * &, Base *, Derived>();
- assert_cannot_catch<const Derived * &, Base *, Derived>();
- assert_cannot_catch< volatile Derived * &, Base *, Derived>();
- assert_cannot_catch<const volatile Derived * &, Base *, Derived>();
- assert_cannot_catch< Derived * const &, Base *, Derived>();
- assert_cannot_catch<const Derived * const &, Base *, Derived>();
- assert_cannot_catch< volatile Derived * const &, Base *, Derived>();
- assert_cannot_catch<const volatile Derived * const &, Base *, Derived>();
- assert_cannot_catch< Derived * volatile &, Base *, Derived>();
- assert_cannot_catch<const Derived * volatile &, Base *, Derived>();
- assert_cannot_catch< volatile Derived * volatile &, Base *, Derived>();
- assert_cannot_catch<const volatile Derived * volatile &, Base *, Derived>();
- assert_cannot_catch< Derived * const volatile &, Base *, Derived>();
- assert_cannot_catch<const Derived * const volatile &, Base *, Derived>();
- assert_cannot_catch< volatile Derived * const volatile &, Base *, Derived>();
- assert_cannot_catch<const volatile Derived * const volatile &, Base *, Derived>();
-}
-
-void f8()
-{
- // This test case has a caveat noted in the discussion here:
- // https://gcc.gnu.org/ml/gcc-patches/2009-08/msg00264.html
- // Specifically:
- // This [test exposes a] corner case of the ARM C++ ABI. The generic C++
- // ABI also gets this wrong, because I failed to notice the subtlety here.
- // The issue is that 15.3/3 3rd bullet says:
- // The handler is of type cv1 T* cv2 and E is a pointer type that
- // can be converted to the type of the handler by either or both of:
- // * a standard pointer conversion (4.10) not involving conversions
- // to pointers to private or protected or ambiguous classes
- // Notice that the handlers of type "cv1 T*cv2&" are not allowed such
- // freedom to find a base class. The ABI error is that we treat handlers
- // of reference type exactly the same as the corresponding hander of
- // non-reference type. Elsewhere in the exception handling this makes no
- // difference (for instance bullet 1 explicitly says 'cv T or cv T&').
- //
- // See also: http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#388
- //
- // TL;DR: it is an unresolved C++ ABI defect that these do catch
-
- // Test that every combination of handler of type:
- // cv1 Base * cv2 &
- // catches an exception of type:
- // Derived *
- assert_catches< Base * &, Derived *, Derived>();
- assert_catches<const Base * &, Derived *, Derived>();
- assert_catches< volatile Base * &, Derived *, Derived>();
- assert_catches<const volatile Base * &, Derived *, Derived>();
- assert_catches< Base * const &, Derived *, Derived>();
- assert_catches<const Base * const &, Derived *, Derived>();
- assert_catches< volatile Base * const &, Derived *, Derived>();
- assert_catches<const volatile Base * const &, Derived *, Derived>();
- assert_catches< Base * volatile &, Derived *, Derived>();
- assert_catches<const Base * volatile &, Derived *, Derived>();
- assert_catches< volatile Base * volatile &, Derived *, Derived>();
- assert_catches<const volatile Base * volatile &, Derived *, Derived>();
- assert_catches< Base * const volatile &, Derived *, Derived>();
- assert_catches<const Base * const volatile &, Derived *, Derived>();
- assert_catches< volatile Base * const volatile &, Derived *, Derived>();
- assert_catches<const volatile Base * const volatile &, Derived *, Derived>();
-}
-
-void f9()
-{
- // Test that every combination of handler of type:
- // cv1 Base * cv2
- // cannot catch an exception of type:
- // Ambiguous *
- assert_cannot_catch< Base * , Ambiguous *, Ambiguous>();
- assert_cannot_catch<const Base * , Ambiguous *, Ambiguous>();
- assert_cannot_catch< volatile Base * , Ambiguous *, Ambiguous>();
- assert_cannot_catch<const volatile Base * , Ambiguous *, Ambiguous>();
- assert_cannot_catch< Base * const , Ambiguous *, Ambiguous>();
- assert_cannot_catch<const Base * const , Ambiguous *, Ambiguous>();
- assert_cannot_catch< volatile Base * const , Ambiguous *, Ambiguous>();
- assert_cannot_catch<const volatile Base * const , Ambiguous *, Ambiguous>();
- assert_cannot_catch< Base * volatile, Ambiguous *, Ambiguous>();
- assert_cannot_catch<const Base * volatile, Ambiguous *, Ambiguous>();
- assert_cannot_catch< volatile Base * volatile, Ambiguous *, Ambiguous>();
- assert_cannot_catch<const volatile Base * volatile, Ambiguous *, Ambiguous>();
- assert_cannot_catch< Base * const volatile, Ambiguous *, Ambiguous>();
- assert_cannot_catch<const Base * const volatile, Ambiguous *, Ambiguous>();
- assert_cannot_catch< volatile Base * const volatile, Ambiguous *, Ambiguous>();
- assert_cannot_catch<const volatile Base * const volatile, Ambiguous *, Ambiguous>();
-}
-
-void f10()
-{
- // Test that every combination of handler of type:
- // cv1 Base * cv2
- // cannot catch an exception of type:
- // Private *
- assert_cannot_catch< Base * , Private *, Private>();
- assert_cannot_catch<const Base * , Private *, Private>();
- assert_cannot_catch< volatile Base * , Private *, Private>();
- assert_cannot_catch<const volatile Base * , Private *, Private>();
- assert_cannot_catch< Base * const , Private *, Private>();
- assert_cannot_catch<const Base * const , Private *, Private>();
- assert_cannot_catch< volatile Base * const , Private *, Private>();
- assert_cannot_catch<const volatile Base * const , Private *, Private>();
- assert_cannot_catch< Base * volatile, Private *, Private>();
- assert_cannot_catch<const Base * volatile, Private *, Private>();
- assert_cannot_catch< volatile Base * volatile, Private *, Private>();
- assert_cannot_catch<const volatile Base * volatile, Private *, Private>();
- assert_cannot_catch< Base * const volatile, Private *, Private>();
- assert_cannot_catch<const Base * const volatile, Private *, Private>();
- assert_cannot_catch< volatile Base * const volatile, Private *, Private>();
- assert_cannot_catch<const volatile Base * const volatile, Private *, Private>();
-}
-
-void f11()
-{
- // Test that every combination of handler of type:
- // cv1 Base * cv2
- // cannot catch an exception of type:
- // Protected *
- assert_cannot_catch< Base * , Protected *, Protected>();
- assert_cannot_catch<const Base * , Protected *, Protected>();
- assert_cannot_catch< volatile Base * , Protected *, Protected>();
- assert_cannot_catch<const volatile Base * , Protected *, Protected>();
- assert_cannot_catch< Base * const , Protected *, Protected>();
- assert_cannot_catch<const Base * const , Protected *, Protected>();
- assert_cannot_catch< volatile Base * const , Protected *, Protected>();
- assert_cannot_catch<const volatile Base * const , Protected *, Protected>();
- assert_cannot_catch< Base * volatile, Protected *, Protected>();
- assert_cannot_catch<const Base * volatile, Protected *, Protected>();
- assert_cannot_catch< volatile Base * volatile, Protected *, Protected>();
- assert_cannot_catch<const volatile Base * volatile, Protected *, Protected>();
- assert_cannot_catch< Base * const volatile, Protected *, Protected>();
- assert_cannot_catch<const Base * const volatile, Protected *, Protected>();
- assert_cannot_catch< volatile Base * const volatile, Protected *, Protected>();
- assert_cannot_catch<const volatile Base * const volatile, Protected *, Protected>();
-}
-
-void f12()
-{
- // Test that every combination of handler of type:
- // cv1 Base * cv2 &
- // cannot catch an exception of type:
- // Private *
- assert_cannot_catch< Base * &, Private *, Private>();
- assert_cannot_catch<const Base * &, Private *, Private>();
- assert_cannot_catch< volatile Base * &, Private *, Private>();
- assert_cannot_catch<const volatile Base * &, Private *, Private>();
- assert_cannot_catch< Base * const &, Private *, Private>();
- assert_cannot_catch<const Base * const &, Private *, Private>();
- assert_cannot_catch< volatile Base * const &, Private *, Private>();
- assert_cannot_catch<const volatile Base * const &, Private *, Private>();
- assert_cannot_catch< Base * volatile &, Private *, Private>();
- assert_cannot_catch<const Base * volatile &, Private *, Private>();
- assert_cannot_catch< volatile Base * volatile &, Private *, Private>();
- assert_cannot_catch<const volatile Base * volatile &, Private *, Private>();
- assert_cannot_catch< Base * const volatile &, Private *, Private>();
- assert_cannot_catch<const Base * const volatile &, Private *, Private>();
- assert_cannot_catch< volatile Base * const volatile &, Private *, Private>();
- assert_cannot_catch<const volatile Base * const volatile &, Private *, Private>();
-}
-
-void f13()
-{
- // Test that every combination of handler of type:
- // cv1 Base * cv2 &
- // cannot catch an exception of type:
- // Protected *
- assert_cannot_catch< Base * &, Protected *, Protected>();
- assert_cannot_catch<const Base * &, Protected *, Protected>();
- assert_cannot_catch< volatile Base * &, Protected *, Protected>();
- assert_cannot_catch<const volatile Base * &, Protected *, Protected>();
- assert_cannot_catch< Base * const &, Protected *, Protected>();
- assert_cannot_catch<const Base * const &, Protected *, Protected>();
- assert_cannot_catch< volatile Base * const &, Protected *, Protected>();
- assert_cannot_catch<const volatile Base * const &, Protected *, Protected>();
- assert_cannot_catch< Base * volatile &, Protected *, Protected>();
- assert_cannot_catch<const Base * volatile &, Protected *, Protected>();
- assert_cannot_catch< volatile Base * volatile &, Protected *, Protected>();
- assert_cannot_catch<const volatile Base * volatile &, Protected *, Protected>();
- assert_cannot_catch< Base * const volatile &, Protected *, Protected>();
- assert_cannot_catch<const Base * const volatile &, Protected *, Protected>();
- assert_cannot_catch< volatile Base * const volatile &, Protected *, Protected>();
- assert_cannot_catch<const volatile Base * const volatile &, Protected *, Protected>();
-}
-
-int main()
-{
- f1();
- f2();
- f3();
- f4();
- f5();
- f6();
- f7();
- f8();
- f9();
- f10();
- f11();
- f12();
- f13();
-}
Removed: libcxxabi/trunk/test/catch_ptr.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/catch_ptr.cpp?rev=226690&view=auto
==============================================================================
--- libcxxabi/trunk/test/catch_ptr.cpp (original)
+++ libcxxabi/trunk/test/catch_ptr.cpp (removed)
@@ -1,181 +0,0 @@
-//===---------------------- catch_class_04.cpp ----------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-/*
- This test checks that adjustedPtr is correct as there exist offsets in this
- object for the various subobjects, all of which have a unique id_ to
- check against. It also checks that virtual bases work properly
-*/
-
-#include <exception>
-#include <stdlib.h>
-#include <assert.h>
-
-struct B
-{
- static int count;
- int id_;
- explicit B(int id) : id_(id) {count++;}
- B(const B& a) : id_(a.id_) {count++;}
- ~B() {count--;}
-};
-
-int B::count = 0;
-
-struct C1
- : virtual B
-{
- static int count;
- int id_;
- explicit C1(int id) : B(id-2), id_(id) {count++;}
- C1(const C1& a) : B(a.id_-2), id_(a.id_) {count++;}
- ~C1() {count--;}
-};
-
-int C1::count = 0;
-
-struct C2
- : virtual private B
-{
- static int count;
- int id_;
- explicit C2(int id) : B(id-2), id_(id) {count++;}
- C2(const C2& a) : B(a.id_-2), id_(a.id_) {count++;}
- ~C2() {count--;}
-};
-
-int C2::count = 0;
-
-struct A
- : C1, C2
-{
- static int count;
- int id_;
- explicit A(int id) : C1(id-1), C2(id-2), B(id+3), id_(id) {count++;}
- A(const A& a) : C1(a.id_-1), C2(a.id_-2), B(a.id_+3), id_(a.id_) {count++;}
- ~A() {count--;}
-};
-
-int A::count = 0;
-
-A a(5);
-
-void f1()
-{
- throw &a;
- assert(false);
-}
-
-void f2()
-{
- try
- {
- f1();
- assert(false);
- }
- catch (const A* a) // can catch A
- {
- assert(a->id_ == 5);
- assert(static_cast<const C1*>(a)->id_ == 4);
- assert(static_cast<const C2*>(a)->id_ == 3);
- assert(static_cast<const B*>(a)->id_ == 8);
- throw;
- }
- catch (const C1*)
- {
- assert(false);
- }
- catch (const C2*)
- {
- assert(false);
- }
- catch (const B*)
- {
- assert(false);
- }
-}
-
-void f3()
-{
- try
- {
- f2();
- assert(false);
- }
- catch (const B* a) // can catch B
- {
- assert(static_cast<const B*>(a)->id_ == 8);
- throw;
- }
- catch (const C1* c1)
- {
- assert(false);
- }
- catch (const C2*)
- {
- assert(false);
- }
-}
-
-void f4()
-{
- try
- {
- f3();
- assert(false);
- }
- catch (const C2* c2) // can catch C2
- {
- assert(c2->id_ == 3);
- throw;
- }
- catch (const B* a)
- {
- assert(false);
- }
- catch (const C1*)
- {
- assert(false);
- }
-}
-
-void f5()
-{
- try
- {
- f4();
- assert(false);
- }
- catch (const C1* c1) // can catch C1
- {
- assert(c1->id_ == 4);
- assert(static_cast<const B*>(c1)->id_ == 8);
- throw;
- }
- catch (const B* a)
- {
- assert(false);
- }
- catch (const C2*)
- {
- assert(false);
- }
-}
-
-int main()
-{
- try
- {
- f5();
- assert(false);
- }
- catch (...)
- {
- }
-}
Removed: libcxxabi/trunk/test/catch_ptr_02.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/catch_ptr_02.cpp?rev=226690&view=auto
==============================================================================
--- libcxxabi/trunk/test/catch_ptr_02.cpp (original)
+++ libcxxabi/trunk/test/catch_ptr_02.cpp (removed)
@@ -1,197 +0,0 @@
-//===------------------------- catch_ptr_02.cpp ---------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include <cassert>
-
-struct A {};
-A a;
-const A ca = A();
-
-void test1 ()
-{
- try
- {
- throw &a;
- assert(false);
- }
- catch ( const A* )
- {
- }
- catch ( A *)
- {
- assert (false);
- }
-}
-
-void test2 ()
-{
- try
- {
- throw &a;
- assert(false);
- }
- catch ( A* )
- {
- }
- catch ( const A *)
- {
- assert (false);
- }
-}
-
-void test3 ()
-{
- try
- {
- throw &ca;
- assert(false);
- }
- catch ( const A* )
- {
- }
- catch ( A *)
- {
- assert (false);
- }
-}
-
-void test4 ()
-{
- try
- {
- throw &ca;
- assert(false);
- }
- catch ( A *)
- {
- assert (false);
- }
- catch ( const A* )
- {
- }
-}
-
-struct base1 {int x;};
-struct base2 {int x;};
-struct derived : base1, base2 {};
-
-void test5 ()
-{
- try
- {
- throw (derived*)0;
- assert(false);
- }
- catch (base2 *p) {
- assert (p == 0);
- }
- catch (...)
- {
- assert (false);
- }
-}
-
-void test6 ()
-{
- try
- {
- throw nullptr;
- assert(false);
- }
- catch (base2 *p) {
- assert (p == nullptr);
- }
- catch (...)
- {
- assert (false);
- }
-}
-
-void test7 ()
-{
- try
- {
- throw (derived*)12;
- assert(false);
- }
- catch (base2 *p) {
- assert ((unsigned long)p == 12+sizeof(base1));
- }
- catch (...)
- {
- assert (false);
- }
-}
-
-
-struct vBase {};
-struct vDerived : virtual public vBase {};
-
-void test8 ()
-{
- vDerived derived;
- try
- {
- throw &derived;
- assert(false);
- }
- catch (vBase *p) {
- assert(p != 0);
- }
- catch (...)
- {
- assert (false);
- }
-}
-
-void test9 ()
-{
- try
- {
- throw nullptr;
- assert(false);
- }
- catch (vBase *p) {
- assert(p == 0);
- }
- catch (...)
- {
- assert (false);
- }
-}
-
-void test10 ()
-{
- try
- {
- throw (vDerived*)0;
- assert(false);
- }
- catch (vBase *p) {
- assert(p == 0);
- }
- catch (...)
- {
- assert (false);
- }
-}
-
-int main()
-{
- test1();
- test2();
- test3();
- test4();
- test5();
- test6();
- test7();
- test8();
- test9();
- test10();
-}
Removed: libcxxabi/trunk/test/cxa_thread_atexit_test.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/cxa_thread_atexit_test.cpp?rev=226690&view=auto
==============================================================================
--- libcxxabi/trunk/test/cxa_thread_atexit_test.cpp (original)
+++ libcxxabi/trunk/test/cxa_thread_atexit_test.cpp (removed)
@@ -1,33 +0,0 @@
-//===--------------------- cxa_thread_atexit_test.cpp ---------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// REQUIRES: linux2
-
-#include <assert.h>
-#include <cxxabi.h>
-
-static bool AtexitImplCalled = false;
-
-extern "C" int __cxa_thread_atexit_impl(void (*dtor)(void *), void *obj,
- void *dso_symbol) {
- assert(dtor == reinterpret_cast<void (*)(void *)>(1));
- assert(obj == reinterpret_cast<void *>(2));
- assert(dso_symbol == reinterpret_cast<void *>(3));
- AtexitImplCalled = true;
- return 4;
-}
-
-int main() {
- int RV = __cxxabiv1::__cxa_thread_atexit(
- reinterpret_cast<void (*)(void *)>(1), reinterpret_cast<void *>(2),
- reinterpret_cast<void *>(3));
- assert(RV = 4);
- assert(AtexitImplCalled);
- return 0;
-}
Removed: libcxxabi/trunk/test/dynamic_cast14.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/dynamic_cast14.cpp?rev=226690&view=auto
==============================================================================
--- libcxxabi/trunk/test/dynamic_cast14.cpp (original)
+++ libcxxabi/trunk/test/dynamic_cast14.cpp (removed)
@@ -1,2182 +0,0 @@
-//===------------------------- dynamic_cast14.cpp -------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include <cassert>
-#include "support/timer.hpp"
-
-namespace t1
-{
-
-struct A1
-{
- char _[43981];
- virtual ~A1() {}
-
- A1* getA1() {return this;}
-};
-
-struct A2
-{
- char _[34981];
- virtual ~A2() {}
-
- A2* getA2() {return this;}
-};
-
-struct A3
- : public A1,
- public virtual A2
-{
- char _[93481];
- virtual ~A3() {}
-
- A1* getA1_3() {return A1::getA1();}
- A2* getA2() {return A2::getA2();}
- A3* getA3() {return this;}
-};
-
-struct A4
- : public virtual A2,
- public A1
-{
- char _[13489];
- virtual ~A4() {}
-
- A1* getA1_4() {return A1::getA1();}
- A2* getA2() {return A2::getA2();}
- A4* getA4() {return this;}
-};
-
-struct A5
- : public A3,
- public A4
-{
- char _[13489];
- virtual ~A5() {}
-
- A1* getA1_3() {return A3::getA1();}
- A1* getA1_4() {return A4::getA1();}
- A2* getA2() {return A3::getA2();}
- A3* getA3() {return A3::getA3();}
- A4* getA4() {return A4::getA4();}
- A5* getA5() {return this;}
-};
-
-struct A6
- : public A1
-{
- char _[81349];
- virtual ~A6() {}
-
- A1* getA1_6() {return A1::getA1();}
- A6* getA6() {return this;}
-};
-
-struct A7
- : public A5,
- public A6
-{
- char _[34819];
- virtual ~A7() {}
-
- A1* getA1_3() {return A5::getA1_3();}
- A1* getA1_4() {return A5::getA1_4();}
- A1* getA1_6() {return A6::getA1_6();}
- A2* getA2() {return A5::getA2();}
- A3* getA3() {return A5::getA3();}
- A4* getA4() {return A5::getA4();}
- A5* getA5() {return A5::getA5();}
- A6* getA6() {return A6::getA6();}
- A7* getA7() {return this;}
-};
-
-struct A8
- : public A7
-{
- char _[3489];
- virtual ~A8() {}
-
- A1* getA1_3() {return A7::getA1_3();}
- A1* getA1_4() {return A7::getA1_4();}
- A1* getA1_6() {return A7::getA1_6();}
- A2* getA2() {return A7::getA2();}
- A3* getA3() {return A7::getA3();}
- A4* getA4() {return A7::getA4();}
- A5* getA5() {return A7::getA5();}
- A6* getA6() {return A7::getA6();}
- A7* getA7() {return A7::getA7();}
- A8* getA8() {return this;}
-};
-
-struct A9
- : public A1
-{
- char _[3481];
- virtual ~A9() {}
-
- A1* getA1_9() {return A1::getA1();}
- A9* getA9() {return this;}
-};
-
-struct A10
- : public virtual A8
-{
- char _[4831];
- virtual ~A10() {}
-
- A1* getA1_3() {return A8::getA1_3();}
- A1* getA1_4() {return A8::getA1_4();}
- A1* getA1_6() {return A8::getA1_6();}
- A2* getA2() {return A8::getA2();}
- A3* getA3() {return A8::getA3();}
- A4* getA4() {return A8::getA4();}
- A5* getA5() {return A8::getA5();}
- A6* getA6() {return A8::getA6();}
- A7* getA7() {return A8::getA7();}
- A8* getA8() {return A8::getA8();}
- A10* getA10() {return this;}
-};
-
-struct A11
- : public virtual A8,
- public A9
-{
- char _[6483];
- virtual ~A11() {}
-
- A1* getA1_3() {return A8::getA1_3();}
- A1* getA1_4() {return A8::getA1_4();}
- A1* getA1_6() {return A8::getA1_6();}
- A1* getA1_9() {return A9::getA1_9();}
- A2* getA2() {return A8::getA2();}
- A3* getA3() {return A8::getA3();}
- A4* getA4() {return A8::getA4();}
- A5* getA5() {return A8::getA5();}
- A6* getA6() {return A8::getA6();}
- A7* getA7() {return A8::getA7();}
- A8* getA8() {return A8::getA8();}
- A9* getA9() {return A9::getA9();}
- A11* getA11() {return this;}
-};
-
-struct A12
- : public A10,
- public A11
-{
- char _[2283];
- virtual ~A12() {}
-
- A1* getA1_3() {return A10::getA1_3();}
- A1* getA1_4() {return A10::getA1_4();}
- A1* getA1_6() {return A10::getA1_6();}
- A1* getA1_9() {return A11::getA1_9();}
- A2* getA2() {return A10::getA2();}
- A3* getA3() {return A10::getA3();}
- A4* getA4() {return A10::getA4();}
- A5* getA5() {return A10::getA5();}
- A6* getA6() {return A10::getA6();}
- A7* getA7() {return A10::getA7();}
- A8* getA8() {return A10::getA8();}
- A9* getA9() {return A11::getA9();}
- A10* getA10() {return A10::getA10();}
- A11* getA11() {return A11::getA11();}
- A12* getA12() {return this;}
-};
-
-struct A13
- : public A12
-{
- char _[1283];
- virtual ~A13() {}
-
- A1* getA1_3() {return A12::getA1_3();}
- A1* getA1_4() {return A12::getA1_4();}
- A1* getA1_6() {return A12::getA1_6();}
- A1* getA1_9() {return A12::getA1_9();}
- A2* getA2() {return A12::getA2();}
- A3* getA3() {return A12::getA3();}
- A4* getA4() {return A12::getA4();}
- A5* getA5() {return A12::getA5();}
- A6* getA6() {return A12::getA6();}
- A7* getA7() {return A12::getA7();}
- A8* getA8() {return A12::getA8();}
- A9* getA9() {return A12::getA9();}
- A10* getA10() {return A12::getA10();}
- A11* getA11() {return A12::getA11();}
- A12* getA12() {return A12::getA12();}
- A13* getA13() {return this;}
-};
-
-void test()
-{
- A3 a3;
- A4 a4;
- A5 a5;
- A6 a6;
- A7 a7;
- A8 a8;
- A9 a9;
- A10 a10;
- A11 a11;
- A12 a12;
- A13 a13;
-
- assert(dynamic_cast<A3*>(a3.getA1_3()) == a3.getA3());
- assert(dynamic_cast<A3*>(a3.getA2()) == a3.getA3());
-
- assert(dynamic_cast<A3*>(a4.getA1_4()) == 0);
- assert(dynamic_cast<A3*>(a4.getA2()) == 0);
- assert(dynamic_cast<A4*>(a4.getA1_4()) == a4.getA4());
- assert(dynamic_cast<A4*>(a4.getA2()) == a4.getA4());
-
- assert(dynamic_cast<A3*>(a5.getA1_3()) == a5.getA3());
- assert(dynamic_cast<A3*>(a5.getA2()) == a5.getA3());
-
- assert(dynamic_cast<A4*>(a5.getA1_3()) == a5.getA4());
- assert(dynamic_cast<A4*>(a5.getA1_4()) == a5.getA4());
- assert(dynamic_cast<A4*>(a5.getA3()) == a5.getA4());
- assert(dynamic_cast<A4*>(a5.getA3()) == a5.getA4());
-
- assert(dynamic_cast<A5*>(a5.getA1_3()) == a5.getA5());
- assert(dynamic_cast<A5*>(a5.getA1_4()) == a5.getA5());
- assert(dynamic_cast<A5*>(a5.getA3()) == a5.getA5());
- assert(dynamic_cast<A5*>(a5.getA3()) == a5.getA5());
- assert(dynamic_cast<A5*>(a5.getA3()) == a5.getA5());
- assert(dynamic_cast<A5*>(a5.getA4()) == a5.getA5());
-
- assert(dynamic_cast<A3*>(a6.getA1_6()) == 0);
-
- assert(dynamic_cast<A4*>(a6.getA1_6()) == 0);
-
- assert(dynamic_cast<A5*>(a6.getA1_6()) == 0);
-
- assert(dynamic_cast<A6*>(a6.getA1_6()) == a6.getA6());
-
- assert(dynamic_cast<A3*>(a7.getA1_3()) == a7.getA3());
- assert(dynamic_cast<A3*>(a7.getA1_4()) == a7.getA3());
- assert(dynamic_cast<A3*>(a7.getA2()) == a7.getA3());
-
- assert(dynamic_cast<A4*>(a7.getA1_3()) == a7.getA4());
- assert(dynamic_cast<A4*>(a7.getA1_4()) == a7.getA4());
- assert(dynamic_cast<A4*>(a7.getA2()) == a7.getA4());
- assert(dynamic_cast<A4*>(a7.getA3()) == a7.getA4());
-
- assert(dynamic_cast<A5*>(a7.getA1_3()) == a7.getA5());
- assert(dynamic_cast<A5*>(a7.getA1_4()) == a7.getA5());
- assert(dynamic_cast<A5*>(a7.getA2()) == a7.getA5());
- assert(dynamic_cast<A5*>(a7.getA3()) == a7.getA5());
- assert(dynamic_cast<A5*>(a7.getA4()) == a7.getA5());
-
- assert(dynamic_cast<A6*>(a7.getA1_3()) == a7.getA6());
- assert(dynamic_cast<A6*>(a7.getA1_4()) == a7.getA6());
- assert(dynamic_cast<A6*>(a7.getA1_6()) == a7.getA6());
- assert(dynamic_cast<A6*>(a7.getA2()) == a7.getA6());
- assert(dynamic_cast<A6*>(a7.getA3()) == a7.getA6());
- assert(dynamic_cast<A6*>(a7.getA4()) == a7.getA6());
- assert(dynamic_cast<A6*>(a7.getA5()) == a7.getA6());
-
- assert(dynamic_cast<A7*>(a7.getA1_3()) == a7.getA7());
- assert(dynamic_cast<A7*>(a7.getA1_4()) == a7.getA7());
- assert(dynamic_cast<A7*>(a7.getA1_6()) == a7.getA7());
- assert(dynamic_cast<A7*>(a7.getA2()) == a7.getA7());
- assert(dynamic_cast<A7*>(a7.getA3()) == a7.getA7());
- assert(dynamic_cast<A7*>(a7.getA4()) == a7.getA7());
- assert(dynamic_cast<A7*>(a7.getA5()) == a7.getA7());
- assert(dynamic_cast<A7*>(a7.getA6()) == a7.getA7());
-
- assert(dynamic_cast<A3*>(a8.getA1_3()) == a8.getA3());
- assert(dynamic_cast<A3*>(a8.getA1_4()) == a8.getA3());
- assert(dynamic_cast<A3*>(a8.getA2()) == a8.getA3());
-
- assert(dynamic_cast<A4*>(a8.getA1_3()) == a8.getA4());
- assert(dynamic_cast<A4*>(a8.getA1_4()) == a8.getA4());
- assert(dynamic_cast<A4*>(a8.getA2()) == a8.getA4());
- assert(dynamic_cast<A4*>(a8.getA3()) == a8.getA4());
-
- assert(dynamic_cast<A5*>(a8.getA1_3()) == a8.getA5());
- assert(dynamic_cast<A5*>(a8.getA1_4()) == a8.getA5());
- assert(dynamic_cast<A5*>(a8.getA2()) == a8.getA5());
- assert(dynamic_cast<A5*>(a8.getA3()) == a8.getA5());
- assert(dynamic_cast<A5*>(a8.getA4()) == a8.getA5());
-
- assert(dynamic_cast<A6*>(a8.getA1_3()) == a8.getA6());
- assert(dynamic_cast<A6*>(a8.getA1_4()) == a8.getA6());
- assert(dynamic_cast<A6*>(a8.getA1_6()) == a8.getA6());
- assert(dynamic_cast<A6*>(a8.getA2()) == a8.getA6());
- assert(dynamic_cast<A6*>(a8.getA3()) == a8.getA6());
- assert(dynamic_cast<A6*>(a8.getA4()) == a8.getA6());
- assert(dynamic_cast<A6*>(a8.getA5()) == a8.getA6());
-
- assert(dynamic_cast<A7*>(a8.getA1_3()) == a8.getA7());
- assert(dynamic_cast<A7*>(a8.getA1_4()) == a8.getA7());
- assert(dynamic_cast<A7*>(a8.getA1_6()) == a8.getA7());
- assert(dynamic_cast<A7*>(a8.getA2()) == a8.getA7());
- assert(dynamic_cast<A7*>(a8.getA3()) == a8.getA7());
- assert(dynamic_cast<A7*>(a8.getA4()) == a8.getA7());
- assert(dynamic_cast<A7*>(a8.getA5()) == a8.getA7());
- assert(dynamic_cast<A7*>(a8.getA6()) == a8.getA7());
-
- assert(dynamic_cast<A8*>(a8.getA1_3()) == a8.getA8());
- assert(dynamic_cast<A8*>(a8.getA1_4()) == a8.getA8());
- assert(dynamic_cast<A8*>(a8.getA1_6()) == a8.getA8());
- assert(dynamic_cast<A8*>(a8.getA2()) == a8.getA8());
- assert(dynamic_cast<A8*>(a8.getA3()) == a8.getA8());
- assert(dynamic_cast<A8*>(a8.getA4()) == a8.getA8());
- assert(dynamic_cast<A8*>(a8.getA5()) == a8.getA8());
- assert(dynamic_cast<A8*>(a8.getA6()) == a8.getA8());
- assert(dynamic_cast<A8*>(a8.getA7()) == a8.getA8());
-
- assert(dynamic_cast<A3*>(a9.getA1_9()) == 0);
-
- assert(dynamic_cast<A4*>(a9.getA1_9()) == 0);
-
- assert(dynamic_cast<A5*>(a9.getA1_9()) == 0);
-
- assert(dynamic_cast<A6*>(a9.getA1_9()) == 0);
-
- assert(dynamic_cast<A7*>(a9.getA1_9()) == 0);
-
- assert(dynamic_cast<A8*>(a9.getA1_9()) == 0);
-
- assert(dynamic_cast<A9*>(a9.getA1_9()) == a9.getA9());
-
- assert(dynamic_cast<A3*>(a10.getA1_3()) == a10.getA3());
- assert(dynamic_cast<A3*>(a10.getA1_4()) == a10.getA3());
- assert(dynamic_cast<A3*>(a10.getA1_6()) == a10.getA3());
- assert(dynamic_cast<A3*>(a10.getA2()) == a10.getA3());
-
- assert(dynamic_cast<A4*>(a10.getA1_3()) == a10.getA4());
- assert(dynamic_cast<A4*>(a10.getA1_4()) == a10.getA4());
- assert(dynamic_cast<A4*>(a10.getA1_6()) == a10.getA4());
- assert(dynamic_cast<A4*>(a10.getA2()) == a10.getA4());
- assert(dynamic_cast<A4*>(a10.getA3()) == a10.getA4());
-
- assert(dynamic_cast<A5*>(a10.getA1_3()) == a10.getA5());
- assert(dynamic_cast<A5*>(a10.getA1_4()) == a10.getA5());
- assert(dynamic_cast<A5*>(a10.getA1_6()) == a10.getA5());
- assert(dynamic_cast<A5*>(a10.getA2()) == a10.getA5());
- assert(dynamic_cast<A5*>(a10.getA3()) == a10.getA5());
- assert(dynamic_cast<A5*>(a10.getA4()) == a10.getA5());
-
- assert(dynamic_cast<A6*>(a10.getA1_3()) == a10.getA6());
- assert(dynamic_cast<A6*>(a10.getA1_4()) == a10.getA6());
- assert(dynamic_cast<A6*>(a10.getA1_6()) == a10.getA6());
- assert(dynamic_cast<A6*>(a10.getA2()) == a10.getA6());
- assert(dynamic_cast<A6*>(a10.getA3()) == a10.getA6());
- assert(dynamic_cast<A6*>(a10.getA4()) == a10.getA6());
- assert(dynamic_cast<A6*>(a10.getA5()) == a10.getA6());
-
- assert(dynamic_cast<A7*>(a10.getA1_3()) == a10.getA7());
- assert(dynamic_cast<A7*>(a10.getA1_4()) == a10.getA7());
- assert(dynamic_cast<A7*>(a10.getA1_6()) == a10.getA7());
- assert(dynamic_cast<A7*>(a10.getA2()) == a10.getA7());
- assert(dynamic_cast<A7*>(a10.getA3()) == a10.getA7());
- assert(dynamic_cast<A7*>(a10.getA4()) == a10.getA7());
- assert(dynamic_cast<A7*>(a10.getA5()) == a10.getA7());
- assert(dynamic_cast<A7*>(a10.getA6()) == a10.getA7());
-
- assert(dynamic_cast<A8*>(a10.getA1_3()) == a10.getA8());
- assert(dynamic_cast<A8*>(a10.getA1_4()) == a10.getA8());
- assert(dynamic_cast<A8*>(a10.getA1_6()) == a10.getA8());
- assert(dynamic_cast<A8*>(a10.getA2()) == a10.getA8());
- assert(dynamic_cast<A8*>(a10.getA3()) == a10.getA8());
- assert(dynamic_cast<A8*>(a10.getA4()) == a10.getA8());
- assert(dynamic_cast<A8*>(a10.getA5()) == a10.getA8());
- assert(dynamic_cast<A8*>(a10.getA6()) == a10.getA8());
- assert(dynamic_cast<A8*>(a10.getA7()) == a10.getA8());
-
- assert(dynamic_cast<A9*>(a10.getA1_3()) == 0);
- assert(dynamic_cast<A9*>(a10.getA1_4()) == 0);
- assert(dynamic_cast<A9*>(a10.getA1_6()) == 0);
- assert(dynamic_cast<A9*>(a10.getA2()) == 0);
- assert(dynamic_cast<A9*>(a10.getA3()) == 0);
- assert(dynamic_cast<A9*>(a10.getA4()) == 0);
- assert(dynamic_cast<A9*>(a10.getA5()) == 0);
- assert(dynamic_cast<A9*>(a10.getA6()) == 0);
- assert(dynamic_cast<A9*>(a10.getA7()) == 0);
- assert(dynamic_cast<A9*>(a10.getA8()) == 0);
-
- assert(dynamic_cast<A10*>(a10.getA1_3()) == a10.getA10());
- assert(dynamic_cast<A10*>(a10.getA1_4()) == a10.getA10());
- assert(dynamic_cast<A10*>(a10.getA1_6()) == a10.getA10());
- assert(dynamic_cast<A10*>(a10.getA2()) == a10.getA10());
- assert(dynamic_cast<A10*>(a10.getA3()) == a10.getA10());
- assert(dynamic_cast<A10*>(a10.getA4()) == a10.getA10());
- assert(dynamic_cast<A10*>(a10.getA5()) == a10.getA10());
- assert(dynamic_cast<A10*>(a10.getA6()) == a10.getA10());
- assert(dynamic_cast<A10*>(a10.getA7()) == a10.getA10());
- assert(dynamic_cast<A10*>(a10.getA8()) == a10.getA10());
-
- assert(dynamic_cast<A3*>(a11.getA1_3()) == a11.getA3());
- assert(dynamic_cast<A3*>(a11.getA1_4()) == a11.getA3());
- assert(dynamic_cast<A3*>(a11.getA1_6()) == a11.getA3());
- assert(dynamic_cast<A3*>(a11.getA1_9()) == a11.getA3());
- assert(dynamic_cast<A3*>(a11.getA2()) == a11.getA3());
-
- assert(dynamic_cast<A4*>(a11.getA1_3()) == a11.getA4());
- assert(dynamic_cast<A4*>(a11.getA1_4()) == a11.getA4());
- assert(dynamic_cast<A4*>(a11.getA1_6()) == a11.getA4());
- assert(dynamic_cast<A4*>(a11.getA1_9()) == a11.getA4());
- assert(dynamic_cast<A4*>(a11.getA2()) == a11.getA4());
- assert(dynamic_cast<A4*>(a11.getA3()) == a11.getA4());
-
- assert(dynamic_cast<A5*>(a11.getA1_3()) == a11.getA5());
- assert(dynamic_cast<A5*>(a11.getA1_4()) == a11.getA5());
- assert(dynamic_cast<A5*>(a11.getA1_6()) == a11.getA5());
- assert(dynamic_cast<A5*>(a11.getA1_9()) == a11.getA5());
- assert(dynamic_cast<A5*>(a11.getA2()) == a11.getA5());
- assert(dynamic_cast<A5*>(a11.getA3()) == a11.getA5());
- assert(dynamic_cast<A5*>(a11.getA4()) == a11.getA5());
-
- assert(dynamic_cast<A6*>(a11.getA1_3()) == a11.getA6());
- assert(dynamic_cast<A6*>(a11.getA1_4()) == a11.getA6());
- assert(dynamic_cast<A6*>(a11.getA1_6()) == a11.getA6());
- assert(dynamic_cast<A6*>(a11.getA1_9()) == a11.getA6());
- assert(dynamic_cast<A6*>(a11.getA2()) == a11.getA6());
- assert(dynamic_cast<A6*>(a11.getA3()) == a11.getA6());
- assert(dynamic_cast<A6*>(a11.getA4()) == a11.getA6());
- assert(dynamic_cast<A6*>(a11.getA5()) == a11.getA6());
-
- assert(dynamic_cast<A7*>(a11.getA1_3()) == a11.getA7());
- assert(dynamic_cast<A7*>(a11.getA1_4()) == a11.getA7());
- assert(dynamic_cast<A7*>(a11.getA1_6()) == a11.getA7());
- assert(dynamic_cast<A7*>(a11.getA1_9()) == a11.getA7());
- assert(dynamic_cast<A7*>(a11.getA2()) == a11.getA7());
- assert(dynamic_cast<A7*>(a11.getA3()) == a11.getA7());
- assert(dynamic_cast<A7*>(a11.getA4()) == a11.getA7());
- assert(dynamic_cast<A7*>(a11.getA5()) == a11.getA7());
- assert(dynamic_cast<A7*>(a11.getA6()) == a11.getA7());
-
- assert(dynamic_cast<A8*>(a11.getA1_3()) == a11.getA8());
- assert(dynamic_cast<A8*>(a11.getA1_4()) == a11.getA8());
- assert(dynamic_cast<A8*>(a11.getA1_6()) == a11.getA8());
- assert(dynamic_cast<A8*>(a11.getA1_9()) == a11.getA8());
- assert(dynamic_cast<A8*>(a11.getA2()) == a11.getA8());
- assert(dynamic_cast<A8*>(a11.getA3()) == a11.getA8());
- assert(dynamic_cast<A8*>(a11.getA4()) == a11.getA8());
- assert(dynamic_cast<A8*>(a11.getA5()) == a11.getA8());
- assert(dynamic_cast<A8*>(a11.getA6()) == a11.getA8());
- assert(dynamic_cast<A8*>(a11.getA7()) == a11.getA8());
-
- assert(dynamic_cast<A9*>(a11.getA1_3()) == a11.getA9());
- assert(dynamic_cast<A9*>(a11.getA1_4()) == a11.getA9());
- assert(dynamic_cast<A9*>(a11.getA1_6()) == a11.getA9());
- assert(dynamic_cast<A9*>(a11.getA1_9()) == a11.getA9());
- assert(dynamic_cast<A9*>(a11.getA2()) == a11.getA9());
- assert(dynamic_cast<A9*>(a11.getA3()) == a11.getA9());
- assert(dynamic_cast<A9*>(a11.getA4()) == a11.getA9());
- assert(dynamic_cast<A9*>(a11.getA5()) == a11.getA9());
- assert(dynamic_cast<A9*>(a11.getA6()) == a11.getA9());
- assert(dynamic_cast<A9*>(a11.getA7()) == a11.getA9());
- assert(dynamic_cast<A9*>(a11.getA8()) == a11.getA9());
-
- assert(dynamic_cast<A10*>(a11.getA1_3()) == 0);
- assert(dynamic_cast<A10*>(a11.getA1_4()) == 0);
- assert(dynamic_cast<A10*>(a11.getA1_6()) == 0);
- assert(dynamic_cast<A10*>(a11.getA1_9()) == 0);
- assert(dynamic_cast<A10*>(a11.getA2()) == 0);
- assert(dynamic_cast<A10*>(a11.getA3()) == 0);
- assert(dynamic_cast<A10*>(a11.getA4()) == 0);
- assert(dynamic_cast<A10*>(a11.getA5()) == 0);
- assert(dynamic_cast<A10*>(a11.getA6()) == 0);
- assert(dynamic_cast<A10*>(a11.getA7()) == 0);
- assert(dynamic_cast<A10*>(a11.getA8()) == 0);
- assert(dynamic_cast<A10*>(a11.getA9()) == 0);
-
- assert(dynamic_cast<A11*>(a11.getA1_3()) == a11.getA11());
- assert(dynamic_cast<A11*>(a11.getA1_4()) == a11.getA11());
- assert(dynamic_cast<A11*>(a11.getA1_6()) == a11.getA11());
- assert(dynamic_cast<A11*>(a11.getA1_9()) == a11.getA11());
- assert(dynamic_cast<A11*>(a11.getA2()) == a11.getA11());
- assert(dynamic_cast<A11*>(a11.getA3()) == a11.getA11());
- assert(dynamic_cast<A11*>(a11.getA4()) == a11.getA11());
- assert(dynamic_cast<A11*>(a11.getA5()) == a11.getA11());
- assert(dynamic_cast<A11*>(a11.getA6()) == a11.getA11());
- assert(dynamic_cast<A11*>(a11.getA7()) == a11.getA11());
- assert(dynamic_cast<A11*>(a11.getA8()) == a11.getA11());
- assert(dynamic_cast<A11*>(a11.getA9()) == a11.getA11());
-
- assert(dynamic_cast<A3*>(a12.getA1_3()) == a12.getA3());
- assert(dynamic_cast<A3*>(a12.getA1_4()) == a12.getA3());
- assert(dynamic_cast<A3*>(a12.getA1_6()) == a12.getA3());
- assert(dynamic_cast<A3*>(a12.getA1_9()) == a12.getA3());
- assert(dynamic_cast<A3*>(a12.getA2()) == a12.getA3());
-
- assert(dynamic_cast<A4*>(a12.getA1_3()) == a12.getA4());
- assert(dynamic_cast<A4*>(a12.getA1_4()) == a12.getA4());
- assert(dynamic_cast<A4*>(a12.getA1_6()) == a12.getA4());
- assert(dynamic_cast<A4*>(a12.getA1_9()) == a12.getA4());
- assert(dynamic_cast<A4*>(a12.getA2()) == a12.getA4());
- assert(dynamic_cast<A4*>(a12.getA3()) == a12.getA4());
-
- assert(dynamic_cast<A5*>(a12.getA1_3()) == a12.getA5());
- assert(dynamic_cast<A5*>(a12.getA1_4()) == a12.getA5());
- assert(dynamic_cast<A5*>(a12.getA1_6()) == a12.getA5());
- assert(dynamic_cast<A5*>(a12.getA1_9()) == a12.getA5());
- assert(dynamic_cast<A5*>(a12.getA2()) == a12.getA5());
- assert(dynamic_cast<A5*>(a12.getA3()) == a12.getA5());
- assert(dynamic_cast<A5*>(a12.getA4()) == a12.getA5());
-
- assert(dynamic_cast<A6*>(a12.getA1_3()) == a12.getA6());
- assert(dynamic_cast<A6*>(a12.getA1_4()) == a12.getA6());
- assert(dynamic_cast<A6*>(a12.getA1_6()) == a12.getA6());
- assert(dynamic_cast<A6*>(a12.getA1_9()) == a12.getA6());
- assert(dynamic_cast<A6*>(a12.getA2()) == a12.getA6());
- assert(dynamic_cast<A6*>(a12.getA3()) == a12.getA6());
- assert(dynamic_cast<A6*>(a12.getA4()) == a12.getA6());
- assert(dynamic_cast<A6*>(a12.getA5()) == a12.getA6());
-
- assert(dynamic_cast<A7*>(a12.getA1_3()) == a12.getA7());
- assert(dynamic_cast<A7*>(a12.getA1_4()) == a12.getA7());
- assert(dynamic_cast<A7*>(a12.getA1_6()) == a12.getA7());
- assert(dynamic_cast<A7*>(a12.getA1_9()) == a12.getA7());
- assert(dynamic_cast<A7*>(a12.getA2()) == a12.getA7());
- assert(dynamic_cast<A7*>(a12.getA3()) == a12.getA7());
- assert(dynamic_cast<A7*>(a12.getA4()) == a12.getA7());
- assert(dynamic_cast<A7*>(a12.getA5()) == a12.getA7());
- assert(dynamic_cast<A7*>(a12.getA6()) == a12.getA7());
-
- assert(dynamic_cast<A8*>(a12.getA1_3()) == a12.getA8());
- assert(dynamic_cast<A8*>(a12.getA1_4()) == a12.getA8());
- assert(dynamic_cast<A8*>(a12.getA1_6()) == a12.getA8());
- assert(dynamic_cast<A8*>(a12.getA1_9()) == a12.getA8());
- assert(dynamic_cast<A8*>(a12.getA2()) == a12.getA8());
- assert(dynamic_cast<A8*>(a12.getA3()) == a12.getA8());
- assert(dynamic_cast<A8*>(a12.getA4()) == a12.getA8());
- assert(dynamic_cast<A8*>(a12.getA5()) == a12.getA8());
- assert(dynamic_cast<A8*>(a12.getA6()) == a12.getA8());
- assert(dynamic_cast<A8*>(a12.getA7()) == a12.getA8());
-
- assert(dynamic_cast<A9*>(a12.getA1_3()) == a12.getA9());
- assert(dynamic_cast<A9*>(a12.getA1_4()) == a12.getA9());
- assert(dynamic_cast<A9*>(a12.getA1_6()) == a12.getA9());
- assert(dynamic_cast<A9*>(a12.getA1_9()) == a12.getA9());
- assert(dynamic_cast<A9*>(a12.getA2()) == a12.getA9());
- assert(dynamic_cast<A9*>(a12.getA3()) == a12.getA9());
- assert(dynamic_cast<A9*>(a12.getA4()) == a12.getA9());
- assert(dynamic_cast<A9*>(a12.getA5()) == a12.getA9());
- assert(dynamic_cast<A9*>(a12.getA6()) == a12.getA9());
- assert(dynamic_cast<A9*>(a12.getA7()) == a12.getA9());
- assert(dynamic_cast<A9*>(a12.getA8()) == a12.getA9());
-
- assert(dynamic_cast<A10*>(a12.getA1_3()) == a12.getA10());
- assert(dynamic_cast<A10*>(a12.getA1_4()) == a12.getA10());
- assert(dynamic_cast<A10*>(a12.getA1_6()) == a12.getA10());
- assert(dynamic_cast<A10*>(a12.getA1_9()) == a12.getA10());
- assert(dynamic_cast<A10*>(a12.getA2()) == a12.getA10());
- assert(dynamic_cast<A10*>(a12.getA3()) == a12.getA10());
- assert(dynamic_cast<A10*>(a12.getA4()) == a12.getA10());
- assert(dynamic_cast<A10*>(a12.getA5()) == a12.getA10());
- assert(dynamic_cast<A10*>(a12.getA6()) == a12.getA10());
- assert(dynamic_cast<A10*>(a12.getA7()) == a12.getA10());
- assert(dynamic_cast<A10*>(a12.getA8()) == a12.getA10());
- assert(dynamic_cast<A10*>(a12.getA9()) == a12.getA10());
-
- assert(dynamic_cast<A11*>(a12.getA1_3()) == a12.getA11());
- assert(dynamic_cast<A11*>(a12.getA1_4()) == a12.getA11());
- assert(dynamic_cast<A11*>(a12.getA1_6()) == a12.getA11());
- assert(dynamic_cast<A11*>(a12.getA1_9()) == a12.getA11());
- assert(dynamic_cast<A11*>(a12.getA2()) == a12.getA11());
- assert(dynamic_cast<A11*>(a12.getA3()) == a12.getA11());
- assert(dynamic_cast<A11*>(a12.getA4()) == a12.getA11());
- assert(dynamic_cast<A11*>(a12.getA5()) == a12.getA11());
- assert(dynamic_cast<A11*>(a12.getA6()) == a12.getA11());
- assert(dynamic_cast<A11*>(a12.getA7()) == a12.getA11());
- assert(dynamic_cast<A11*>(a12.getA8()) == a12.getA11());
- assert(dynamic_cast<A11*>(a12.getA9()) == a12.getA11());
- assert(dynamic_cast<A11*>(a12.getA10()) == a12.getA11());
-
- assert(dynamic_cast<A12*>(a12.getA1_3()) == a12.getA12());
- assert(dynamic_cast<A12*>(a12.getA1_4()) == a12.getA12());
- assert(dynamic_cast<A12*>(a12.getA1_6()) == a12.getA12());
- assert(dynamic_cast<A12*>(a12.getA1_9()) == a12.getA12());
- assert(dynamic_cast<A12*>(a12.getA2()) == a12.getA12());
- assert(dynamic_cast<A12*>(a12.getA3()) == a12.getA12());
- assert(dynamic_cast<A12*>(a12.getA4()) == a12.getA12());
- assert(dynamic_cast<A12*>(a12.getA5()) == a12.getA12());
- assert(dynamic_cast<A12*>(a12.getA6()) == a12.getA12());
- assert(dynamic_cast<A12*>(a12.getA7()) == a12.getA12());
- assert(dynamic_cast<A12*>(a12.getA8()) == a12.getA12());
- assert(dynamic_cast<A12*>(a12.getA9()) == a12.getA12());
- assert(dynamic_cast<A12*>(a12.getA10()) == a12.getA12());
- assert(dynamic_cast<A12*>(a12.getA11()) == a12.getA12());
-
- assert(dynamic_cast<A3*>(a13.getA1_3()) == a13.getA3());
- assert(dynamic_cast<A3*>(a13.getA1_4()) == a13.getA3());
- assert(dynamic_cast<A3*>(a13.getA1_6()) == a13.getA3());
- assert(dynamic_cast<A3*>(a13.getA1_9()) == a13.getA3());
- assert(dynamic_cast<A3*>(a13.getA2()) == a13.getA3());
-
- assert(dynamic_cast<A4*>(a13.getA1_3()) == a13.getA4());
- assert(dynamic_cast<A4*>(a13.getA1_4()) == a13.getA4());
- assert(dynamic_cast<A4*>(a13.getA1_6()) == a13.getA4());
- assert(dynamic_cast<A4*>(a13.getA1_9()) == a13.getA4());
- assert(dynamic_cast<A4*>(a13.getA2()) == a13.getA4());
- assert(dynamic_cast<A4*>(a13.getA3()) == a13.getA4());
-
- assert(dynamic_cast<A5*>(a13.getA1_3()) == a13.getA5());
- assert(dynamic_cast<A5*>(a13.getA1_4()) == a13.getA5());
- assert(dynamic_cast<A5*>(a13.getA1_6()) == a13.getA5());
- assert(dynamic_cast<A5*>(a13.getA1_9()) == a13.getA5());
- assert(dynamic_cast<A5*>(a13.getA2()) == a13.getA5());
- assert(dynamic_cast<A5*>(a13.getA3()) == a13.getA5());
- assert(dynamic_cast<A5*>(a13.getA4()) == a13.getA5());
-
- assert(dynamic_cast<A6*>(a13.getA1_3()) == a13.getA6());
- assert(dynamic_cast<A6*>(a13.getA1_4()) == a13.getA6());
- assert(dynamic_cast<A6*>(a13.getA1_6()) == a13.getA6());
- assert(dynamic_cast<A6*>(a13.getA1_9()) == a13.getA6());
- assert(dynamic_cast<A6*>(a13.getA2()) == a13.getA6());
- assert(dynamic_cast<A6*>(a13.getA3()) == a13.getA6());
- assert(dynamic_cast<A6*>(a13.getA4()) == a13.getA6());
- assert(dynamic_cast<A6*>(a13.getA5()) == a13.getA6());
-
- assert(dynamic_cast<A7*>(a13.getA1_3()) == a13.getA7());
- assert(dynamic_cast<A7*>(a13.getA1_4()) == a13.getA7());
- assert(dynamic_cast<A7*>(a13.getA1_6()) == a13.getA7());
- assert(dynamic_cast<A7*>(a13.getA1_9()) == a13.getA7());
- assert(dynamic_cast<A7*>(a13.getA2()) == a13.getA7());
- assert(dynamic_cast<A7*>(a13.getA3()) == a13.getA7());
- assert(dynamic_cast<A7*>(a13.getA4()) == a13.getA7());
- assert(dynamic_cast<A7*>(a13.getA5()) == a13.getA7());
- assert(dynamic_cast<A7*>(a13.getA6()) == a13.getA7());
-
- assert(dynamic_cast<A8*>(a13.getA1_3()) == a13.getA8());
- assert(dynamic_cast<A8*>(a13.getA1_4()) == a13.getA8());
- assert(dynamic_cast<A8*>(a13.getA1_6()) == a13.getA8());
- assert(dynamic_cast<A8*>(a13.getA1_9()) == a13.getA8());
- assert(dynamic_cast<A8*>(a13.getA2()) == a13.getA8());
- assert(dynamic_cast<A8*>(a13.getA3()) == a13.getA8());
- assert(dynamic_cast<A8*>(a13.getA4()) == a13.getA8());
- assert(dynamic_cast<A8*>(a13.getA5()) == a13.getA8());
- assert(dynamic_cast<A8*>(a13.getA6()) == a13.getA8());
- assert(dynamic_cast<A8*>(a13.getA7()) == a13.getA8());
-
- assert(dynamic_cast<A9*>(a13.getA1_3()) == a13.getA9());
- assert(dynamic_cast<A9*>(a13.getA1_4()) == a13.getA9());
- assert(dynamic_cast<A9*>(a13.getA1_6()) == a13.getA9());
- assert(dynamic_cast<A9*>(a13.getA1_9()) == a13.getA9());
- assert(dynamic_cast<A9*>(a13.getA2()) == a13.getA9());
- assert(dynamic_cast<A9*>(a13.getA3()) == a13.getA9());
- assert(dynamic_cast<A9*>(a13.getA4()) == a13.getA9());
- assert(dynamic_cast<A9*>(a13.getA5()) == a13.getA9());
- assert(dynamic_cast<A9*>(a13.getA6()) == a13.getA9());
- assert(dynamic_cast<A9*>(a13.getA7()) == a13.getA9());
- assert(dynamic_cast<A9*>(a13.getA8()) == a13.getA9());
-
- assert(dynamic_cast<A10*>(a13.getA1_3()) == a13.getA10());
- assert(dynamic_cast<A10*>(a13.getA1_4()) == a13.getA10());
- assert(dynamic_cast<A10*>(a13.getA1_6()) == a13.getA10());
- assert(dynamic_cast<A10*>(a13.getA1_9()) == a13.getA10());
- assert(dynamic_cast<A10*>(a13.getA2()) == a13.getA10());
- assert(dynamic_cast<A10*>(a13.getA3()) == a13.getA10());
- assert(dynamic_cast<A10*>(a13.getA4()) == a13.getA10());
- assert(dynamic_cast<A10*>(a13.getA5()) == a13.getA10());
- assert(dynamic_cast<A10*>(a13.getA6()) == a13.getA10());
- assert(dynamic_cast<A10*>(a13.getA7()) == a13.getA10());
- assert(dynamic_cast<A10*>(a13.getA8()) == a13.getA10());
- assert(dynamic_cast<A10*>(a13.getA9()) == a13.getA10());
-
- assert(dynamic_cast<A11*>(a13.getA1_3()) == a13.getA11());
- assert(dynamic_cast<A11*>(a13.getA1_4()) == a13.getA11());
- assert(dynamic_cast<A11*>(a13.getA1_6()) == a13.getA11());
- assert(dynamic_cast<A11*>(a13.getA1_9()) == a13.getA11());
- assert(dynamic_cast<A11*>(a13.getA2()) == a13.getA11());
- assert(dynamic_cast<A11*>(a13.getA3()) == a13.getA11());
- assert(dynamic_cast<A11*>(a13.getA4()) == a13.getA11());
- assert(dynamic_cast<A11*>(a13.getA5()) == a13.getA11());
- assert(dynamic_cast<A11*>(a13.getA6()) == a13.getA11());
- assert(dynamic_cast<A11*>(a13.getA7()) == a13.getA11());
- assert(dynamic_cast<A11*>(a13.getA8()) == a13.getA11());
- assert(dynamic_cast<A11*>(a13.getA9()) == a13.getA11());
- assert(dynamic_cast<A11*>(a13.getA10()) == a13.getA11());
-
- assert(dynamic_cast<A12*>(a13.getA1_3()) == a13.getA12());
- assert(dynamic_cast<A12*>(a13.getA1_4()) == a13.getA12());
- assert(dynamic_cast<A12*>(a13.getA1_6()) == a13.getA12());
- assert(dynamic_cast<A12*>(a13.getA1_9()) == a13.getA12());
- assert(dynamic_cast<A12*>(a13.getA2()) == a13.getA12());
- assert(dynamic_cast<A12*>(a13.getA3()) == a13.getA12());
- assert(dynamic_cast<A12*>(a13.getA4()) == a13.getA12());
- assert(dynamic_cast<A12*>(a13.getA5()) == a13.getA12());
- assert(dynamic_cast<A12*>(a13.getA6()) == a13.getA12());
- assert(dynamic_cast<A12*>(a13.getA7()) == a13.getA12());
- assert(dynamic_cast<A12*>(a13.getA8()) == a13.getA12());
- assert(dynamic_cast<A12*>(a13.getA9()) == a13.getA12());
- assert(dynamic_cast<A12*>(a13.getA10()) == a13.getA12());
- assert(dynamic_cast<A12*>(a13.getA11()) == a13.getA12());
-
- assert(dynamic_cast<A13*>(a13.getA1_3()) == a13.getA13());
- assert(dynamic_cast<A13*>(a13.getA1_4()) == a13.getA13());
- assert(dynamic_cast<A13*>(a13.getA1_6()) == a13.getA13());
- assert(dynamic_cast<A13*>(a13.getA1_9()) == a13.getA13());
- assert(dynamic_cast<A13*>(a13.getA2()) == a13.getA13());
- assert(dynamic_cast<A13*>(a13.getA3()) == a13.getA13());
- assert(dynamic_cast<A13*>(a13.getA4()) == a13.getA13());
- assert(dynamic_cast<A13*>(a13.getA5()) == a13.getA13());
- assert(dynamic_cast<A13*>(a13.getA6()) == a13.getA13());
- assert(dynamic_cast<A13*>(a13.getA7()) == a13.getA13());
- assert(dynamic_cast<A13*>(a13.getA8()) == a13.getA13());
- assert(dynamic_cast<A13*>(a13.getA9()) == a13.getA13());
- assert(dynamic_cast<A13*>(a13.getA10()) == a13.getA13());
- assert(dynamic_cast<A13*>(a13.getA11()) == a13.getA13());
- assert(dynamic_cast<A13*>(a13.getA12()) == a13.getA13());
-}
-
-} // t1
-
-namespace t2
-{
-
-struct A1
-{
- char _[43981];
- virtual ~A1() {}
-
- A1* getA1() {return this;}
-};
-
-struct A2
-{
- char _[34981];
- virtual ~A2() {}
-
- A2* getA2() {return this;}
-};
-
-struct A3
- : protected A1,
- public virtual A2
-{
- char _[93481];
- virtual ~A3() {}
-
- A1* getA1_3() {return A1::getA1();}
- A2* getA2() {return A2::getA2();}
- A3* getA3() {return this;}
-};
-
-struct A4
- : public virtual A2,
- public A1
-{
- char _[13489];
- virtual ~A4() {}
-
- A1* getA1_4() {return A1::getA1();}
- A2* getA2() {return A2::getA2();}
- A4* getA4() {return this;}
-};
-
-struct A5
- : public A3,
- public A4
-{
- char _[13489];
- virtual ~A5() {}
-
- A1* getA1_3() {return A3::getA1();}
- A1* getA1_4() {return A4::getA1();}
- A2* getA2() {return A3::getA2();}
- A3* getA3() {return A3::getA3();}
- A4* getA4() {return A4::getA4();}
- A5* getA5() {return this;}
-};
-
-struct A6
- : public A1
-{
- char _[81349];
- virtual ~A6() {}
-
- A1* getA1_6() {return A1::getA1();}
- A6* getA6() {return this;}
-};
-
-struct A7
- : public A5,
- public A6
-{
- char _[34819];
- virtual ~A7() {}
-
- A1* getA1_3() {return A5::getA1_3();}
- A1* getA1_4() {return A5::getA1_4();}
- A1* getA1_6() {return A6::getA1_6();}
- A2* getA2() {return A5::getA2();}
- A3* getA3() {return A5::getA3();}
- A4* getA4() {return A5::getA4();}
- A5* getA5() {return A5::getA5();}
- A6* getA6() {return A6::getA6();}
- A7* getA7() {return this;}
-};
-
-struct A8
- : public A7
-{
- char _[3489];
- virtual ~A8() {}
-
- A1* getA1_3() {return A7::getA1_3();}
- A1* getA1_4() {return A7::getA1_4();}
- A1* getA1_6() {return A7::getA1_6();}
- A2* getA2() {return A7::getA2();}
- A3* getA3() {return A7::getA3();}
- A4* getA4() {return A7::getA4();}
- A5* getA5() {return A7::getA5();}
- A6* getA6() {return A7::getA6();}
- A7* getA7() {return A7::getA7();}
- A8* getA8() {return this;}
-};
-
-struct A9
- : public A1
-{
- char _[3481];
- virtual ~A9() {}
-
- A1* getA1_9() {return A1::getA1();}
- A9* getA9() {return this;}
-};
-
-struct A10
- : public virtual A8
-{
- char _[4831];
- virtual ~A10() {}
-
- A1* getA1_3() {return A8::getA1_3();}
- A1* getA1_4() {return A8::getA1_4();}
- A1* getA1_6() {return A8::getA1_6();}
- A2* getA2() {return A8::getA2();}
- A3* getA3() {return A8::getA3();}
- A4* getA4() {return A8::getA4();}
- A5* getA5() {return A8::getA5();}
- A6* getA6() {return A8::getA6();}
- A7* getA7() {return A8::getA7();}
- A8* getA8() {return A8::getA8();}
- A10* getA10() {return this;}
-};
-
-struct A11
- : public virtual A8,
- public A9
-{
- char _[6483];
- virtual ~A11() {}
-
- A1* getA1_3() {return A8::getA1_3();}
- A1* getA1_4() {return A8::getA1_4();}
- A1* getA1_6() {return A8::getA1_6();}
- A1* getA1_9() {return A9::getA1_9();}
- A2* getA2() {return A8::getA2();}
- A3* getA3() {return A8::getA3();}
- A4* getA4() {return A8::getA4();}
- A5* getA5() {return A8::getA5();}
- A6* getA6() {return A8::getA6();}
- A7* getA7() {return A8::getA7();}
- A8* getA8() {return A8::getA8();}
- A9* getA9() {return A9::getA9();}
- A11* getA11() {return this;}
-};
-
-struct A12
- : public A10,
- public A11
-{
- char _[2283];
- virtual ~A12() {}
-
- A1* getA1_3() {return A10::getA1_3();}
- A1* getA1_4() {return A10::getA1_4();}
- A1* getA1_6() {return A10::getA1_6();}
- A1* getA1_9() {return A11::getA1_9();}
- A2* getA2() {return A10::getA2();}
- A3* getA3() {return A10::getA3();}
- A4* getA4() {return A10::getA4();}
- A5* getA5() {return A10::getA5();}
- A6* getA6() {return A10::getA6();}
- A7* getA7() {return A10::getA7();}
- A8* getA8() {return A10::getA8();}
- A9* getA9() {return A11::getA9();}
- A10* getA10() {return A10::getA10();}
- A11* getA11() {return A11::getA11();}
- A12* getA12() {return this;}
-};
-
-struct A13
- : public A12
-{
- char _[1283];
- virtual ~A13() {}
-
- A1* getA1_3() {return A12::getA1_3();}
- A1* getA1_4() {return A12::getA1_4();}
- A1* getA1_6() {return A12::getA1_6();}
- A1* getA1_9() {return A12::getA1_9();}
- A2* getA2() {return A12::getA2();}
- A3* getA3() {return A12::getA3();}
- A4* getA4() {return A12::getA4();}
- A5* getA5() {return A12::getA5();}
- A6* getA6() {return A12::getA6();}
- A7* getA7() {return A12::getA7();}
- A8* getA8() {return A12::getA8();}
- A9* getA9() {return A12::getA9();}
- A10* getA10() {return A12::getA10();}
- A11* getA11() {return A12::getA11();}
- A12* getA12() {return A12::getA12();}
- A13* getA13() {return this;}
-};
-
-void test()
-{
- A3 a3;
- A4 a4;
- A5 a5;
- A6 a6;
- A7 a7;
- A8 a8;
- A9 a9;
- A10 a10;
- A11 a11;
- A12 a12;
- A13 a13;
-
- assert(dynamic_cast<A3*>(a3.getA1_3()) == 0);
- assert(dynamic_cast<A3*>(a3.getA2()) == a3.getA3());
-
- assert(dynamic_cast<A3*>(a4.getA1_4()) == 0);
- assert(dynamic_cast<A3*>(a4.getA2()) == 0);
- assert(dynamic_cast<A4*>(a4.getA1_4()) == a4.getA4());
- assert(dynamic_cast<A4*>(a4.getA2()) == a4.getA4());
-
- assert(dynamic_cast<A3*>(a5.getA1_3()) == 0);
- assert(dynamic_cast<A3*>(a5.getA2()) == a5.getA3());
-
- assert(dynamic_cast<A4*>(a5.getA1_3()) == 0);
- assert(dynamic_cast<A4*>(a5.getA1_4()) == a5.getA4());
- assert(dynamic_cast<A4*>(a5.getA3()) == a5.getA4());
- assert(dynamic_cast<A4*>(a5.getA3()) == a5.getA4());
-
- assert(dynamic_cast<A5*>(a5.getA1_3()) == 0);
- assert(dynamic_cast<A5*>(a5.getA1_4()) == a5.getA5());
- assert(dynamic_cast<A5*>(a5.getA3()) == a5.getA5());
- assert(dynamic_cast<A5*>(a5.getA3()) == a5.getA5());
- assert(dynamic_cast<A5*>(a5.getA3()) == a5.getA5());
- assert(dynamic_cast<A5*>(a5.getA4()) == a5.getA5());
-
- assert(dynamic_cast<A3*>(a6.getA1_6()) == 0);
-
- assert(dynamic_cast<A4*>(a6.getA1_6()) == 0);
-
- assert(dynamic_cast<A5*>(a6.getA1_6()) == 0);
-
- assert(dynamic_cast<A6*>(a6.getA1_6()) == a6.getA6());
-
- assert(dynamic_cast<A3*>(a7.getA1_3()) == 0);
- assert(dynamic_cast<A3*>(a7.getA1_4()) == a7.getA3());
- assert(dynamic_cast<A3*>(a7.getA2()) == a7.getA3());
-
- assert(dynamic_cast<A4*>(a7.getA1_3()) == 0);
- assert(dynamic_cast<A4*>(a7.getA1_4()) == a7.getA4());
- assert(dynamic_cast<A4*>(a7.getA2()) == a7.getA4());
- assert(dynamic_cast<A4*>(a7.getA3()) == a7.getA4());
-
- assert(dynamic_cast<A5*>(a7.getA1_3()) == 0);
- assert(dynamic_cast<A5*>(a7.getA1_4()) == a7.getA5());
- assert(dynamic_cast<A5*>(a7.getA2()) == a7.getA5());
- assert(dynamic_cast<A5*>(a7.getA3()) == a7.getA5());
- assert(dynamic_cast<A5*>(a7.getA4()) == a7.getA5());
-
- assert(dynamic_cast<A6*>(a7.getA1_3()) == 0);
- assert(dynamic_cast<A6*>(a7.getA1_4()) == a7.getA6());
- assert(dynamic_cast<A6*>(a7.getA1_6()) == a7.getA6());
- assert(dynamic_cast<A6*>(a7.getA2()) == a7.getA6());
- assert(dynamic_cast<A6*>(a7.getA3()) == a7.getA6());
- assert(dynamic_cast<A6*>(a7.getA4()) == a7.getA6());
- assert(dynamic_cast<A6*>(a7.getA5()) == a7.getA6());
-
- assert(dynamic_cast<A7*>(a7.getA1_3()) == 0);
- assert(dynamic_cast<A7*>(a7.getA1_4()) == a7.getA7());
- assert(dynamic_cast<A7*>(a7.getA1_6()) == a7.getA7());
- assert(dynamic_cast<A7*>(a7.getA2()) == a7.getA7());
- assert(dynamic_cast<A7*>(a7.getA3()) == a7.getA7());
- assert(dynamic_cast<A7*>(a7.getA4()) == a7.getA7());
- assert(dynamic_cast<A7*>(a7.getA5()) == a7.getA7());
- assert(dynamic_cast<A7*>(a7.getA6()) == a7.getA7());
-
- assert(dynamic_cast<A3*>(a8.getA1_3()) == 0);
- assert(dynamic_cast<A3*>(a8.getA1_4()) == a8.getA3());
- assert(dynamic_cast<A3*>(a8.getA2()) == a8.getA3());
-
- assert(dynamic_cast<A4*>(a8.getA1_3()) == 0);
- assert(dynamic_cast<A4*>(a8.getA1_4()) == a8.getA4());
- assert(dynamic_cast<A4*>(a8.getA2()) == a8.getA4());
- assert(dynamic_cast<A4*>(a8.getA3()) == a8.getA4());
-
- assert(dynamic_cast<A5*>(a8.getA1_3()) == 0);
- assert(dynamic_cast<A5*>(a8.getA1_4()) == a8.getA5());
- assert(dynamic_cast<A5*>(a8.getA2()) == a8.getA5());
- assert(dynamic_cast<A5*>(a8.getA3()) == a8.getA5());
- assert(dynamic_cast<A5*>(a8.getA4()) == a8.getA5());
-
- assert(dynamic_cast<A6*>(a8.getA1_3()) == 0);
- assert(dynamic_cast<A6*>(a8.getA1_4()) == a8.getA6());
- assert(dynamic_cast<A6*>(a8.getA1_6()) == a8.getA6());
- assert(dynamic_cast<A6*>(a8.getA2()) == a8.getA6());
- assert(dynamic_cast<A6*>(a8.getA3()) == a8.getA6());
- assert(dynamic_cast<A6*>(a8.getA4()) == a8.getA6());
- assert(dynamic_cast<A6*>(a8.getA5()) == a8.getA6());
-
- assert(dynamic_cast<A7*>(a8.getA1_3()) == 0);
- assert(dynamic_cast<A7*>(a8.getA1_4()) == a8.getA7());
- assert(dynamic_cast<A7*>(a8.getA1_6()) == a8.getA7());
- assert(dynamic_cast<A7*>(a8.getA2()) == a8.getA7());
- assert(dynamic_cast<A7*>(a8.getA3()) == a8.getA7());
- assert(dynamic_cast<A7*>(a8.getA4()) == a8.getA7());
- assert(dynamic_cast<A7*>(a8.getA5()) == a8.getA7());
- assert(dynamic_cast<A7*>(a8.getA6()) == a8.getA7());
-
- assert(dynamic_cast<A8*>(a8.getA1_3()) == 0);
- assert(dynamic_cast<A8*>(a8.getA1_4()) == a8.getA8());
- assert(dynamic_cast<A8*>(a8.getA1_6()) == a8.getA8());
- assert(dynamic_cast<A8*>(a8.getA2()) == a8.getA8());
- assert(dynamic_cast<A8*>(a8.getA3()) == a8.getA8());
- assert(dynamic_cast<A8*>(a8.getA4()) == a8.getA8());
- assert(dynamic_cast<A8*>(a8.getA5()) == a8.getA8());
- assert(dynamic_cast<A8*>(a8.getA6()) == a8.getA8());
- assert(dynamic_cast<A8*>(a8.getA7()) == a8.getA8());
-
- assert(dynamic_cast<A3*>(a9.getA1_9()) == 0);
-
- assert(dynamic_cast<A4*>(a9.getA1_9()) == 0);
-
- assert(dynamic_cast<A5*>(a9.getA1_9()) == 0);
-
- assert(dynamic_cast<A6*>(a9.getA1_9()) == 0);
-
- assert(dynamic_cast<A7*>(a9.getA1_9()) == 0);
-
- assert(dynamic_cast<A8*>(a9.getA1_9()) == 0);
-
- assert(dynamic_cast<A9*>(a9.getA1_9()) == a9.getA9());
-
- assert(dynamic_cast<A3*>(a10.getA1_3()) == 0);
- assert(dynamic_cast<A3*>(a10.getA1_4()) == a10.getA3());
- assert(dynamic_cast<A3*>(a10.getA1_6()) == a10.getA3());
- assert(dynamic_cast<A3*>(a10.getA2()) == a10.getA3());
-
- assert(dynamic_cast<A4*>(a10.getA1_3()) == 0);
- assert(dynamic_cast<A4*>(a10.getA1_4()) == a10.getA4());
- assert(dynamic_cast<A4*>(a10.getA1_6()) == a10.getA4());
- assert(dynamic_cast<A4*>(a10.getA2()) == a10.getA4());
- assert(dynamic_cast<A4*>(a10.getA3()) == a10.getA4());
-
- assert(dynamic_cast<A5*>(a10.getA1_3()) == 0);
- assert(dynamic_cast<A5*>(a10.getA1_4()) == a10.getA5());
- assert(dynamic_cast<A5*>(a10.getA1_6()) == a10.getA5());
- assert(dynamic_cast<A5*>(a10.getA2()) == a10.getA5());
- assert(dynamic_cast<A5*>(a10.getA3()) == a10.getA5());
- assert(dynamic_cast<A5*>(a10.getA4()) == a10.getA5());
-
- assert(dynamic_cast<A6*>(a10.getA1_3()) == 0);
- assert(dynamic_cast<A6*>(a10.getA1_4()) == a10.getA6());
- assert(dynamic_cast<A6*>(a10.getA1_6()) == a10.getA6());
- assert(dynamic_cast<A6*>(a10.getA2()) == a10.getA6());
- assert(dynamic_cast<A6*>(a10.getA3()) == a10.getA6());
- assert(dynamic_cast<A6*>(a10.getA4()) == a10.getA6());
- assert(dynamic_cast<A6*>(a10.getA5()) == a10.getA6());
-
- assert(dynamic_cast<A7*>(a10.getA1_3()) == 0);
- assert(dynamic_cast<A7*>(a10.getA1_4()) == a10.getA7());
- assert(dynamic_cast<A7*>(a10.getA1_6()) == a10.getA7());
- assert(dynamic_cast<A7*>(a10.getA2()) == a10.getA7());
- assert(dynamic_cast<A7*>(a10.getA3()) == a10.getA7());
- assert(dynamic_cast<A7*>(a10.getA4()) == a10.getA7());
- assert(dynamic_cast<A7*>(a10.getA5()) == a10.getA7());
- assert(dynamic_cast<A7*>(a10.getA6()) == a10.getA7());
-
- assert(dynamic_cast<A8*>(a10.getA1_3()) == 0);
- assert(dynamic_cast<A8*>(a10.getA1_4()) == a10.getA8());
- assert(dynamic_cast<A8*>(a10.getA1_6()) == a10.getA8());
- assert(dynamic_cast<A8*>(a10.getA2()) == a10.getA8());
- assert(dynamic_cast<A8*>(a10.getA3()) == a10.getA8());
- assert(dynamic_cast<A8*>(a10.getA4()) == a10.getA8());
- assert(dynamic_cast<A8*>(a10.getA5()) == a10.getA8());
- assert(dynamic_cast<A8*>(a10.getA6()) == a10.getA8());
- assert(dynamic_cast<A8*>(a10.getA7()) == a10.getA8());
-
- assert(dynamic_cast<A9*>(a10.getA1_3()) == 0);
- assert(dynamic_cast<A9*>(a10.getA1_4()) == 0);
- assert(dynamic_cast<A9*>(a10.getA1_6()) == 0);
- assert(dynamic_cast<A9*>(a10.getA2()) == 0);
- assert(dynamic_cast<A9*>(a10.getA3()) == 0);
- assert(dynamic_cast<A9*>(a10.getA4()) == 0);
- assert(dynamic_cast<A9*>(a10.getA5()) == 0);
- assert(dynamic_cast<A9*>(a10.getA6()) == 0);
- assert(dynamic_cast<A9*>(a10.getA7()) == 0);
- assert(dynamic_cast<A9*>(a10.getA8()) == 0);
-
- assert(dynamic_cast<A10*>(a10.getA1_3()) == 0);
- assert(dynamic_cast<A10*>(a10.getA1_4()) == a10.getA10());
- assert(dynamic_cast<A10*>(a10.getA1_6()) == a10.getA10());
- assert(dynamic_cast<A10*>(a10.getA2()) == a10.getA10());
- assert(dynamic_cast<A10*>(a10.getA3()) == a10.getA10());
- assert(dynamic_cast<A10*>(a10.getA4()) == a10.getA10());
- assert(dynamic_cast<A10*>(a10.getA5()) == a10.getA10());
- assert(dynamic_cast<A10*>(a10.getA6()) == a10.getA10());
- assert(dynamic_cast<A10*>(a10.getA7()) == a10.getA10());
- assert(dynamic_cast<A10*>(a10.getA8()) == a10.getA10());
-
- assert(dynamic_cast<A3*>(a11.getA1_3()) == 0);
- assert(dynamic_cast<A3*>(a11.getA1_4()) == a11.getA3());
- assert(dynamic_cast<A3*>(a11.getA1_6()) == a11.getA3());
- assert(dynamic_cast<A3*>(a11.getA1_9()) == a11.getA3());
- assert(dynamic_cast<A3*>(a11.getA2()) == a11.getA3());
-
- assert(dynamic_cast<A4*>(a11.getA1_3()) == 0);
- assert(dynamic_cast<A4*>(a11.getA1_4()) == a11.getA4());
- assert(dynamic_cast<A4*>(a11.getA1_6()) == a11.getA4());
- assert(dynamic_cast<A4*>(a11.getA1_9()) == a11.getA4());
- assert(dynamic_cast<A4*>(a11.getA2()) == a11.getA4());
- assert(dynamic_cast<A4*>(a11.getA3()) == a11.getA4());
-
- assert(dynamic_cast<A5*>(a11.getA1_3()) == 0);
- assert(dynamic_cast<A5*>(a11.getA1_4()) == a11.getA5());
- assert(dynamic_cast<A5*>(a11.getA1_6()) == a11.getA5());
- assert(dynamic_cast<A5*>(a11.getA1_9()) == a11.getA5());
- assert(dynamic_cast<A5*>(a11.getA2()) == a11.getA5());
- assert(dynamic_cast<A5*>(a11.getA3()) == a11.getA5());
- assert(dynamic_cast<A5*>(a11.getA4()) == a11.getA5());
-
- assert(dynamic_cast<A6*>(a11.getA1_3()) == 0);
- assert(dynamic_cast<A6*>(a11.getA1_4()) == a11.getA6());
- assert(dynamic_cast<A6*>(a11.getA1_6()) == a11.getA6());
- assert(dynamic_cast<A6*>(a11.getA1_9()) == a11.getA6());
- assert(dynamic_cast<A6*>(a11.getA2()) == a11.getA6());
- assert(dynamic_cast<A6*>(a11.getA3()) == a11.getA6());
- assert(dynamic_cast<A6*>(a11.getA4()) == a11.getA6());
- assert(dynamic_cast<A6*>(a11.getA5()) == a11.getA6());
-
- assert(dynamic_cast<A7*>(a11.getA1_3()) == 0);
- assert(dynamic_cast<A7*>(a11.getA1_4()) == a11.getA7());
- assert(dynamic_cast<A7*>(a11.getA1_6()) == a11.getA7());
- assert(dynamic_cast<A7*>(a11.getA1_9()) == a11.getA7());
- assert(dynamic_cast<A7*>(a11.getA2()) == a11.getA7());
- assert(dynamic_cast<A7*>(a11.getA3()) == a11.getA7());
- assert(dynamic_cast<A7*>(a11.getA4()) == a11.getA7());
- assert(dynamic_cast<A7*>(a11.getA5()) == a11.getA7());
- assert(dynamic_cast<A7*>(a11.getA6()) == a11.getA7());
-
- assert(dynamic_cast<A8*>(a11.getA1_3()) == 0);
- assert(dynamic_cast<A8*>(a11.getA1_4()) == a11.getA8());
- assert(dynamic_cast<A8*>(a11.getA1_6()) == a11.getA8());
- assert(dynamic_cast<A8*>(a11.getA1_9()) == a11.getA8());
- assert(dynamic_cast<A8*>(a11.getA2()) == a11.getA8());
- assert(dynamic_cast<A8*>(a11.getA3()) == a11.getA8());
- assert(dynamic_cast<A8*>(a11.getA4()) == a11.getA8());
- assert(dynamic_cast<A8*>(a11.getA5()) == a11.getA8());
- assert(dynamic_cast<A8*>(a11.getA6()) == a11.getA8());
- assert(dynamic_cast<A8*>(a11.getA7()) == a11.getA8());
-
- assert(dynamic_cast<A9*>(a11.getA1_3()) == 0);
- assert(dynamic_cast<A9*>(a11.getA1_4()) == a11.getA9());
- assert(dynamic_cast<A9*>(a11.getA1_6()) == a11.getA9());
- assert(dynamic_cast<A9*>(a11.getA1_9()) == a11.getA9());
- assert(dynamic_cast<A9*>(a11.getA2()) == a11.getA9());
- assert(dynamic_cast<A9*>(a11.getA3()) == a11.getA9());
- assert(dynamic_cast<A9*>(a11.getA4()) == a11.getA9());
- assert(dynamic_cast<A9*>(a11.getA5()) == a11.getA9());
- assert(dynamic_cast<A9*>(a11.getA6()) == a11.getA9());
- assert(dynamic_cast<A9*>(a11.getA7()) == a11.getA9());
- assert(dynamic_cast<A9*>(a11.getA8()) == a11.getA9());
-
- assert(dynamic_cast<A10*>(a11.getA1_3()) == 0);
- assert(dynamic_cast<A10*>(a11.getA1_4()) == 0);
- assert(dynamic_cast<A10*>(a11.getA1_6()) == 0);
- assert(dynamic_cast<A10*>(a11.getA1_9()) == 0);
- assert(dynamic_cast<A10*>(a11.getA2()) == 0);
- assert(dynamic_cast<A10*>(a11.getA3()) == 0);
- assert(dynamic_cast<A10*>(a11.getA4()) == 0);
- assert(dynamic_cast<A10*>(a11.getA5()) == 0);
- assert(dynamic_cast<A10*>(a11.getA6()) == 0);
- assert(dynamic_cast<A10*>(a11.getA7()) == 0);
- assert(dynamic_cast<A10*>(a11.getA8()) == 0);
- assert(dynamic_cast<A10*>(a11.getA9()) == 0);
-
- assert(dynamic_cast<A11*>(a11.getA1_3()) == 0);
- assert(dynamic_cast<A11*>(a11.getA1_4()) == a11.getA11());
- assert(dynamic_cast<A11*>(a11.getA1_6()) == a11.getA11());
- assert(dynamic_cast<A11*>(a11.getA1_9()) == a11.getA11());
- assert(dynamic_cast<A11*>(a11.getA2()) == a11.getA11());
- assert(dynamic_cast<A11*>(a11.getA3()) == a11.getA11());
- assert(dynamic_cast<A11*>(a11.getA4()) == a11.getA11());
- assert(dynamic_cast<A11*>(a11.getA5()) == a11.getA11());
- assert(dynamic_cast<A11*>(a11.getA6()) == a11.getA11());
- assert(dynamic_cast<A11*>(a11.getA7()) == a11.getA11());
- assert(dynamic_cast<A11*>(a11.getA8()) == a11.getA11());
- assert(dynamic_cast<A11*>(a11.getA9()) == a11.getA11());
-
- assert(dynamic_cast<A3*>(a12.getA1_3()) == 0);
- assert(dynamic_cast<A3*>(a12.getA1_4()) == a12.getA3());
- assert(dynamic_cast<A3*>(a12.getA1_6()) == a12.getA3());
- assert(dynamic_cast<A3*>(a12.getA1_9()) == a12.getA3());
- assert(dynamic_cast<A3*>(a12.getA2()) == a12.getA3());
-
- assert(dynamic_cast<A4*>(a12.getA1_3()) == 0);
- assert(dynamic_cast<A4*>(a12.getA1_4()) == a12.getA4());
- assert(dynamic_cast<A4*>(a12.getA1_6()) == a12.getA4());
- assert(dynamic_cast<A4*>(a12.getA1_9()) == a12.getA4());
- assert(dynamic_cast<A4*>(a12.getA2()) == a12.getA4());
- assert(dynamic_cast<A4*>(a12.getA3()) == a12.getA4());
-
- assert(dynamic_cast<A5*>(a12.getA1_3()) == 0);
- assert(dynamic_cast<A5*>(a12.getA1_4()) == a12.getA5());
- assert(dynamic_cast<A5*>(a12.getA1_6()) == a12.getA5());
- assert(dynamic_cast<A5*>(a12.getA1_9()) == a12.getA5());
- assert(dynamic_cast<A5*>(a12.getA2()) == a12.getA5());
- assert(dynamic_cast<A5*>(a12.getA3()) == a12.getA5());
- assert(dynamic_cast<A5*>(a12.getA4()) == a12.getA5());
-
- assert(dynamic_cast<A6*>(a12.getA1_3()) == 0);
- assert(dynamic_cast<A6*>(a12.getA1_4()) == a12.getA6());
- assert(dynamic_cast<A6*>(a12.getA1_6()) == a12.getA6());
- assert(dynamic_cast<A6*>(a12.getA1_9()) == a12.getA6());
- assert(dynamic_cast<A6*>(a12.getA2()) == a12.getA6());
- assert(dynamic_cast<A6*>(a12.getA3()) == a12.getA6());
- assert(dynamic_cast<A6*>(a12.getA4()) == a12.getA6());
- assert(dynamic_cast<A6*>(a12.getA5()) == a12.getA6());
-
- assert(dynamic_cast<A7*>(a12.getA1_3()) == 0);
- assert(dynamic_cast<A7*>(a12.getA1_4()) == a12.getA7());
- assert(dynamic_cast<A7*>(a12.getA1_6()) == a12.getA7());
- assert(dynamic_cast<A7*>(a12.getA1_9()) == a12.getA7());
- assert(dynamic_cast<A7*>(a12.getA2()) == a12.getA7());
- assert(dynamic_cast<A7*>(a12.getA3()) == a12.getA7());
- assert(dynamic_cast<A7*>(a12.getA4()) == a12.getA7());
- assert(dynamic_cast<A7*>(a12.getA5()) == a12.getA7());
- assert(dynamic_cast<A7*>(a12.getA6()) == a12.getA7());
-
- assert(dynamic_cast<A8*>(a12.getA1_3()) == 0);
- assert(dynamic_cast<A8*>(a12.getA1_4()) == a12.getA8());
- assert(dynamic_cast<A8*>(a12.getA1_6()) == a12.getA8());
- assert(dynamic_cast<A8*>(a12.getA1_9()) == a12.getA8());
- assert(dynamic_cast<A8*>(a12.getA2()) == a12.getA8());
- assert(dynamic_cast<A8*>(a12.getA3()) == a12.getA8());
- assert(dynamic_cast<A8*>(a12.getA4()) == a12.getA8());
- assert(dynamic_cast<A8*>(a12.getA5()) == a12.getA8());
- assert(dynamic_cast<A8*>(a12.getA6()) == a12.getA8());
- assert(dynamic_cast<A8*>(a12.getA7()) == a12.getA8());
-
- assert(dynamic_cast<A9*>(a12.getA1_3()) == 0);
- assert(dynamic_cast<A9*>(a12.getA1_4()) == a12.getA9());
- assert(dynamic_cast<A9*>(a12.getA1_6()) == a12.getA9());
- assert(dynamic_cast<A9*>(a12.getA1_9()) == a12.getA9());
- assert(dynamic_cast<A9*>(a12.getA2()) == a12.getA9());
- assert(dynamic_cast<A9*>(a12.getA3()) == a12.getA9());
- assert(dynamic_cast<A9*>(a12.getA4()) == a12.getA9());
- assert(dynamic_cast<A9*>(a12.getA5()) == a12.getA9());
- assert(dynamic_cast<A9*>(a12.getA6()) == a12.getA9());
- assert(dynamic_cast<A9*>(a12.getA7()) == a12.getA9());
- assert(dynamic_cast<A9*>(a12.getA8()) == a12.getA9());
-
- assert(dynamic_cast<A10*>(a12.getA1_3()) == 0);
- assert(dynamic_cast<A10*>(a12.getA1_4()) == a12.getA10());
- assert(dynamic_cast<A10*>(a12.getA1_6()) == a12.getA10());
- assert(dynamic_cast<A10*>(a12.getA1_9()) == a12.getA10());
- assert(dynamic_cast<A10*>(a12.getA2()) == a12.getA10());
- assert(dynamic_cast<A10*>(a12.getA3()) == a12.getA10());
- assert(dynamic_cast<A10*>(a12.getA4()) == a12.getA10());
- assert(dynamic_cast<A10*>(a12.getA5()) == a12.getA10());
- assert(dynamic_cast<A10*>(a12.getA6()) == a12.getA10());
- assert(dynamic_cast<A10*>(a12.getA7()) == a12.getA10());
- assert(dynamic_cast<A10*>(a12.getA8()) == a12.getA10());
- assert(dynamic_cast<A10*>(a12.getA9()) == a12.getA10());
-
- assert(dynamic_cast<A11*>(a12.getA1_3()) == 0);
- assert(dynamic_cast<A11*>(a12.getA1_4()) == a12.getA11());
- assert(dynamic_cast<A11*>(a12.getA1_6()) == a12.getA11());
- assert(dynamic_cast<A11*>(a12.getA1_9()) == a12.getA11());
- assert(dynamic_cast<A11*>(a12.getA2()) == a12.getA11());
- assert(dynamic_cast<A11*>(a12.getA3()) == a12.getA11());
- assert(dynamic_cast<A11*>(a12.getA4()) == a12.getA11());
- assert(dynamic_cast<A11*>(a12.getA5()) == a12.getA11());
- assert(dynamic_cast<A11*>(a12.getA6()) == a12.getA11());
- assert(dynamic_cast<A11*>(a12.getA7()) == a12.getA11());
- assert(dynamic_cast<A11*>(a12.getA8()) == a12.getA11());
- assert(dynamic_cast<A11*>(a12.getA9()) == a12.getA11());
- assert(dynamic_cast<A11*>(a12.getA10()) == a12.getA11());
-
- assert(dynamic_cast<A12*>(a12.getA1_3()) == 0);
- assert(dynamic_cast<A12*>(a12.getA1_4()) == a12.getA12());
- assert(dynamic_cast<A12*>(a12.getA1_6()) == a12.getA12());
- assert(dynamic_cast<A12*>(a12.getA1_9()) == a12.getA12());
- assert(dynamic_cast<A12*>(a12.getA2()) == a12.getA12());
- assert(dynamic_cast<A12*>(a12.getA3()) == a12.getA12());
- assert(dynamic_cast<A12*>(a12.getA4()) == a12.getA12());
- assert(dynamic_cast<A12*>(a12.getA5()) == a12.getA12());
- assert(dynamic_cast<A12*>(a12.getA6()) == a12.getA12());
- assert(dynamic_cast<A12*>(a12.getA7()) == a12.getA12());
- assert(dynamic_cast<A12*>(a12.getA8()) == a12.getA12());
- assert(dynamic_cast<A12*>(a12.getA9()) == a12.getA12());
- assert(dynamic_cast<A12*>(a12.getA10()) == a12.getA12());
- assert(dynamic_cast<A12*>(a12.getA11()) == a12.getA12());
-
- assert(dynamic_cast<A3*>(a13.getA1_3()) == 0);
- assert(dynamic_cast<A3*>(a13.getA1_4()) == a13.getA3());
- assert(dynamic_cast<A3*>(a13.getA1_6()) == a13.getA3());
- assert(dynamic_cast<A3*>(a13.getA1_9()) == a13.getA3());
- assert(dynamic_cast<A3*>(a13.getA2()) == a13.getA3());
-
- assert(dynamic_cast<A4*>(a13.getA1_3()) == 0);
- assert(dynamic_cast<A4*>(a13.getA1_4()) == a13.getA4());
- assert(dynamic_cast<A4*>(a13.getA1_6()) == a13.getA4());
- assert(dynamic_cast<A4*>(a13.getA1_9()) == a13.getA4());
- assert(dynamic_cast<A4*>(a13.getA2()) == a13.getA4());
- assert(dynamic_cast<A4*>(a13.getA3()) == a13.getA4());
-
- assert(dynamic_cast<A5*>(a13.getA1_3()) == 0);
- assert(dynamic_cast<A5*>(a13.getA1_4()) == a13.getA5());
- assert(dynamic_cast<A5*>(a13.getA1_6()) == a13.getA5());
- assert(dynamic_cast<A5*>(a13.getA1_9()) == a13.getA5());
- assert(dynamic_cast<A5*>(a13.getA2()) == a13.getA5());
- assert(dynamic_cast<A5*>(a13.getA3()) == a13.getA5());
- assert(dynamic_cast<A5*>(a13.getA4()) == a13.getA5());
-
- assert(dynamic_cast<A6*>(a13.getA1_3()) == 0);
- assert(dynamic_cast<A6*>(a13.getA1_4()) == a13.getA6());
- assert(dynamic_cast<A6*>(a13.getA1_6()) == a13.getA6());
- assert(dynamic_cast<A6*>(a13.getA1_9()) == a13.getA6());
- assert(dynamic_cast<A6*>(a13.getA2()) == a13.getA6());
- assert(dynamic_cast<A6*>(a13.getA3()) == a13.getA6());
- assert(dynamic_cast<A6*>(a13.getA4()) == a13.getA6());
- assert(dynamic_cast<A6*>(a13.getA5()) == a13.getA6());
-
- assert(dynamic_cast<A7*>(a13.getA1_3()) == 0);
- assert(dynamic_cast<A7*>(a13.getA1_4()) == a13.getA7());
- assert(dynamic_cast<A7*>(a13.getA1_6()) == a13.getA7());
- assert(dynamic_cast<A7*>(a13.getA1_9()) == a13.getA7());
- assert(dynamic_cast<A7*>(a13.getA2()) == a13.getA7());
- assert(dynamic_cast<A7*>(a13.getA3()) == a13.getA7());
- assert(dynamic_cast<A7*>(a13.getA4()) == a13.getA7());
- assert(dynamic_cast<A7*>(a13.getA5()) == a13.getA7());
- assert(dynamic_cast<A7*>(a13.getA6()) == a13.getA7());
-
- assert(dynamic_cast<A8*>(a13.getA1_3()) == 0);
- assert(dynamic_cast<A8*>(a13.getA1_4()) == a13.getA8());
- assert(dynamic_cast<A8*>(a13.getA1_6()) == a13.getA8());
- assert(dynamic_cast<A8*>(a13.getA1_9()) == a13.getA8());
- assert(dynamic_cast<A8*>(a13.getA2()) == a13.getA8());
- assert(dynamic_cast<A8*>(a13.getA3()) == a13.getA8());
- assert(dynamic_cast<A8*>(a13.getA4()) == a13.getA8());
- assert(dynamic_cast<A8*>(a13.getA5()) == a13.getA8());
- assert(dynamic_cast<A8*>(a13.getA6()) == a13.getA8());
- assert(dynamic_cast<A8*>(a13.getA7()) == a13.getA8());
-
- assert(dynamic_cast<A9*>(a13.getA1_3()) == 0);
- assert(dynamic_cast<A9*>(a13.getA1_4()) == a13.getA9());
- assert(dynamic_cast<A9*>(a13.getA1_6()) == a13.getA9());
- assert(dynamic_cast<A9*>(a13.getA1_9()) == a13.getA9());
- assert(dynamic_cast<A9*>(a13.getA2()) == a13.getA9());
- assert(dynamic_cast<A9*>(a13.getA3()) == a13.getA9());
- assert(dynamic_cast<A9*>(a13.getA4()) == a13.getA9());
- assert(dynamic_cast<A9*>(a13.getA5()) == a13.getA9());
- assert(dynamic_cast<A9*>(a13.getA6()) == a13.getA9());
- assert(dynamic_cast<A9*>(a13.getA7()) == a13.getA9());
- assert(dynamic_cast<A9*>(a13.getA8()) == a13.getA9());
-
- assert(dynamic_cast<A10*>(a13.getA1_3()) == 0);
- assert(dynamic_cast<A10*>(a13.getA1_4()) == a13.getA10());
- assert(dynamic_cast<A10*>(a13.getA1_6()) == a13.getA10());
- assert(dynamic_cast<A10*>(a13.getA1_9()) == a13.getA10());
- assert(dynamic_cast<A10*>(a13.getA2()) == a13.getA10());
- assert(dynamic_cast<A10*>(a13.getA3()) == a13.getA10());
- assert(dynamic_cast<A10*>(a13.getA4()) == a13.getA10());
- assert(dynamic_cast<A10*>(a13.getA5()) == a13.getA10());
- assert(dynamic_cast<A10*>(a13.getA6()) == a13.getA10());
- assert(dynamic_cast<A10*>(a13.getA7()) == a13.getA10());
- assert(dynamic_cast<A10*>(a13.getA8()) == a13.getA10());
- assert(dynamic_cast<A10*>(a13.getA9()) == a13.getA10());
-
- assert(dynamic_cast<A11*>(a13.getA1_3()) == 0);
- assert(dynamic_cast<A11*>(a13.getA1_4()) == a13.getA11());
- assert(dynamic_cast<A11*>(a13.getA1_6()) == a13.getA11());
- assert(dynamic_cast<A11*>(a13.getA1_9()) == a13.getA11());
- assert(dynamic_cast<A11*>(a13.getA2()) == a13.getA11());
- assert(dynamic_cast<A11*>(a13.getA3()) == a13.getA11());
- assert(dynamic_cast<A11*>(a13.getA4()) == a13.getA11());
- assert(dynamic_cast<A11*>(a13.getA5()) == a13.getA11());
- assert(dynamic_cast<A11*>(a13.getA6()) == a13.getA11());
- assert(dynamic_cast<A11*>(a13.getA7()) == a13.getA11());
- assert(dynamic_cast<A11*>(a13.getA8()) == a13.getA11());
- assert(dynamic_cast<A11*>(a13.getA9()) == a13.getA11());
- assert(dynamic_cast<A11*>(a13.getA10()) == a13.getA11());
-
- assert(dynamic_cast<A12*>(a13.getA1_3()) == 0);
- assert(dynamic_cast<A12*>(a13.getA1_4()) == a13.getA12());
- assert(dynamic_cast<A12*>(a13.getA1_6()) == a13.getA12());
- assert(dynamic_cast<A12*>(a13.getA1_9()) == a13.getA12());
- assert(dynamic_cast<A12*>(a13.getA2()) == a13.getA12());
- assert(dynamic_cast<A12*>(a13.getA3()) == a13.getA12());
- assert(dynamic_cast<A12*>(a13.getA4()) == a13.getA12());
- assert(dynamic_cast<A12*>(a13.getA5()) == a13.getA12());
- assert(dynamic_cast<A12*>(a13.getA6()) == a13.getA12());
- assert(dynamic_cast<A12*>(a13.getA7()) == a13.getA12());
- assert(dynamic_cast<A12*>(a13.getA8()) == a13.getA12());
- assert(dynamic_cast<A12*>(a13.getA9()) == a13.getA12());
- assert(dynamic_cast<A12*>(a13.getA10()) == a13.getA12());
- assert(dynamic_cast<A12*>(a13.getA11()) == a13.getA12());
-
- assert(dynamic_cast<A13*>(a13.getA1_3()) == 0);
- assert(dynamic_cast<A13*>(a13.getA1_4()) == a13.getA13());
- assert(dynamic_cast<A13*>(a13.getA1_6()) == a13.getA13());
- assert(dynamic_cast<A13*>(a13.getA1_9()) == a13.getA13());
- assert(dynamic_cast<A13*>(a13.getA2()) == a13.getA13());
- assert(dynamic_cast<A13*>(a13.getA3()) == a13.getA13());
- assert(dynamic_cast<A13*>(a13.getA4()) == a13.getA13());
- assert(dynamic_cast<A13*>(a13.getA5()) == a13.getA13());
- assert(dynamic_cast<A13*>(a13.getA6()) == a13.getA13());
- assert(dynamic_cast<A13*>(a13.getA7()) == a13.getA13());
- assert(dynamic_cast<A13*>(a13.getA8()) == a13.getA13());
- assert(dynamic_cast<A13*>(a13.getA9()) == a13.getA13());
- assert(dynamic_cast<A13*>(a13.getA10()) == a13.getA13());
- assert(dynamic_cast<A13*>(a13.getA11()) == a13.getA13());
- assert(dynamic_cast<A13*>(a13.getA12()) == a13.getA13());
-}
-
-} // t2
-
-namespace t3
-{
-
-struct A1
-{
- char _[43981];
- virtual ~A1() {}
-
- A1* getA1() {return this;}
-};
-
-struct A2
-{
- char _[34981];
- virtual ~A2() {}
-
- A2* getA2() {return this;}
-};
-
-struct A3
- : public A1,
- protected virtual A2
-{
- char _[93481];
- virtual ~A3() {}
-
- A1* getA1_3() {return A1::getA1();}
- A2* getA2() {return A2::getA2();}
- A3* getA3() {return this;}
-};
-
-struct A4
- : public virtual A2,
- public A1
-{
- char _[13489];
- virtual ~A4() {}
-
- A1* getA1_4() {return A1::getA1();}
- A2* getA2() {return A2::getA2();}
- A4* getA4() {return this;}
-};
-
-struct A5
- : public A3,
- public A4
-{
- char _[13489];
- virtual ~A5() {}
-
- A1* getA1_3() {return A3::getA1();}
- A1* getA1_4() {return A4::getA1();}
- A2* getA2() {return A3::getA2();}
- A3* getA3() {return A3::getA3();}
- A4* getA4() {return A4::getA4();}
- A5* getA5() {return this;}
-};
-
-struct A6
- : public A1
-{
- char _[81349];
- virtual ~A6() {}
-
- A1* getA1_6() {return A1::getA1();}
- A6* getA6() {return this;}
-};
-
-struct A7
- : public A5,
- public A6
-{
- char _[34819];
- virtual ~A7() {}
-
- A1* getA1_3() {return A5::getA1_3();}
- A1* getA1_4() {return A5::getA1_4();}
- A1* getA1_6() {return A6::getA1_6();}
- A2* getA2() {return A5::getA2();}
- A3* getA3() {return A5::getA3();}
- A4* getA4() {return A5::getA4();}
- A5* getA5() {return A5::getA5();}
- A6* getA6() {return A6::getA6();}
- A7* getA7() {return this;}
-};
-
-struct A8
- : public A7
-{
- char _[3489];
- virtual ~A8() {}
-
- A1* getA1_3() {return A7::getA1_3();}
- A1* getA1_4() {return A7::getA1_4();}
- A1* getA1_6() {return A7::getA1_6();}
- A2* getA2() {return A7::getA2();}
- A3* getA3() {return A7::getA3();}
- A4* getA4() {return A7::getA4();}
- A5* getA5() {return A7::getA5();}
- A6* getA6() {return A7::getA6();}
- A7* getA7() {return A7::getA7();}
- A8* getA8() {return this;}
-};
-
-struct A9
- : public A1
-{
- char _[3481];
- virtual ~A9() {}
-
- A1* getA1_9() {return A1::getA1();}
- A9* getA9() {return this;}
-};
-
-struct A10
- : public virtual A8
-{
- char _[4831];
- virtual ~A10() {}
-
- A1* getA1_3() {return A8::getA1_3();}
- A1* getA1_4() {return A8::getA1_4();}
- A1* getA1_6() {return A8::getA1_6();}
- A2* getA2() {return A8::getA2();}
- A3* getA3() {return A8::getA3();}
- A4* getA4() {return A8::getA4();}
- A5* getA5() {return A8::getA5();}
- A6* getA6() {return A8::getA6();}
- A7* getA7() {return A8::getA7();}
- A8* getA8() {return A8::getA8();}
- A10* getA10() {return this;}
-};
-
-struct A11
- : public virtual A8,
- public A9
-{
- char _[6483];
- virtual ~A11() {}
-
- A1* getA1_3() {return A8::getA1_3();}
- A1* getA1_4() {return A8::getA1_4();}
- A1* getA1_6() {return A8::getA1_6();}
- A1* getA1_9() {return A9::getA1_9();}
- A2* getA2() {return A8::getA2();}
- A3* getA3() {return A8::getA3();}
- A4* getA4() {return A8::getA4();}
- A5* getA5() {return A8::getA5();}
- A6* getA6() {return A8::getA6();}
- A7* getA7() {return A8::getA7();}
- A8* getA8() {return A8::getA8();}
- A9* getA9() {return A9::getA9();}
- A11* getA11() {return this;}
-};
-
-struct A12
- : public A10,
- public A11
-{
- char _[2283];
- virtual ~A12() {}
-
- A1* getA1_3() {return A10::getA1_3();}
- A1* getA1_4() {return A10::getA1_4();}
- A1* getA1_6() {return A10::getA1_6();}
- A1* getA1_9() {return A11::getA1_9();}
- A2* getA2() {return A10::getA2();}
- A3* getA3() {return A10::getA3();}
- A4* getA4() {return A10::getA4();}
- A5* getA5() {return A10::getA5();}
- A6* getA6() {return A10::getA6();}
- A7* getA7() {return A10::getA7();}
- A8* getA8() {return A10::getA8();}
- A9* getA9() {return A11::getA9();}
- A10* getA10() {return A10::getA10();}
- A11* getA11() {return A11::getA11();}
- A12* getA12() {return this;}
-};
-
-struct A13
- : public A12
-{
- char _[1283];
- virtual ~A13() {}
-
- A1* getA1_3() {return A12::getA1_3();}
- A1* getA1_4() {return A12::getA1_4();}
- A1* getA1_6() {return A12::getA1_6();}
- A1* getA1_9() {return A12::getA1_9();}
- A2* getA2() {return A12::getA2();}
- A3* getA3() {return A12::getA3();}
- A4* getA4() {return A12::getA4();}
- A5* getA5() {return A12::getA5();}
- A6* getA6() {return A12::getA6();}
- A7* getA7() {return A12::getA7();}
- A8* getA8() {return A12::getA8();}
- A9* getA9() {return A12::getA9();}
- A10* getA10() {return A12::getA10();}
- A11* getA11() {return A12::getA11();}
- A12* getA12() {return A12::getA12();}
- A13* getA13() {return this;}
-};
-
-void test()
-{
- A3 a3;
- A4 a4;
- A5 a5;
- A6 a6;
- A7 a7;
- A8 a8;
- A9 a9;
- A10 a10;
- A11 a11;
- A12 a12;
- A13 a13;
-
- assert(dynamic_cast<A3*>(a3.getA1_3()) == a3.getA3());
- assert(dynamic_cast<A3*>(a3.getA2()) == 0);
-
- assert(dynamic_cast<A3*>(a4.getA1_4()) == 0);
- assert(dynamic_cast<A3*>(a4.getA2()) == 0);
- assert(dynamic_cast<A4*>(a4.getA1_4()) == a4.getA4());
- assert(dynamic_cast<A4*>(a4.getA2()) == a4.getA4());
-
- assert(dynamic_cast<A3*>(a5.getA1_3()) == a5.getA3());
- assert(dynamic_cast<A3*>(a5.getA2()) == a5.getA3());
-
- assert(dynamic_cast<A4*>(a5.getA1_3()) == a5.getA4());
- assert(dynamic_cast<A4*>(a5.getA1_4()) == a5.getA4());
- assert(dynamic_cast<A4*>(a5.getA3()) == a5.getA4());
- assert(dynamic_cast<A4*>(a5.getA3()) == a5.getA4());
-
- assert(dynamic_cast<A5*>(a5.getA1_3()) == a5.getA5());
- assert(dynamic_cast<A5*>(a5.getA1_4()) == a5.getA5());
- assert(dynamic_cast<A5*>(a5.getA3()) == a5.getA5());
- assert(dynamic_cast<A5*>(a5.getA3()) == a5.getA5());
- assert(dynamic_cast<A5*>(a5.getA3()) == a5.getA5());
- assert(dynamic_cast<A5*>(a5.getA4()) == a5.getA5());
-
- assert(dynamic_cast<A3*>(a6.getA1_6()) == 0);
-
- assert(dynamic_cast<A4*>(a6.getA1_6()) == 0);
-
- assert(dynamic_cast<A5*>(a6.getA1_6()) == 0);
-
- assert(dynamic_cast<A6*>(a6.getA1_6()) == a6.getA6());
-
- assert(dynamic_cast<A3*>(a7.getA1_3()) == a7.getA3());
- assert(dynamic_cast<A3*>(a7.getA1_4()) == a7.getA3());
- assert(dynamic_cast<A3*>(a7.getA2()) == a7.getA3());
-
- assert(dynamic_cast<A4*>(a7.getA1_3()) == a7.getA4());
- assert(dynamic_cast<A4*>(a7.getA1_4()) == a7.getA4());
- assert(dynamic_cast<A4*>(a7.getA2()) == a7.getA4());
- assert(dynamic_cast<A4*>(a7.getA3()) == a7.getA4());
-
- assert(dynamic_cast<A5*>(a7.getA1_3()) == a7.getA5());
- assert(dynamic_cast<A5*>(a7.getA1_4()) == a7.getA5());
- assert(dynamic_cast<A5*>(a7.getA2()) == a7.getA5());
- assert(dynamic_cast<A5*>(a7.getA3()) == a7.getA5());
- assert(dynamic_cast<A5*>(a7.getA4()) == a7.getA5());
-
- assert(dynamic_cast<A6*>(a7.getA1_3()) == a7.getA6());
- assert(dynamic_cast<A6*>(a7.getA1_4()) == a7.getA6());
- assert(dynamic_cast<A6*>(a7.getA1_6()) == a7.getA6());
- assert(dynamic_cast<A6*>(a7.getA2()) == a7.getA6());
- assert(dynamic_cast<A6*>(a7.getA3()) == a7.getA6());
- assert(dynamic_cast<A6*>(a7.getA4()) == a7.getA6());
- assert(dynamic_cast<A6*>(a7.getA5()) == a7.getA6());
-
- assert(dynamic_cast<A7*>(a7.getA1_3()) == a7.getA7());
- assert(dynamic_cast<A7*>(a7.getA1_4()) == a7.getA7());
- assert(dynamic_cast<A7*>(a7.getA1_6()) == a7.getA7());
- assert(dynamic_cast<A7*>(a7.getA2()) == a7.getA7());
- assert(dynamic_cast<A7*>(a7.getA3()) == a7.getA7());
- assert(dynamic_cast<A7*>(a7.getA4()) == a7.getA7());
- assert(dynamic_cast<A7*>(a7.getA5()) == a7.getA7());
- assert(dynamic_cast<A7*>(a7.getA6()) == a7.getA7());
-
- assert(dynamic_cast<A3*>(a8.getA1_3()) == a8.getA3());
- assert(dynamic_cast<A3*>(a8.getA1_4()) == a8.getA3());
- assert(dynamic_cast<A3*>(a8.getA2()) == a8.getA3());
-
- assert(dynamic_cast<A4*>(a8.getA1_3()) == a8.getA4());
- assert(dynamic_cast<A4*>(a8.getA1_4()) == a8.getA4());
- assert(dynamic_cast<A4*>(a8.getA2()) == a8.getA4());
- assert(dynamic_cast<A4*>(a8.getA3()) == a8.getA4());
-
- assert(dynamic_cast<A5*>(a8.getA1_3()) == a8.getA5());
- assert(dynamic_cast<A5*>(a8.getA1_4()) == a8.getA5());
- assert(dynamic_cast<A5*>(a8.getA2()) == a8.getA5());
- assert(dynamic_cast<A5*>(a8.getA3()) == a8.getA5());
- assert(dynamic_cast<A5*>(a8.getA4()) == a8.getA5());
-
- assert(dynamic_cast<A6*>(a8.getA1_3()) == a8.getA6());
- assert(dynamic_cast<A6*>(a8.getA1_4()) == a8.getA6());
- assert(dynamic_cast<A6*>(a8.getA1_6()) == a8.getA6());
- assert(dynamic_cast<A6*>(a8.getA2()) == a8.getA6());
- assert(dynamic_cast<A6*>(a8.getA3()) == a8.getA6());
- assert(dynamic_cast<A6*>(a8.getA4()) == a8.getA6());
- assert(dynamic_cast<A6*>(a8.getA5()) == a8.getA6());
-
- assert(dynamic_cast<A7*>(a8.getA1_3()) == a8.getA7());
- assert(dynamic_cast<A7*>(a8.getA1_4()) == a8.getA7());
- assert(dynamic_cast<A7*>(a8.getA1_6()) == a8.getA7());
- assert(dynamic_cast<A7*>(a8.getA2()) == a8.getA7());
- assert(dynamic_cast<A7*>(a8.getA3()) == a8.getA7());
- assert(dynamic_cast<A7*>(a8.getA4()) == a8.getA7());
- assert(dynamic_cast<A7*>(a8.getA5()) == a8.getA7());
- assert(dynamic_cast<A7*>(a8.getA6()) == a8.getA7());
-
- assert(dynamic_cast<A8*>(a8.getA1_3()) == a8.getA8());
- assert(dynamic_cast<A8*>(a8.getA1_4()) == a8.getA8());
- assert(dynamic_cast<A8*>(a8.getA1_6()) == a8.getA8());
- assert(dynamic_cast<A8*>(a8.getA2()) == a8.getA8());
- assert(dynamic_cast<A8*>(a8.getA3()) == a8.getA8());
- assert(dynamic_cast<A8*>(a8.getA4()) == a8.getA8());
- assert(dynamic_cast<A8*>(a8.getA5()) == a8.getA8());
- assert(dynamic_cast<A8*>(a8.getA6()) == a8.getA8());
- assert(dynamic_cast<A8*>(a8.getA7()) == a8.getA8());
-
- assert(dynamic_cast<A3*>(a9.getA1_9()) == 0);
-
- assert(dynamic_cast<A4*>(a9.getA1_9()) == 0);
-
- assert(dynamic_cast<A5*>(a9.getA1_9()) == 0);
-
- assert(dynamic_cast<A6*>(a9.getA1_9()) == 0);
-
- assert(dynamic_cast<A7*>(a9.getA1_9()) == 0);
-
- assert(dynamic_cast<A8*>(a9.getA1_9()) == 0);
-
- assert(dynamic_cast<A9*>(a9.getA1_9()) == a9.getA9());
-
- assert(dynamic_cast<A3*>(a10.getA1_3()) == a10.getA3());
- assert(dynamic_cast<A3*>(a10.getA1_4()) == a10.getA3());
- assert(dynamic_cast<A3*>(a10.getA1_6()) == a10.getA3());
- assert(dynamic_cast<A3*>(a10.getA2()) == a10.getA3());
-
- assert(dynamic_cast<A4*>(a10.getA1_3()) == a10.getA4());
- assert(dynamic_cast<A4*>(a10.getA1_4()) == a10.getA4());
- assert(dynamic_cast<A4*>(a10.getA1_6()) == a10.getA4());
- assert(dynamic_cast<A4*>(a10.getA2()) == a10.getA4());
- assert(dynamic_cast<A4*>(a10.getA3()) == a10.getA4());
-
- assert(dynamic_cast<A5*>(a10.getA1_3()) == a10.getA5());
- assert(dynamic_cast<A5*>(a10.getA1_4()) == a10.getA5());
- assert(dynamic_cast<A5*>(a10.getA1_6()) == a10.getA5());
- assert(dynamic_cast<A5*>(a10.getA2()) == a10.getA5());
- assert(dynamic_cast<A5*>(a10.getA3()) == a10.getA5());
- assert(dynamic_cast<A5*>(a10.getA4()) == a10.getA5());
-
- assert(dynamic_cast<A6*>(a10.getA1_3()) == a10.getA6());
- assert(dynamic_cast<A6*>(a10.getA1_4()) == a10.getA6());
- assert(dynamic_cast<A6*>(a10.getA1_6()) == a10.getA6());
- assert(dynamic_cast<A6*>(a10.getA2()) == a10.getA6());
- assert(dynamic_cast<A6*>(a10.getA3()) == a10.getA6());
- assert(dynamic_cast<A6*>(a10.getA4()) == a10.getA6());
- assert(dynamic_cast<A6*>(a10.getA5()) == a10.getA6());
-
- assert(dynamic_cast<A7*>(a10.getA1_3()) == a10.getA7());
- assert(dynamic_cast<A7*>(a10.getA1_4()) == a10.getA7());
- assert(dynamic_cast<A7*>(a10.getA1_6()) == a10.getA7());
- assert(dynamic_cast<A7*>(a10.getA2()) == a10.getA7());
- assert(dynamic_cast<A7*>(a10.getA3()) == a10.getA7());
- assert(dynamic_cast<A7*>(a10.getA4()) == a10.getA7());
- assert(dynamic_cast<A7*>(a10.getA5()) == a10.getA7());
- assert(dynamic_cast<A7*>(a10.getA6()) == a10.getA7());
-
- assert(dynamic_cast<A8*>(a10.getA1_3()) == a10.getA8());
- assert(dynamic_cast<A8*>(a10.getA1_4()) == a10.getA8());
- assert(dynamic_cast<A8*>(a10.getA1_6()) == a10.getA8());
- assert(dynamic_cast<A8*>(a10.getA2()) == a10.getA8());
- assert(dynamic_cast<A8*>(a10.getA3()) == a10.getA8());
- assert(dynamic_cast<A8*>(a10.getA4()) == a10.getA8());
- assert(dynamic_cast<A8*>(a10.getA5()) == a10.getA8());
- assert(dynamic_cast<A8*>(a10.getA6()) == a10.getA8());
- assert(dynamic_cast<A8*>(a10.getA7()) == a10.getA8());
-
- assert(dynamic_cast<A9*>(a10.getA1_3()) == 0);
- assert(dynamic_cast<A9*>(a10.getA1_4()) == 0);
- assert(dynamic_cast<A9*>(a10.getA1_6()) == 0);
- assert(dynamic_cast<A9*>(a10.getA2()) == 0);
- assert(dynamic_cast<A9*>(a10.getA3()) == 0);
- assert(dynamic_cast<A9*>(a10.getA4()) == 0);
- assert(dynamic_cast<A9*>(a10.getA5()) == 0);
- assert(dynamic_cast<A9*>(a10.getA6()) == 0);
- assert(dynamic_cast<A9*>(a10.getA7()) == 0);
- assert(dynamic_cast<A9*>(a10.getA8()) == 0);
-
- assert(dynamic_cast<A10*>(a10.getA1_3()) == a10.getA10());
- assert(dynamic_cast<A10*>(a10.getA1_4()) == a10.getA10());
- assert(dynamic_cast<A10*>(a10.getA1_6()) == a10.getA10());
- assert(dynamic_cast<A10*>(a10.getA2()) == a10.getA10());
- assert(dynamic_cast<A10*>(a10.getA3()) == a10.getA10());
- assert(dynamic_cast<A10*>(a10.getA4()) == a10.getA10());
- assert(dynamic_cast<A10*>(a10.getA5()) == a10.getA10());
- assert(dynamic_cast<A10*>(a10.getA6()) == a10.getA10());
- assert(dynamic_cast<A10*>(a10.getA7()) == a10.getA10());
- assert(dynamic_cast<A10*>(a10.getA8()) == a10.getA10());
-
- assert(dynamic_cast<A3*>(a11.getA1_3()) == a11.getA3());
- assert(dynamic_cast<A3*>(a11.getA1_4()) == a11.getA3());
- assert(dynamic_cast<A3*>(a11.getA1_6()) == a11.getA3());
- assert(dynamic_cast<A3*>(a11.getA1_9()) == a11.getA3());
- assert(dynamic_cast<A3*>(a11.getA2()) == a11.getA3());
-
- assert(dynamic_cast<A4*>(a11.getA1_3()) == a11.getA4());
- assert(dynamic_cast<A4*>(a11.getA1_4()) == a11.getA4());
- assert(dynamic_cast<A4*>(a11.getA1_6()) == a11.getA4());
- assert(dynamic_cast<A4*>(a11.getA1_9()) == a11.getA4());
- assert(dynamic_cast<A4*>(a11.getA2()) == a11.getA4());
- assert(dynamic_cast<A4*>(a11.getA3()) == a11.getA4());
-
- assert(dynamic_cast<A5*>(a11.getA1_3()) == a11.getA5());
- assert(dynamic_cast<A5*>(a11.getA1_4()) == a11.getA5());
- assert(dynamic_cast<A5*>(a11.getA1_6()) == a11.getA5());
- assert(dynamic_cast<A5*>(a11.getA1_9()) == a11.getA5());
- assert(dynamic_cast<A5*>(a11.getA2()) == a11.getA5());
- assert(dynamic_cast<A5*>(a11.getA3()) == a11.getA5());
- assert(dynamic_cast<A5*>(a11.getA4()) == a11.getA5());
-
- assert(dynamic_cast<A6*>(a11.getA1_3()) == a11.getA6());
- assert(dynamic_cast<A6*>(a11.getA1_4()) == a11.getA6());
- assert(dynamic_cast<A6*>(a11.getA1_6()) == a11.getA6());
- assert(dynamic_cast<A6*>(a11.getA1_9()) == a11.getA6());
- assert(dynamic_cast<A6*>(a11.getA2()) == a11.getA6());
- assert(dynamic_cast<A6*>(a11.getA3()) == a11.getA6());
- assert(dynamic_cast<A6*>(a11.getA4()) == a11.getA6());
- assert(dynamic_cast<A6*>(a11.getA5()) == a11.getA6());
-
- assert(dynamic_cast<A7*>(a11.getA1_3()) == a11.getA7());
- assert(dynamic_cast<A7*>(a11.getA1_4()) == a11.getA7());
- assert(dynamic_cast<A7*>(a11.getA1_6()) == a11.getA7());
- assert(dynamic_cast<A7*>(a11.getA1_9()) == a11.getA7());
- assert(dynamic_cast<A7*>(a11.getA2()) == a11.getA7());
- assert(dynamic_cast<A7*>(a11.getA3()) == a11.getA7());
- assert(dynamic_cast<A7*>(a11.getA4()) == a11.getA7());
- assert(dynamic_cast<A7*>(a11.getA5()) == a11.getA7());
- assert(dynamic_cast<A7*>(a11.getA6()) == a11.getA7());
-
- assert(dynamic_cast<A8*>(a11.getA1_3()) == a11.getA8());
- assert(dynamic_cast<A8*>(a11.getA1_4()) == a11.getA8());
- assert(dynamic_cast<A8*>(a11.getA1_6()) == a11.getA8());
- assert(dynamic_cast<A8*>(a11.getA1_9()) == a11.getA8());
- assert(dynamic_cast<A8*>(a11.getA2()) == a11.getA8());
- assert(dynamic_cast<A8*>(a11.getA3()) == a11.getA8());
- assert(dynamic_cast<A8*>(a11.getA4()) == a11.getA8());
- assert(dynamic_cast<A8*>(a11.getA5()) == a11.getA8());
- assert(dynamic_cast<A8*>(a11.getA6()) == a11.getA8());
- assert(dynamic_cast<A8*>(a11.getA7()) == a11.getA8());
-
- assert(dynamic_cast<A9*>(a11.getA1_3()) == a11.getA9());
- assert(dynamic_cast<A9*>(a11.getA1_4()) == a11.getA9());
- assert(dynamic_cast<A9*>(a11.getA1_6()) == a11.getA9());
- assert(dynamic_cast<A9*>(a11.getA1_9()) == a11.getA9());
- assert(dynamic_cast<A9*>(a11.getA2()) == a11.getA9());
- assert(dynamic_cast<A9*>(a11.getA3()) == a11.getA9());
- assert(dynamic_cast<A9*>(a11.getA4()) == a11.getA9());
- assert(dynamic_cast<A9*>(a11.getA5()) == a11.getA9());
- assert(dynamic_cast<A9*>(a11.getA6()) == a11.getA9());
- assert(dynamic_cast<A9*>(a11.getA7()) == a11.getA9());
- assert(dynamic_cast<A9*>(a11.getA8()) == a11.getA9());
-
- assert(dynamic_cast<A10*>(a11.getA1_3()) == 0);
- assert(dynamic_cast<A10*>(a11.getA1_4()) == 0);
- assert(dynamic_cast<A10*>(a11.getA1_6()) == 0);
- assert(dynamic_cast<A10*>(a11.getA1_9()) == 0);
- assert(dynamic_cast<A10*>(a11.getA2()) == 0);
- assert(dynamic_cast<A10*>(a11.getA3()) == 0);
- assert(dynamic_cast<A10*>(a11.getA4()) == 0);
- assert(dynamic_cast<A10*>(a11.getA5()) == 0);
- assert(dynamic_cast<A10*>(a11.getA6()) == 0);
- assert(dynamic_cast<A10*>(a11.getA7()) == 0);
- assert(dynamic_cast<A10*>(a11.getA8()) == 0);
- assert(dynamic_cast<A10*>(a11.getA9()) == 0);
-
- assert(dynamic_cast<A11*>(a11.getA1_3()) == a11.getA11());
- assert(dynamic_cast<A11*>(a11.getA1_4()) == a11.getA11());
- assert(dynamic_cast<A11*>(a11.getA1_6()) == a11.getA11());
- assert(dynamic_cast<A11*>(a11.getA1_9()) == a11.getA11());
- assert(dynamic_cast<A11*>(a11.getA2()) == a11.getA11());
- assert(dynamic_cast<A11*>(a11.getA3()) == a11.getA11());
- assert(dynamic_cast<A11*>(a11.getA4()) == a11.getA11());
- assert(dynamic_cast<A11*>(a11.getA5()) == a11.getA11());
- assert(dynamic_cast<A11*>(a11.getA6()) == a11.getA11());
- assert(dynamic_cast<A11*>(a11.getA7()) == a11.getA11());
- assert(dynamic_cast<A11*>(a11.getA8()) == a11.getA11());
- assert(dynamic_cast<A11*>(a11.getA9()) == a11.getA11());
-
- assert(dynamic_cast<A3*>(a12.getA1_3()) == a12.getA3());
- assert(dynamic_cast<A3*>(a12.getA1_4()) == a12.getA3());
- assert(dynamic_cast<A3*>(a12.getA1_6()) == a12.getA3());
- assert(dynamic_cast<A3*>(a12.getA1_9()) == a12.getA3());
- assert(dynamic_cast<A3*>(a12.getA2()) == a12.getA3());
-
- assert(dynamic_cast<A4*>(a12.getA1_3()) == a12.getA4());
- assert(dynamic_cast<A4*>(a12.getA1_4()) == a12.getA4());
- assert(dynamic_cast<A4*>(a12.getA1_6()) == a12.getA4());
- assert(dynamic_cast<A4*>(a12.getA1_9()) == a12.getA4());
- assert(dynamic_cast<A4*>(a12.getA2()) == a12.getA4());
- assert(dynamic_cast<A4*>(a12.getA3()) == a12.getA4());
-
- assert(dynamic_cast<A5*>(a12.getA1_3()) == a12.getA5());
- assert(dynamic_cast<A5*>(a12.getA1_4()) == a12.getA5());
- assert(dynamic_cast<A5*>(a12.getA1_6()) == a12.getA5());
- assert(dynamic_cast<A5*>(a12.getA1_9()) == a12.getA5());
- assert(dynamic_cast<A5*>(a12.getA2()) == a12.getA5());
- assert(dynamic_cast<A5*>(a12.getA3()) == a12.getA5());
- assert(dynamic_cast<A5*>(a12.getA4()) == a12.getA5());
-
- assert(dynamic_cast<A6*>(a12.getA1_3()) == a12.getA6());
- assert(dynamic_cast<A6*>(a12.getA1_4()) == a12.getA6());
- assert(dynamic_cast<A6*>(a12.getA1_6()) == a12.getA6());
- assert(dynamic_cast<A6*>(a12.getA1_9()) == a12.getA6());
- assert(dynamic_cast<A6*>(a12.getA2()) == a12.getA6());
- assert(dynamic_cast<A6*>(a12.getA3()) == a12.getA6());
- assert(dynamic_cast<A6*>(a12.getA4()) == a12.getA6());
- assert(dynamic_cast<A6*>(a12.getA5()) == a12.getA6());
-
- assert(dynamic_cast<A7*>(a12.getA1_3()) == a12.getA7());
- assert(dynamic_cast<A7*>(a12.getA1_4()) == a12.getA7());
- assert(dynamic_cast<A7*>(a12.getA1_6()) == a12.getA7());
- assert(dynamic_cast<A7*>(a12.getA1_9()) == a12.getA7());
- assert(dynamic_cast<A7*>(a12.getA2()) == a12.getA7());
- assert(dynamic_cast<A7*>(a12.getA3()) == a12.getA7());
- assert(dynamic_cast<A7*>(a12.getA4()) == a12.getA7());
- assert(dynamic_cast<A7*>(a12.getA5()) == a12.getA7());
- assert(dynamic_cast<A7*>(a12.getA6()) == a12.getA7());
-
- assert(dynamic_cast<A8*>(a12.getA1_3()) == a12.getA8());
- assert(dynamic_cast<A8*>(a12.getA1_4()) == a12.getA8());
- assert(dynamic_cast<A8*>(a12.getA1_6()) == a12.getA8());
- assert(dynamic_cast<A8*>(a12.getA1_9()) == a12.getA8());
- assert(dynamic_cast<A8*>(a12.getA2()) == a12.getA8());
- assert(dynamic_cast<A8*>(a12.getA3()) == a12.getA8());
- assert(dynamic_cast<A8*>(a12.getA4()) == a12.getA8());
- assert(dynamic_cast<A8*>(a12.getA5()) == a12.getA8());
- assert(dynamic_cast<A8*>(a12.getA6()) == a12.getA8());
- assert(dynamic_cast<A8*>(a12.getA7()) == a12.getA8());
-
- assert(dynamic_cast<A9*>(a12.getA1_3()) == a12.getA9());
- assert(dynamic_cast<A9*>(a12.getA1_4()) == a12.getA9());
- assert(dynamic_cast<A9*>(a12.getA1_6()) == a12.getA9());
- assert(dynamic_cast<A9*>(a12.getA1_9()) == a12.getA9());
- assert(dynamic_cast<A9*>(a12.getA2()) == a12.getA9());
- assert(dynamic_cast<A9*>(a12.getA3()) == a12.getA9());
- assert(dynamic_cast<A9*>(a12.getA4()) == a12.getA9());
- assert(dynamic_cast<A9*>(a12.getA5()) == a12.getA9());
- assert(dynamic_cast<A9*>(a12.getA6()) == a12.getA9());
- assert(dynamic_cast<A9*>(a12.getA7()) == a12.getA9());
- assert(dynamic_cast<A9*>(a12.getA8()) == a12.getA9());
-
- assert(dynamic_cast<A10*>(a12.getA1_3()) == a12.getA10());
- assert(dynamic_cast<A10*>(a12.getA1_4()) == a12.getA10());
- assert(dynamic_cast<A10*>(a12.getA1_6()) == a12.getA10());
- assert(dynamic_cast<A10*>(a12.getA1_9()) == a12.getA10());
- assert(dynamic_cast<A10*>(a12.getA2()) == a12.getA10());
- assert(dynamic_cast<A10*>(a12.getA3()) == a12.getA10());
- assert(dynamic_cast<A10*>(a12.getA4()) == a12.getA10());
- assert(dynamic_cast<A10*>(a12.getA5()) == a12.getA10());
- assert(dynamic_cast<A10*>(a12.getA6()) == a12.getA10());
- assert(dynamic_cast<A10*>(a12.getA7()) == a12.getA10());
- assert(dynamic_cast<A10*>(a12.getA8()) == a12.getA10());
- assert(dynamic_cast<A10*>(a12.getA9()) == a12.getA10());
-
- assert(dynamic_cast<A11*>(a12.getA1_3()) == a12.getA11());
- assert(dynamic_cast<A11*>(a12.getA1_4()) == a12.getA11());
- assert(dynamic_cast<A11*>(a12.getA1_6()) == a12.getA11());
- assert(dynamic_cast<A11*>(a12.getA1_9()) == a12.getA11());
- assert(dynamic_cast<A11*>(a12.getA2()) == a12.getA11());
- assert(dynamic_cast<A11*>(a12.getA3()) == a12.getA11());
- assert(dynamic_cast<A11*>(a12.getA4()) == a12.getA11());
- assert(dynamic_cast<A11*>(a12.getA5()) == a12.getA11());
- assert(dynamic_cast<A11*>(a12.getA6()) == a12.getA11());
- assert(dynamic_cast<A11*>(a12.getA7()) == a12.getA11());
- assert(dynamic_cast<A11*>(a12.getA8()) == a12.getA11());
- assert(dynamic_cast<A11*>(a12.getA9()) == a12.getA11());
- assert(dynamic_cast<A11*>(a12.getA10()) == a12.getA11());
-
- assert(dynamic_cast<A12*>(a12.getA1_3()) == a12.getA12());
- assert(dynamic_cast<A12*>(a12.getA1_4()) == a12.getA12());
- assert(dynamic_cast<A12*>(a12.getA1_6()) == a12.getA12());
- assert(dynamic_cast<A12*>(a12.getA1_9()) == a12.getA12());
- assert(dynamic_cast<A12*>(a12.getA2()) == a12.getA12());
- assert(dynamic_cast<A12*>(a12.getA3()) == a12.getA12());
- assert(dynamic_cast<A12*>(a12.getA4()) == a12.getA12());
- assert(dynamic_cast<A12*>(a12.getA5()) == a12.getA12());
- assert(dynamic_cast<A12*>(a12.getA6()) == a12.getA12());
- assert(dynamic_cast<A12*>(a12.getA7()) == a12.getA12());
- assert(dynamic_cast<A12*>(a12.getA8()) == a12.getA12());
- assert(dynamic_cast<A12*>(a12.getA9()) == a12.getA12());
- assert(dynamic_cast<A12*>(a12.getA10()) == a12.getA12());
- assert(dynamic_cast<A12*>(a12.getA11()) == a12.getA12());
-
- assert(dynamic_cast<A3*>(a13.getA1_3()) == a13.getA3());
- assert(dynamic_cast<A3*>(a13.getA1_4()) == a13.getA3());
- assert(dynamic_cast<A3*>(a13.getA1_6()) == a13.getA3());
- assert(dynamic_cast<A3*>(a13.getA1_9()) == a13.getA3());
- assert(dynamic_cast<A3*>(a13.getA2()) == a13.getA3());
-
- assert(dynamic_cast<A4*>(a13.getA1_3()) == a13.getA4());
- assert(dynamic_cast<A4*>(a13.getA1_4()) == a13.getA4());
- assert(dynamic_cast<A4*>(a13.getA1_6()) == a13.getA4());
- assert(dynamic_cast<A4*>(a13.getA1_9()) == a13.getA4());
- assert(dynamic_cast<A4*>(a13.getA2()) == a13.getA4());
- assert(dynamic_cast<A4*>(a13.getA3()) == a13.getA4());
-
- assert(dynamic_cast<A5*>(a13.getA1_3()) == a13.getA5());
- assert(dynamic_cast<A5*>(a13.getA1_4()) == a13.getA5());
- assert(dynamic_cast<A5*>(a13.getA1_6()) == a13.getA5());
- assert(dynamic_cast<A5*>(a13.getA1_9()) == a13.getA5());
- assert(dynamic_cast<A5*>(a13.getA2()) == a13.getA5());
- assert(dynamic_cast<A5*>(a13.getA3()) == a13.getA5());
- assert(dynamic_cast<A5*>(a13.getA4()) == a13.getA5());
-
- assert(dynamic_cast<A6*>(a13.getA1_3()) == a13.getA6());
- assert(dynamic_cast<A6*>(a13.getA1_4()) == a13.getA6());
- assert(dynamic_cast<A6*>(a13.getA1_6()) == a13.getA6());
- assert(dynamic_cast<A6*>(a13.getA1_9()) == a13.getA6());
- assert(dynamic_cast<A6*>(a13.getA2()) == a13.getA6());
- assert(dynamic_cast<A6*>(a13.getA3()) == a13.getA6());
- assert(dynamic_cast<A6*>(a13.getA4()) == a13.getA6());
- assert(dynamic_cast<A6*>(a13.getA5()) == a13.getA6());
-
- assert(dynamic_cast<A7*>(a13.getA1_3()) == a13.getA7());
- assert(dynamic_cast<A7*>(a13.getA1_4()) == a13.getA7());
- assert(dynamic_cast<A7*>(a13.getA1_6()) == a13.getA7());
- assert(dynamic_cast<A7*>(a13.getA1_9()) == a13.getA7());
- assert(dynamic_cast<A7*>(a13.getA2()) == a13.getA7());
- assert(dynamic_cast<A7*>(a13.getA3()) == a13.getA7());
- assert(dynamic_cast<A7*>(a13.getA4()) == a13.getA7());
- assert(dynamic_cast<A7*>(a13.getA5()) == a13.getA7());
- assert(dynamic_cast<A7*>(a13.getA6()) == a13.getA7());
-
- assert(dynamic_cast<A8*>(a13.getA1_3()) == a13.getA8());
- assert(dynamic_cast<A8*>(a13.getA1_4()) == a13.getA8());
- assert(dynamic_cast<A8*>(a13.getA1_6()) == a13.getA8());
- assert(dynamic_cast<A8*>(a13.getA1_9()) == a13.getA8());
- assert(dynamic_cast<A8*>(a13.getA2()) == a13.getA8());
- assert(dynamic_cast<A8*>(a13.getA3()) == a13.getA8());
- assert(dynamic_cast<A8*>(a13.getA4()) == a13.getA8());
- assert(dynamic_cast<A8*>(a13.getA5()) == a13.getA8());
- assert(dynamic_cast<A8*>(a13.getA6()) == a13.getA8());
- assert(dynamic_cast<A8*>(a13.getA7()) == a13.getA8());
-
- assert(dynamic_cast<A9*>(a13.getA1_3()) == a13.getA9());
- assert(dynamic_cast<A9*>(a13.getA1_4()) == a13.getA9());
- assert(dynamic_cast<A9*>(a13.getA1_6()) == a13.getA9());
- assert(dynamic_cast<A9*>(a13.getA1_9()) == a13.getA9());
- assert(dynamic_cast<A9*>(a13.getA2()) == a13.getA9());
- assert(dynamic_cast<A9*>(a13.getA3()) == a13.getA9());
- assert(dynamic_cast<A9*>(a13.getA4()) == a13.getA9());
- assert(dynamic_cast<A9*>(a13.getA5()) == a13.getA9());
- assert(dynamic_cast<A9*>(a13.getA6()) == a13.getA9());
- assert(dynamic_cast<A9*>(a13.getA7()) == a13.getA9());
- assert(dynamic_cast<A9*>(a13.getA8()) == a13.getA9());
-
- assert(dynamic_cast<A10*>(a13.getA1_3()) == a13.getA10());
- assert(dynamic_cast<A10*>(a13.getA1_4()) == a13.getA10());
- assert(dynamic_cast<A10*>(a13.getA1_6()) == a13.getA10());
- assert(dynamic_cast<A10*>(a13.getA1_9()) == a13.getA10());
- assert(dynamic_cast<A10*>(a13.getA2()) == a13.getA10());
- assert(dynamic_cast<A10*>(a13.getA3()) == a13.getA10());
- assert(dynamic_cast<A10*>(a13.getA4()) == a13.getA10());
- assert(dynamic_cast<A10*>(a13.getA5()) == a13.getA10());
- assert(dynamic_cast<A10*>(a13.getA6()) == a13.getA10());
- assert(dynamic_cast<A10*>(a13.getA7()) == a13.getA10());
- assert(dynamic_cast<A10*>(a13.getA8()) == a13.getA10());
- assert(dynamic_cast<A10*>(a13.getA9()) == a13.getA10());
-
- assert(dynamic_cast<A11*>(a13.getA1_3()) == a13.getA11());
- assert(dynamic_cast<A11*>(a13.getA1_4()) == a13.getA11());
- assert(dynamic_cast<A11*>(a13.getA1_6()) == a13.getA11());
- assert(dynamic_cast<A11*>(a13.getA1_9()) == a13.getA11());
- assert(dynamic_cast<A11*>(a13.getA2()) == a13.getA11());
- assert(dynamic_cast<A11*>(a13.getA3()) == a13.getA11());
- assert(dynamic_cast<A11*>(a13.getA4()) == a13.getA11());
- assert(dynamic_cast<A11*>(a13.getA5()) == a13.getA11());
- assert(dynamic_cast<A11*>(a13.getA6()) == a13.getA11());
- assert(dynamic_cast<A11*>(a13.getA7()) == a13.getA11());
- assert(dynamic_cast<A11*>(a13.getA8()) == a13.getA11());
- assert(dynamic_cast<A11*>(a13.getA9()) == a13.getA11());
- assert(dynamic_cast<A11*>(a13.getA10()) == a13.getA11());
-
- assert(dynamic_cast<A12*>(a13.getA1_3()) == a13.getA12());
- assert(dynamic_cast<A12*>(a13.getA1_4()) == a13.getA12());
- assert(dynamic_cast<A12*>(a13.getA1_6()) == a13.getA12());
- assert(dynamic_cast<A12*>(a13.getA1_9()) == a13.getA12());
- assert(dynamic_cast<A12*>(a13.getA2()) == a13.getA12());
- assert(dynamic_cast<A12*>(a13.getA3()) == a13.getA12());
- assert(dynamic_cast<A12*>(a13.getA4()) == a13.getA12());
- assert(dynamic_cast<A12*>(a13.getA5()) == a13.getA12());
- assert(dynamic_cast<A12*>(a13.getA6()) == a13.getA12());
- assert(dynamic_cast<A12*>(a13.getA7()) == a13.getA12());
- assert(dynamic_cast<A12*>(a13.getA8()) == a13.getA12());
- assert(dynamic_cast<A12*>(a13.getA9()) == a13.getA12());
- assert(dynamic_cast<A12*>(a13.getA10()) == a13.getA12());
- assert(dynamic_cast<A12*>(a13.getA11()) == a13.getA12());
-
- assert(dynamic_cast<A13*>(a13.getA1_3()) == a13.getA13());
- assert(dynamic_cast<A13*>(a13.getA1_4()) == a13.getA13());
- assert(dynamic_cast<A13*>(a13.getA1_6()) == a13.getA13());
- assert(dynamic_cast<A13*>(a13.getA1_9()) == a13.getA13());
- assert(dynamic_cast<A13*>(a13.getA2()) == a13.getA13());
- assert(dynamic_cast<A13*>(a13.getA3()) == a13.getA13());
- assert(dynamic_cast<A13*>(a13.getA4()) == a13.getA13());
- assert(dynamic_cast<A13*>(a13.getA5()) == a13.getA13());
- assert(dynamic_cast<A13*>(a13.getA6()) == a13.getA13());
- assert(dynamic_cast<A13*>(a13.getA7()) == a13.getA13());
- assert(dynamic_cast<A13*>(a13.getA8()) == a13.getA13());
- assert(dynamic_cast<A13*>(a13.getA9()) == a13.getA13());
- assert(dynamic_cast<A13*>(a13.getA10()) == a13.getA13());
- assert(dynamic_cast<A13*>(a13.getA11()) == a13.getA13());
- assert(dynamic_cast<A13*>(a13.getA12()) == a13.getA13());
-}
-
-} // t3
-
-int main()
-{
- timer t;
- t1::test();
- t2::test();
- t3::test();
-}
Removed: libcxxabi/trunk/test/dynamic_cast3.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/dynamic_cast3.cpp?rev=226690&view=auto
==============================================================================
--- libcxxabi/trunk/test/dynamic_cast3.cpp (original)
+++ libcxxabi/trunk/test/dynamic_cast3.cpp (removed)
@@ -1,2454 +0,0 @@
-//===------------------------- dynamic_cast3.cpp --------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include <cassert>
-#include "support/timer.hpp"
-
-/*
-
-A1 A2 A3
-
-*/
-
-namespace t1
-{
-
-struct A1
-{
- char _[43981];
- virtual ~A1() {}
-
- A1* getA1() {return this;}
-};
-
-struct A2
-{
- char _[34981];
- virtual ~A2() {}
-
- A2* getA2() {return this;}
-};
-
-struct A3
-{
- char _[93481];
- virtual ~A3() {}
-
- A3* getA3() {return this;}
-};
-
-void test()
-{
- A1 a1;
- A2 a2;
- A3 a3;
- assert(dynamic_cast<A1*>(a1.getA1()) == a1.getA1());
- assert(dynamic_cast<A1*>(a2.getA2()) == 0);
- assert(dynamic_cast<A1*>(a3.getA3()) == 0);
- assert(dynamic_cast<A2*>(a1.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA2()) == a2.getA2());
- assert(dynamic_cast<A2*>(a3.getA3()) == 0);
- assert(dynamic_cast<A3*>(a1.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA3()) == a3.getA3());
-}
-
-} // t1
-
-/*
-
-A1 A2
-|
-A3
-
-*/
-
-namespace t2
-{
-
-struct A1
-{
- char _[43981];
- virtual ~A1() {}
-
- A1* getA1() {return this;}
-};
-
-struct A2
-{
- char _[34981];
- virtual ~A2() {}
-
- A2* getA2() {return this;}
-};
-
-struct A3
- : public A1
-{
- char _[93481];
- virtual ~A3() {}
-
- A3* getA3() {return this;}
-};
-
-void test()
-{
- A1 a1;
- A2 a2;
- A3 a3;
- assert(dynamic_cast<A1*>(a1.getA1()) == a1.getA1());
- assert(dynamic_cast<A1*>(a2.getA2()) == 0);
- assert(dynamic_cast<A1*>(a3.getA1()) == a3.getA1());
- assert(dynamic_cast<A1*>(a3.getA3()) == a3.getA1());
-
- assert(dynamic_cast<A2*>(a1.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA2()) == a2.getA2());
- assert(dynamic_cast<A2*>(a3.getA1()) == 0);
- assert(dynamic_cast<A2*>(a3.getA3()) == 0);
-
- assert(dynamic_cast<A3*>(a1.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA1()) == a3.getA3());
- assert(dynamic_cast<A3*>(a3.getA3()) == a3.getA3());
-}
-
-} // t2
-
-namespace t3
-{
-
-struct A1
-{
- char _[43981];
- virtual ~A1() {}
-
- A1* getA1() {return this;}
-};
-
-struct A2
-{
- char _[34981];
- virtual ~A2() {}
-
- A2* getA2() {return this;}
-};
-
-struct A3
- : public virtual A1
-{
- char _[93481];
- virtual ~A3() {}
-
- A3* getA3() {return this;}
-};
-
-void test()
-{
- A1 a1;
- A2 a2;
- A3 a3;
- assert(dynamic_cast<A1*>(a1.getA1()) == a1.getA1());
- assert(dynamic_cast<A1*>(a2.getA2()) == 0);
- assert(dynamic_cast<A1*>(a3.getA1()) == a3.getA1());
- assert(dynamic_cast<A1*>(a3.getA3()) == a3.getA1());
-
- assert(dynamic_cast<A2*>(a1.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA2()) == a2.getA2());
- assert(dynamic_cast<A2*>(a3.getA1()) == 0);
- assert(dynamic_cast<A2*>(a3.getA3()) == 0);
-
- assert(dynamic_cast<A3*>(a1.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA1()) == a3.getA3());
- assert(dynamic_cast<A3*>(a3.getA3()) == a3.getA3());
-}
-
-} // t3
-
-namespace t4
-{
-
-struct A1
-{
- char _[43981];
- virtual ~A1() {}
-
- A1* getA1() {return this;}
-};
-
-struct A2
-{
- char _[34981];
- virtual ~A2() {}
-
- A2* getA2() {return this;}
-};
-
-struct A3
- : private A1
-{
- char _[93481];
- virtual ~A3() {}
-
- A1* getA1() {return this;}
- A3* getA3() {return this;}
-};
-
-void test()
-{
- A1 a1;
- A2 a2;
- A3 a3;
- assert(dynamic_cast<A1*>(a1.getA1()) == a1.getA1());
- assert(dynamic_cast<A1*>(a2.getA2()) == 0);
- assert(dynamic_cast<A1*>(a3.getA1()) == a3.getA1());
-
- assert(dynamic_cast<A2*>(a1.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA2()) == a2.getA2());
- assert(dynamic_cast<A2*>(a3.getA1()) == 0);
- assert(dynamic_cast<A2*>(a3.getA3()) == 0);
-
- assert(dynamic_cast<A3*>(a1.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA1()) == 0);
- assert(dynamic_cast<A3*>(a3.getA3()) == a3.getA3());
-}
-
-} // t4
-
-namespace t5
-{
-
-struct A1
-{
- char _[43981];
- virtual ~A1() {}
-
- A1* getA1() {return this;}
-};
-
-struct A2
-{
- char _[34981];
- virtual ~A2() {}
-
- A2* getA2() {return this;}
-};
-
-struct A3
- : private virtual A1
-{
- char _[93481];
- virtual ~A3() {}
-
- A1* getA1() {return this;}
- A3* getA3() {return this;}
-};
-
-void test()
-{
- A1 a1;
- A2 a2;
- A3 a3;
- assert(dynamic_cast<A1*>(a1.getA1()) == a1.getA1());
- assert(dynamic_cast<A1*>(a2.getA2()) == 0);
- assert(dynamic_cast<A1*>(a3.getA1()) == a3.getA1());
-
- assert(dynamic_cast<A2*>(a1.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA2()) == a2.getA2());
- assert(dynamic_cast<A2*>(a3.getA1()) == 0);
- assert(dynamic_cast<A2*>(a3.getA3()) == 0);
-
- assert(dynamic_cast<A3*>(a1.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA1()) == 0);
- assert(dynamic_cast<A3*>(a3.getA3()) == a3.getA3());
-}
-
-} // t5
-
-/*
-
-A1 A2
- \ /
- A3
-
-*/
-
-namespace t6
-{
-
-struct A1
-{
- char _[43981];
- virtual ~A1() {}
-
- A1* getA1() {return this;}
-};
-
-struct A2
-{
- char _[34981];
- virtual ~A2() {}
-
- A2* getA2() {return this;}
-};
-
-struct A3
- : public A1,
- public A2
-{
- char _[93481];
- virtual ~A3() {}
-
- A1* getA1() {return this;}
- A2* getA2() {return this;}
- A3* getA3() {return this;}
-};
-
-void test()
-{
- A1 a1;
- A2 a2;
- A3 a3;
- assert(dynamic_cast<A1*>(a1.getA1()) == a1.getA1());
- assert(dynamic_cast<A1*>(a2.getA2()) == 0);
- assert(dynamic_cast<A1*>(a3.getA1()) == a3.getA1());
- assert(dynamic_cast<A1*>(a3.getA2()) == a3.getA1());
- assert(dynamic_cast<A1*>(a3.getA3()) == a3.getA1());
-
- assert(dynamic_cast<A2*>(a1.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA2()) == a2.getA2());
- assert(dynamic_cast<A2*>(a3.getA1()) == a3.getA2());
- assert(dynamic_cast<A2*>(a3.getA2()) == a3.getA2());
- assert(dynamic_cast<A2*>(a3.getA3()) == a3.getA2());
-
- assert(dynamic_cast<A3*>(a1.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA1()) == a3.getA3());
- assert(dynamic_cast<A3*>(a3.getA2()) == a3.getA3());
- assert(dynamic_cast<A3*>(a3.getA3()) == a3.getA3());
-}
-
-} // t6
-
-namespace t7
-{
-
-struct A1
-{
- char _[43981];
- virtual ~A1() {}
-
- A1* getA1() {return this;}
-};
-
-struct A2
-{
- char _[34981];
- virtual ~A2() {}
-
- A2* getA2() {return this;}
-};
-
-struct A3
- : public virtual A1,
- public A2
-{
- char _[93481];
- virtual ~A3() {}
-
- A1* getA1() {return this;}
- A2* getA2() {return this;}
- A3* getA3() {return this;}
-};
-
-void test()
-{
- A1 a1;
- A2 a2;
- A3 a3;
- assert(dynamic_cast<A1*>(a1.getA1()) == a1.getA1());
- assert(dynamic_cast<A1*>(a2.getA2()) == 0);
- assert(dynamic_cast<A1*>(a3.getA1()) == a3.getA1());
- assert(dynamic_cast<A1*>(a3.getA2()) == a3.getA1());
- assert(dynamic_cast<A1*>(a3.getA3()) == a3.getA1());
-
- assert(dynamic_cast<A2*>(a1.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA2()) == a2.getA2());
- assert(dynamic_cast<A2*>(a3.getA1()) == a3.getA2());
- assert(dynamic_cast<A2*>(a3.getA2()) == a3.getA2());
- assert(dynamic_cast<A2*>(a3.getA3()) == a3.getA2());
-
- assert(dynamic_cast<A3*>(a1.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA1()) == a3.getA3());
- assert(dynamic_cast<A3*>(a3.getA2()) == a3.getA3());
- assert(dynamic_cast<A3*>(a3.getA3()) == a3.getA3());
-}
-
-} // t7
-
-namespace t8
-{
-
-struct A1
-{
- char _[43981];
- virtual ~A1() {}
-
- A1* getA1() {return this;}
-};
-
-struct A2
-{
- char _[34981];
- virtual ~A2() {}
-
- A2* getA2() {return this;}
-};
-
-struct A3
- : private A1,
- public A2
-{
- char _[93481];
- virtual ~A3() {}
-
- A1* getA1() {return this;}
- A2* getA2() {return this;}
- A3* getA3() {return this;}
-};
-
-void test()
-{
- A1 a1;
- A2 a2;
- A3 a3;
- assert(dynamic_cast<A1*>(a1.getA1()) == a1.getA1());
- assert(dynamic_cast<A1*>(a2.getA2()) == 0);
- assert(dynamic_cast<A1*>(a3.getA1()) == a3.getA1());
- assert(dynamic_cast<A1*>(a3.getA2()) == 0);
-
- assert(dynamic_cast<A2*>(a1.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA2()) == a2.getA2());
- assert(dynamic_cast<A2*>(a3.getA1()) == 0);
- assert(dynamic_cast<A2*>(a3.getA2()) == a3.getA2());
- assert(dynamic_cast<A2*>(a3.getA3()) == a3.getA2());
-
- assert(dynamic_cast<A3*>(a1.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA1()) == 0);
- assert(dynamic_cast<A3*>(a3.getA2()) == a3.getA3());
- assert(dynamic_cast<A3*>(a3.getA3()) == a3.getA3());
-}
-
-} // t8
-
-namespace t9
-{
-
-struct A1
-{
- char _[43981];
- virtual ~A1() {}
-
- A1* getA1() {return this;}
-};
-
-struct A2
-{
- char _[34981];
- virtual ~A2() {}
-
- A2* getA2() {return this;}
-};
-
-struct A3
- : private virtual A1,
- public A2
-{
- char _[93481];
- virtual ~A3() {}
-
- A1* getA1() {return this;}
- A2* getA2() {return this;}
- A3* getA3() {return this;}
-};
-
-void test()
-{
- A1 a1;
- A2 a2;
- A3 a3;
- assert(dynamic_cast<A1*>(a1.getA1()) == a1.getA1());
- assert(dynamic_cast<A1*>(a2.getA2()) == 0);
- assert(dynamic_cast<A1*>(a3.getA1()) == a3.getA1());
- assert(dynamic_cast<A1*>(a3.getA2()) == 0);
-
- assert(dynamic_cast<A2*>(a1.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA2()) == a2.getA2());
- assert(dynamic_cast<A2*>(a3.getA1()) == 0);
- assert(dynamic_cast<A2*>(a3.getA2()) == a3.getA2());
- assert(dynamic_cast<A2*>(a3.getA3()) == a3.getA2());
-
- assert(dynamic_cast<A3*>(a1.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA1()) == 0);
- assert(dynamic_cast<A3*>(a3.getA2()) == a3.getA3());
- assert(dynamic_cast<A3*>(a3.getA3()) == a3.getA3());
-}
-
-} // t9
-
-namespace t10
-{
-
-struct A1
-{
- char _[43981];
- virtual ~A1() {}
-
- A1* getA1() {return this;}
-};
-
-struct A2
-{
- char _[34981];
- virtual ~A2() {}
-
- A2* getA2() {return this;}
-};
-
-struct A3
- : public virtual A1,
- public virtual A2
-{
- char _[93481];
- virtual ~A3() {}
-
- A1* getA1() {return this;}
- A2* getA2() {return this;}
- A3* getA3() {return this;}
-};
-
-void test()
-{
- A1 a1;
- A2 a2;
- A3 a3;
- assert(dynamic_cast<A1*>(a1.getA1()) == a1.getA1());
- assert(dynamic_cast<A1*>(a2.getA2()) == 0);
- assert(dynamic_cast<A1*>(a3.getA1()) == a3.getA1());
- assert(dynamic_cast<A1*>(a3.getA2()) == a3.getA1());
- assert(dynamic_cast<A1*>(a3.getA3()) == a3.getA1());
-
- assert(dynamic_cast<A2*>(a1.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA2()) == a2.getA2());
- assert(dynamic_cast<A2*>(a3.getA1()) == a3.getA2());
- assert(dynamic_cast<A2*>(a3.getA2()) == a3.getA2());
- assert(dynamic_cast<A2*>(a3.getA3()) == a3.getA2());
-
- assert(dynamic_cast<A3*>(a1.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA1()) == a3.getA3());
- assert(dynamic_cast<A3*>(a3.getA2()) == a3.getA3());
- assert(dynamic_cast<A3*>(a3.getA3()) == a3.getA3());
-}
-
-} // t10
-
-namespace t11
-{
-
-struct A1
-{
- char _[43981];
- virtual ~A1() {}
-
- A1* getA1() {return this;}
-};
-
-struct A2
-{
- char _[34981];
- virtual ~A2() {}
-
- A2* getA2() {return this;}
-};
-
-struct A3
- : private A1,
- public virtual A2
-{
- char _[93481];
- virtual ~A3() {}
-
- A1* getA1() {return this;}
- A2* getA2() {return this;}
- A3* getA3() {return this;}
-};
-
-void test()
-{
- A1 a1;
- A2 a2;
- A3 a3;
- assert(dynamic_cast<A1*>(a1.getA1()) == a1.getA1());
- assert(dynamic_cast<A1*>(a2.getA2()) == 0);
- assert(dynamic_cast<A1*>(a3.getA1()) == a3.getA1());
- assert(dynamic_cast<A1*>(a3.getA2()) == 0);
-
- assert(dynamic_cast<A2*>(a1.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA2()) == a2.getA2());
- assert(dynamic_cast<A2*>(a3.getA1()) == 0);
- assert(dynamic_cast<A2*>(a3.getA2()) == a3.getA2());
- assert(dynamic_cast<A2*>(a3.getA3()) == a3.getA2());
-
- assert(dynamic_cast<A3*>(a1.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA1()) == 0);
- assert(dynamic_cast<A3*>(a3.getA2()) == a3.getA3());
- assert(dynamic_cast<A3*>(a3.getA3()) == a3.getA3());
-}
-
-} // t11
-
-namespace t12
-{
-
-struct A1
-{
- char _[43981];
- virtual ~A1() {}
-
- A1* getA1() {return this;}
-};
-
-struct A2
-{
- char _[34981];
- virtual ~A2() {}
-
- A2* getA2() {return this;}
-};
-
-struct A3
- : private virtual A1,
- public virtual A2
-{
- char _[93481];
- virtual ~A3() {}
-
- A1* getA1() {return this;}
- A2* getA2() {return this;}
- A3* getA3() {return this;}
-};
-
-void test()
-{
- A1 a1;
- A2 a2;
- A3 a3;
- assert(dynamic_cast<A1*>(a1.getA1()) == a1.getA1());
- assert(dynamic_cast<A1*>(a2.getA2()) == 0);
- assert(dynamic_cast<A1*>(a3.getA1()) == a3.getA1());
- assert(dynamic_cast<A1*>(a3.getA2()) == 0);
-
- assert(dynamic_cast<A2*>(a1.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA2()) == a2.getA2());
- assert(dynamic_cast<A2*>(a3.getA1()) == 0);
- assert(dynamic_cast<A2*>(a3.getA2()) == a3.getA2());
- assert(dynamic_cast<A2*>(a3.getA3()) == a3.getA2());
-
- assert(dynamic_cast<A3*>(a1.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA1()) == 0);
- assert(dynamic_cast<A3*>(a3.getA2()) == a3.getA3());
- assert(dynamic_cast<A3*>(a3.getA3()) == a3.getA3());
-}
-
-} // t12
-
-namespace t13
-{
-
-struct A1
-{
- char _[43981];
- virtual ~A1() {}
-
- A1* getA1() {return this;}
-};
-
-struct A2
-{
- char _[34981];
- virtual ~A2() {}
-
- A2* getA2() {return this;}
-};
-
-struct A3
- : private A1,
- private A2
-{
- char _[93481];
- virtual ~A3() {}
-
- A1* getA1() {return this;}
- A2* getA2() {return this;}
- A3* getA3() {return this;}
-};
-
-void test()
-{
- A1 a1;
- A2 a2;
- A3 a3;
- assert(dynamic_cast<A1*>(a1.getA1()) == a1.getA1());
- assert(dynamic_cast<A1*>(a2.getA2()) == 0);
- assert(dynamic_cast<A1*>(a3.getA1()) == a3.getA1());
- assert(dynamic_cast<A1*>(a3.getA2()) == 0);
-
- assert(dynamic_cast<A2*>(a1.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA2()) == a2.getA2());
- assert(dynamic_cast<A2*>(a3.getA1()) == 0);
- assert(dynamic_cast<A2*>(a3.getA2()) == a3.getA2());
-
- assert(dynamic_cast<A3*>(a1.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA1()) == 0);
- assert(dynamic_cast<A3*>(a3.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA3()) == a3.getA3());
-}
-
-} // t13
-
-namespace t14
-{
-
-struct A1
-{
- char _[43981];
- virtual ~A1() {}
-
- A1* getA1() {return this;}
-};
-
-struct A2
-{
- char _[34981];
- virtual ~A2() {}
-
- A2* getA2() {return this;}
-};
-
-struct A3
- : private virtual A1,
- private A2
-{
- char _[93481];
- virtual ~A3() {}
-
- A1* getA1() {return this;}
- A2* getA2() {return this;}
- A3* getA3() {return this;}
-};
-
-void test()
-{
- A1 a1;
- A2 a2;
- A3 a3;
- assert(dynamic_cast<A1*>(a1.getA1()) == a1.getA1());
- assert(dynamic_cast<A1*>(a2.getA2()) == 0);
- assert(dynamic_cast<A1*>(a3.getA1()) == a3.getA1());
- assert(dynamic_cast<A1*>(a3.getA2()) == 0);
-
- assert(dynamic_cast<A2*>(a1.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA2()) == a2.getA2());
- assert(dynamic_cast<A2*>(a3.getA1()) == 0);
- assert(dynamic_cast<A2*>(a3.getA2()) == a3.getA2());
-
- assert(dynamic_cast<A3*>(a1.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA1()) == 0);
- assert(dynamic_cast<A3*>(a3.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA3()) == a3.getA3());
-}
-
-} // t14
-
-namespace t15
-{
-
-struct A1
-{
- char _[43981];
- virtual ~A1() {}
-
- A1* getA1() {return this;}
-};
-
-struct A2
-{
- char _[34981];
- virtual ~A2() {}
-
- A2* getA2() {return this;}
-};
-
-struct A3
- : private virtual A1,
- private virtual A2
-{
- char _[93481];
- virtual ~A3() {}
-
- A1* getA1() {return this;}
- A2* getA2() {return this;}
- A3* getA3() {return this;}
-};
-
-void test()
-{
- A1 a1;
- A2 a2;
- A3 a3;
- assert(dynamic_cast<A1*>(a1.getA1()) == a1.getA1());
- assert(dynamic_cast<A1*>(a2.getA2()) == 0);
- assert(dynamic_cast<A1*>(a3.getA1()) == a3.getA1());
- assert(dynamic_cast<A1*>(a3.getA2()) == 0);
-
- assert(dynamic_cast<A2*>(a1.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA2()) == a2.getA2());
- assert(dynamic_cast<A2*>(a3.getA1()) == 0);
- assert(dynamic_cast<A2*>(a3.getA2()) == a3.getA2());
-
- assert(dynamic_cast<A3*>(a1.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA1()) == 0);
- assert(dynamic_cast<A3*>(a3.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA3()) == a3.getA3());
-}
-
-} // t15
-
-/*
-
-A1
-|
-A2
-|
-A3
-
-*/
-
-namespace t16
-{
-
-struct A1
-{
- char _[43981];
- virtual ~A1() {}
-
- A1* getA1() {return this;}
-};
-
-struct A2
- : public A1
-{
- char _[34981];
- virtual ~A2() {}
-
- A1* getA1() {return this;}
- A2* getA2() {return this;}
-};
-
-struct A3
- : public A2
-{
- char _[93481];
- virtual ~A3() {}
-
- A1* getA1() {return this;}
- A2* getA2() {return this;}
- A3* getA3() {return this;}
-};
-
-void test()
-{
- A1 a1;
- A2 a2;
- A3 a3;
- assert(dynamic_cast<A1*>(a1.getA1()) == a1.getA1());
- assert(dynamic_cast<A1*>(a2.getA1()) == a2.getA1());
- assert(dynamic_cast<A1*>(a2.getA2()) == a2.getA1());
- assert(dynamic_cast<A1*>(a3.getA1()) == a3.getA1());
- assert(dynamic_cast<A1*>(a3.getA2()) == a3.getA1());
- assert(dynamic_cast<A1*>(a3.getA3()) == a3.getA1());
-
- assert(dynamic_cast<A2*>(a1.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA1()) == a2.getA2());
- assert(dynamic_cast<A2*>(a2.getA2()) == a2.getA2());
- assert(dynamic_cast<A2*>(a3.getA1()) == a3.getA2());
- assert(dynamic_cast<A2*>(a3.getA2()) == a3.getA2());
- assert(dynamic_cast<A2*>(a3.getA3()) == a3.getA2());
-
- assert(dynamic_cast<A3*>(a1.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA1()) == a3.getA3());
- assert(dynamic_cast<A3*>(a3.getA2()) == a3.getA3());
- assert(dynamic_cast<A3*>(a3.getA3()) == a3.getA3());
-}
-
-} // t16
-
-namespace t17
-{
-
-struct A1
-{
- char _[43981];
- virtual ~A1() {}
-
- A1* getA1() {return this;}
-};
-
-struct A2
- : public virtual A1
-{
- char _[34981];
- virtual ~A2() {}
-
- A1* getA1() {return this;}
- A2* getA2() {return this;}
-};
-
-struct A3
- : public A2
-{
- char _[93481];
- virtual ~A3() {}
-
- A1* getA1() {return this;}
- A2* getA2() {return this;}
- A3* getA3() {return this;}
-};
-
-void test()
-{
- A1 a1;
- A2 a2;
- A3 a3;
- assert(dynamic_cast<A1*>(a1.getA1()) == a1.getA1());
- assert(dynamic_cast<A1*>(a2.getA1()) == a2.getA1());
- assert(dynamic_cast<A1*>(a2.getA2()) == a2.getA1());
- assert(dynamic_cast<A1*>(a3.getA1()) == a3.getA1());
- assert(dynamic_cast<A1*>(a3.getA2()) == a3.getA1());
- assert(dynamic_cast<A1*>(a3.getA3()) == a3.getA1());
-
- assert(dynamic_cast<A2*>(a1.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA1()) == a2.getA2());
- assert(dynamic_cast<A2*>(a2.getA2()) == a2.getA2());
- assert(dynamic_cast<A2*>(a3.getA1()) == a3.getA2());
- assert(dynamic_cast<A2*>(a3.getA2()) == a3.getA2());
- assert(dynamic_cast<A2*>(a3.getA3()) == a3.getA2());
-
- assert(dynamic_cast<A3*>(a1.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA1()) == a3.getA3());
- assert(dynamic_cast<A3*>(a3.getA2()) == a3.getA3());
- assert(dynamic_cast<A3*>(a3.getA3()) == a3.getA3());
-}
-
-} // t17
-
-namespace t18
-{
-
-struct A1
-{
- char _[43981];
- virtual ~A1() {}
-
- A1* getA1() {return this;}
-};
-
-struct A2
- : private A1
-{
- char _[34981];
- virtual ~A2() {}
-
- A1* getA1() {return this;}
- A2* getA2() {return this;}
-};
-
-struct A3
- : public A2
-{
- char _[93481];
- virtual ~A3() {}
-
- A2* getA2() {return this;}
- A3* getA3() {return this;}
-};
-
-void test()
-{
- A1 a1;
- A2 a2;
- A3 a3;
- assert(dynamic_cast<A1*>(a1.getA1()) == a1.getA1());
- assert(dynamic_cast<A1*>(a2.getA1()) == a2.getA1());
- assert(dynamic_cast<A1*>(a3.getA1()) == a3.getA1());
-
- assert(dynamic_cast<A2*>(a1.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA2()) == a2.getA2());
- assert(dynamic_cast<A2*>(a3.getA1()) == 0);
- assert(dynamic_cast<A2*>(a3.getA2()) == a3.getA2());
- assert(dynamic_cast<A2*>(a3.getA3()) == a3.getA2());
-
- assert(dynamic_cast<A3*>(a1.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA1()) == 0);
- assert(dynamic_cast<A3*>(a3.getA2()) == a3.getA3());
- assert(dynamic_cast<A3*>(a3.getA3()) == a3.getA3());
-}
-
-} // t18
-
-namespace t19
-{
-
-struct A1
-{
- char _[43981];
- virtual ~A1() {}
-
- A1* getA1() {return this;}
-};
-
-struct A2
- : protected virtual A1
-{
- char _[34981];
- virtual ~A2() {}
-
- A1* getA1() {return this;}
- A2* getA2() {return this;}
-};
-
-struct A3
- : public A2
-{
- char _[93481];
- virtual ~A3() {}
-
- A2* getA2() {return this;}
- A3* getA3() {return this;}
-};
-
-void test()
-{
- A1 a1;
- A2 a2;
- A3 a3;
- assert(dynamic_cast<A1*>(a1.getA1()) == a1.getA1());
- assert(dynamic_cast<A1*>(a2.getA1()) == a2.getA1());
- assert(dynamic_cast<A1*>(a3.getA1()) == a3.getA1());
-
- assert(dynamic_cast<A2*>(a1.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA2()) == a2.getA2());
- assert(dynamic_cast<A2*>(a3.getA1()) == 0);
- assert(dynamic_cast<A2*>(a3.getA2()) == a3.getA2());
- assert(dynamic_cast<A2*>(a3.getA3()) == a3.getA2());
-
- assert(dynamic_cast<A3*>(a1.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA1()) == 0);
- assert(dynamic_cast<A3*>(a3.getA2()) == a3.getA3());
- assert(dynamic_cast<A3*>(a3.getA3()) == a3.getA3());
-}
-
-} // t19
-
-namespace t20
-{
-
-struct A1
-{
- char _[43981];
- virtual ~A1() {}
-
- A1* getA1() {return this;}
-};
-
-struct A2
- : public virtual A1
-{
- char _[34981];
- virtual ~A2() {}
-
- A1* getA1() {return this;}
- A2* getA2() {return this;}
-};
-
-struct A3
- : public virtual A2
-{
- char _[93481];
- virtual ~A3() {}
-
- A1* getA1() {return this;}
- A2* getA2() {return this;}
- A3* getA3() {return this;}
-};
-
-void test()
-{
- A1 a1;
- A2 a2;
- A3 a3;
- assert(dynamic_cast<A1*>(a1.getA1()) == a1.getA1());
- assert(dynamic_cast<A1*>(a2.getA1()) == a2.getA1());
- assert(dynamic_cast<A1*>(a2.getA2()) == a2.getA1());
- assert(dynamic_cast<A1*>(a3.getA1()) == a3.getA1());
- assert(dynamic_cast<A1*>(a3.getA2()) == a3.getA1());
- assert(dynamic_cast<A1*>(a3.getA3()) == a3.getA1());
-
- assert(dynamic_cast<A2*>(a1.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA1()) == a2.getA2());
- assert(dynamic_cast<A2*>(a2.getA2()) == a2.getA2());
- assert(dynamic_cast<A2*>(a3.getA1()) == a3.getA2());
- assert(dynamic_cast<A2*>(a3.getA2()) == a3.getA2());
- assert(dynamic_cast<A2*>(a3.getA3()) == a3.getA2());
-
- assert(dynamic_cast<A3*>(a1.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA1()) == a3.getA3());
- assert(dynamic_cast<A3*>(a3.getA2()) == a3.getA3());
- assert(dynamic_cast<A3*>(a3.getA3()) == a3.getA3());
-}
-
-} // t20
-
-namespace t21
-{
-
-struct A1
-{
- char _[43981];
- virtual ~A1() {}
-
- A1* getA1() {return this;}
-};
-
-struct A2
- : private A1
-{
- char _[34981];
- virtual ~A2() {}
-
- A1* getA1() {return this;}
- A2* getA2() {return this;}
-};
-
-struct A3
- : public virtual A2
-{
- char _[93481];
- virtual ~A3() {}
-
- A2* getA2() {return this;}
- A3* getA3() {return this;}
-};
-
-void test()
-{
- A1 a1;
- A2 a2;
- A3 a3;
- assert(dynamic_cast<A1*>(a1.getA1()) == a1.getA1());
- assert(dynamic_cast<A1*>(a2.getA1()) == a2.getA1());
- assert(dynamic_cast<A1*>(a3.getA1()) == a3.getA1());
-
- assert(dynamic_cast<A2*>(a1.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA2()) == a2.getA2());
- assert(dynamic_cast<A2*>(a3.getA1()) == 0);
- assert(dynamic_cast<A2*>(a3.getA2()) == a3.getA2());
- assert(dynamic_cast<A2*>(a3.getA3()) == a3.getA2());
-
- assert(dynamic_cast<A3*>(a1.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA1()) == 0);
- assert(dynamic_cast<A3*>(a3.getA2()) == a3.getA3());
- assert(dynamic_cast<A3*>(a3.getA3()) == a3.getA3());
-}
-
-} // t21
-
-namespace t22
-{
-
-struct A1
-{
- char _[43981];
- virtual ~A1() {}
-
- A1* getA1() {return this;}
-};
-
-struct A2
- : protected virtual A1
-{
- char _[34981];
- virtual ~A2() {}
-
- A1* getA1() {return this;}
- A2* getA2() {return this;}
-};
-
-struct A3
- : public virtual A2
-{
- char _[93481];
- virtual ~A3() {}
-
- A2* getA2() {return this;}
- A3* getA3() {return this;}
-};
-
-void test()
-{
- A1 a1;
- A2 a2;
- A3 a3;
- assert(dynamic_cast<A1*>(a1.getA1()) == a1.getA1());
- assert(dynamic_cast<A1*>(a2.getA1()) == a2.getA1());
- assert(dynamic_cast<A1*>(a3.getA1()) == a3.getA1());
-
- assert(dynamic_cast<A2*>(a1.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA2()) == a2.getA2());
- assert(dynamic_cast<A2*>(a3.getA1()) == 0);
- assert(dynamic_cast<A2*>(a3.getA2()) == a3.getA2());
- assert(dynamic_cast<A2*>(a3.getA3()) == a3.getA2());
-
- assert(dynamic_cast<A3*>(a1.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA1()) == 0);
- assert(dynamic_cast<A3*>(a3.getA2()) == a3.getA3());
- assert(dynamic_cast<A3*>(a3.getA3()) == a3.getA3());
-}
-
-} // t22
-
-namespace t23
-{
-
-struct A1
-{
- char _[43981];
- virtual ~A1() {}
-
- A1* getA1() {return this;}
-};
-
-struct A2
- : private A1
-{
- char _[34981];
- virtual ~A2() {}
-
- A1* getA1() {return this;}
- A2* getA2() {return this;}
-};
-
-struct A3
- : private A2
-{
- char _[93481];
- virtual ~A3() {}
-
- t23::A1* getA1() {return A2::getA1();}
- A2* getA2() {return this;}
- A3* getA3() {return this;}
-};
-
-void test()
-{
- A1 a1;
- A2 a2;
- A3 a3;
- assert(dynamic_cast<A1*>(a1.getA1()) == a1.getA1());
- assert(dynamic_cast<A1*>(a2.getA1()) == a2.getA1());
- assert(dynamic_cast<A1*>(a3.getA1()) == a3.getA1());
-
- assert(dynamic_cast<A2*>(a1.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA2()) == a2.getA2());
- assert(dynamic_cast<A2*>(a3.getA1()) == 0);
- assert(dynamic_cast<A2*>(a3.getA2()) == a3.getA2());
-
- assert(dynamic_cast<A3*>(a1.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA1()) == 0);
- assert(dynamic_cast<A3*>(a3.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA3()) == a3.getA3());
-}
-
-} // t23
-
-namespace t24
-{
-
-struct A1
-{
- char _[43981];
- virtual ~A1() {}
-
- A1* getA1() {return this;}
-};
-
-struct A2
- : protected virtual A1
-{
- char _[34981];
- virtual ~A2() {}
-
- A1* getA1() {return this;}
- A2* getA2() {return this;}
-};
-
-struct A3
- : private A2
-{
- char _[93481];
- virtual ~A3() {}
-
- t24::A1* getA1() {return A2::getA1();}
- A2* getA2() {return this;}
- A3* getA3() {return this;}
-};
-
-void test()
-{
- A1 a1;
- A2 a2;
- A3 a3;
- assert(dynamic_cast<A1*>(a1.getA1()) == a1.getA1());
- assert(dynamic_cast<A1*>(a2.getA1()) == a2.getA1());
- assert(dynamic_cast<A1*>(a3.getA1()) == a3.getA1());
-
- assert(dynamic_cast<A2*>(a1.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA2()) == a2.getA2());
- assert(dynamic_cast<A2*>(a3.getA1()) == 0);
- assert(dynamic_cast<A2*>(a3.getA2()) == a3.getA2());
-
- assert(dynamic_cast<A3*>(a1.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA1()) == 0);
- assert(dynamic_cast<A3*>(a3.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA3()) == a3.getA3());
-}
-
-} // t24
-
-namespace t25
-{
-
-struct A1
-{
- char _[43981];
- virtual ~A1() {}
-
- A1* getA1() {return this;}
-};
-
-struct A2
- : protected virtual A1
-{
- char _[34981];
- virtual ~A2() {}
-
- A1* getA1() {return this;}
- A2* getA2() {return this;}
-};
-
-struct A3
- : private virtual A2
-{
- char _[93481];
- virtual ~A3() {}
-
- t25::A1* getA1() {return A2::getA1();}
- A2* getA2() {return this;}
- A3* getA3() {return this;}
-};
-
-void test()
-{
- A1 a1;
- A2 a2;
- A3 a3;
- assert(dynamic_cast<A1*>(a1.getA1()) == a1.getA1());
- assert(dynamic_cast<A1*>(a2.getA1()) == a2.getA1());
- assert(dynamic_cast<A1*>(a3.getA1()) == a3.getA1());
-
- assert(dynamic_cast<A2*>(a1.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA2()) == a2.getA2());
- assert(dynamic_cast<A2*>(a3.getA1()) == 0);
- assert(dynamic_cast<A2*>(a3.getA2()) == a3.getA2());
-
- assert(dynamic_cast<A3*>(a1.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA1()) == 0);
- assert(dynamic_cast<A3*>(a3.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA3()) == a3.getA3());
-}
-
-} // t25
-
-/*
-
-A1 A1
-| |
-A2 |
- \ |
- A3
-
-*/
-
-namespace t26
-{
-
-struct A1
-{
- char _[43981];
- virtual ~A1() {}
-
- A1* getA1() {return this;}
-};
-
-struct A2
- : public A1
-{
- char _[34981];
- virtual ~A2() {}
-
- A1* getA1() {return this;}
- A2* getA2() {return this;}
-};
-
-struct A3
- : public A1,
- public A2
-{
- char _[93481];
- virtual ~A3() {}
-
- A1* getA12() {return A2::getA1();}
- A2* getA2() {return this;}
- A3* getA3() {return this;}
-};
-
-void test()
-{
- A1 a1;
- A2 a2;
- A3 a3;
- assert(dynamic_cast<A1*>(a1.getA1()) == a1.getA1());
- assert(dynamic_cast<A1*>(a2.getA1()) == a2.getA1());
- assert(dynamic_cast<A1*>(a2.getA2()) == a2.getA1());
- assert(dynamic_cast<A1*>(a3.getA12()) == a3.getA12());
- assert(dynamic_cast<A1*>(a3.getA2()) == a3.getA12());
-
- assert(dynamic_cast<A2*>(a1.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA1()) == a2.getA2());
- assert(dynamic_cast<A2*>(a2.getA2()) == a2.getA2());
- assert(dynamic_cast<A2*>(a3.getA12()) == a3.getA2());
- assert(dynamic_cast<A2*>(a3.getA2()) == a3.getA2());
- assert(dynamic_cast<A2*>(a3.getA3()) == a3.getA2());
-
- assert(dynamic_cast<A3*>(a1.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA12()) == a3.getA3());
- assert(dynamic_cast<A3*>(a3.getA2()) == a3.getA3());
- assert(dynamic_cast<A3*>(a3.getA3()) == a3.getA3());
-}
-
-} // t26
-
-namespace t27
-{
-
-struct A1
-{
- char _[43981];
- virtual ~A1() {}
-
- A1* getA1() {return this;}
-};
-
-struct A2
- : private A1
-{
- char _[34981];
- virtual ~A2() {}
-
- A1* getA1() {return this;}
- A2* getA2() {return this;}
-};
-
-struct A3
- : public A1,
- public A2
-{
- char _[93481];
- virtual ~A3() {}
-
- A1* getA12() {return A2::getA1();}
- A2* getA2() {return this;}
- A3* getA3() {return this;}
-};
-
-void test()
-{
- A1 a1;
- A2 a2;
- A3 a3;
- assert(dynamic_cast<A1*>(a1.getA1()) == a1.getA1());
- assert(dynamic_cast<A1*>(a2.getA1()) == a2.getA1());
- assert(dynamic_cast<A1*>(a3.getA12()) == a3.getA12());
-
- assert(dynamic_cast<A2*>(a1.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA2()) == a2.getA2());
- assert(dynamic_cast<A2*>(a3.getA12()) == 0);
- assert(dynamic_cast<A2*>(a3.getA2()) == a3.getA2());
- assert(dynamic_cast<A2*>(a3.getA3()) == a3.getA2());
-
- assert(dynamic_cast<A3*>(a1.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA12()) == 0);
- assert(dynamic_cast<A3*>(a3.getA2()) == a3.getA3());
- assert(dynamic_cast<A3*>(a3.getA3()) == a3.getA3());
-}
-
-} // t27
-
-namespace t28
-{
-
-struct A1
-{
- char _[43981];
- virtual ~A1() {}
-
- A1* getA1() {return this;}
-};
-
-struct A2
- : public A1
-{
- char _[34981];
- virtual ~A2() {}
-
- A1* getA1() {return this;}
- A2* getA2() {return this;}
-};
-
-struct A3
- : private A1,
- public A2
-{
- char _[93481];
- virtual ~A3() {}
-
- A1* getA12() {return A2::getA1();}
- A2* getA2() {return this;}
- A3* getA3() {return this;}
-};
-
-void test()
-{
- A1 a1;
- A2 a2;
- A3 a3;
- assert(dynamic_cast<A1*>(a1.getA1()) == a1.getA1());
- assert(dynamic_cast<A1*>(a2.getA1()) == a2.getA1());
- assert(dynamic_cast<A1*>(a2.getA2()) == a2.getA1());
- assert(dynamic_cast<A1*>(a3.getA2()) == a3.getA12());
-
- assert(dynamic_cast<A2*>(a1.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA1()) == a2.getA2());
- assert(dynamic_cast<A2*>(a2.getA2()) == a2.getA2());
- assert(dynamic_cast<A2*>(a3.getA12()) == a3.getA2());
- assert(dynamic_cast<A2*>(a3.getA2()) == a3.getA2());
- assert(dynamic_cast<A2*>(a3.getA3()) == a3.getA2());
-
- assert(dynamic_cast<A3*>(a1.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA12()) == a3.getA3());
- assert(dynamic_cast<A3*>(a3.getA2()) == a3.getA3());
- assert(dynamic_cast<A3*>(a3.getA3()) == a3.getA3());
-}
-
-} // t28
-
-namespace t29
-{
-
-struct A1
-{
- char _[43981];
- virtual ~A1() {}
-
- A1* getA1() {return this;}
-};
-
-struct A2
- : public A1
-{
- char _[34981];
- virtual ~A2() {}
-
- A1* getA1() {return this;}
- A2* getA2() {return this;}
-};
-
-struct A3
- : public A1,
- private A2
-{
- char _[93481];
- virtual ~A3() {}
-
- A1* getA12() {return A2::getA1();}
- A2* getA2() {return this;}
- A3* getA3() {return this;}
-};
-
-void test()
-{
- A1 a1;
- A2 a2;
- A3 a3;
- assert(dynamic_cast<A1*>(a1.getA1()) == a1.getA1());
- assert(dynamic_cast<A1*>(a2.getA1()) == a2.getA1());
- assert(dynamic_cast<A1*>(a2.getA2()) == a2.getA1());
- assert(dynamic_cast<A1*>(a3.getA2()) == a3.getA12());
-
- assert(dynamic_cast<A2*>(a1.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA1()) == a2.getA2());
- assert(dynamic_cast<A2*>(a2.getA2()) == a2.getA2());
- assert(dynamic_cast<A2*>(a3.getA12()) == a3.getA2());
- assert(dynamic_cast<A2*>(a3.getA2()) == a3.getA2());
-
- assert(dynamic_cast<A3*>(a1.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA12()) == 0);
- assert(dynamic_cast<A3*>(a3.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA3()) == a3.getA3());
-}
-
-} // t29
-
-namespace t30
-{
-
-struct A1
-{
- char _[43981];
- virtual ~A1() {}
-
- A1* getA1() {return this;}
-};
-
-struct A2
- : public A1
-{
- char _[34981];
- virtual ~A2() {}
-
- A1* getA1() {return this;}
- A2* getA2() {return this;}
-};
-
-struct A3
- : private A1,
- private A2
-{
- char _[93481];
- virtual ~A3() {}
-
- A1* getA12() {return A2::getA1();}
- A2* getA2() {return this;}
- A3* getA3() {return this;}
-};
-
-void test()
-{
- A1 a1;
- A2 a2;
- A3 a3;
- assert(dynamic_cast<A1*>(a1.getA1()) == a1.getA1());
- assert(dynamic_cast<A1*>(a2.getA1()) == a2.getA1());
- assert(dynamic_cast<A1*>(a2.getA2()) == a2.getA1());
- assert(dynamic_cast<A1*>(a3.getA12()) == a3.getA12());
- assert(dynamic_cast<A1*>(a3.getA2()) == a3.getA12());
-
- assert(dynamic_cast<A2*>(a1.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA1()) == a2.getA2());
- assert(dynamic_cast<A2*>(a2.getA2()) == a2.getA2());
- assert(dynamic_cast<A2*>(a3.getA12()) == a3.getA2());
- assert(dynamic_cast<A2*>(a3.getA2()) == a3.getA2());
-
- assert(dynamic_cast<A3*>(a1.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA12()) == 0);
- assert(dynamic_cast<A3*>(a3.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA3()) == a3.getA3());
-}
-
-} // t30
-
-namespace t31
-{
-
-struct A1
-{
- char _[43981];
- virtual ~A1() {}
-
- A1* getA1() {return this;}
-};
-
-struct A2
- : private A1
-{
- char _[34981];
- virtual ~A2() {}
-
- A1* getA1() {return this;}
- A2* getA2() {return this;}
-};
-
-struct A3
- : public A1,
- private A2
-{
- char _[93481];
- virtual ~A3() {}
-
- A1* getA12() {return A2::getA1();}
- A2* getA2() {return this;}
- A3* getA3() {return this;}
-};
-
-void test()
-{
- A1 a1;
- A2 a2;
- A3 a3;
- assert(dynamic_cast<A1*>(a1.getA1()) == a1.getA1());
- assert(dynamic_cast<A1*>(a2.getA1()) == a2.getA1());
- assert(dynamic_cast<A1*>(a3.getA12()) == a3.getA12());
-
- assert(dynamic_cast<A2*>(a1.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA2()) == a2.getA2());
- assert(dynamic_cast<A2*>(a3.getA12()) == 0);
- assert(dynamic_cast<A2*>(a3.getA2()) == a3.getA2());
-
- assert(dynamic_cast<A3*>(a1.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA12()) == 0);
- assert(dynamic_cast<A3*>(a3.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA3()) == a3.getA3());
-}
-
-} // t31
-
-namespace t32
-{
-
-struct A1
-{
- char _[43981];
- virtual ~A1() {}
-
- A1* getA1() {return this;}
-};
-
-struct A2
- : private A1
-{
- char _[34981];
- virtual ~A2() {}
-
- A1* getA1() {return this;}
- A2* getA2() {return this;}
-};
-
-struct A3
- : private A1,
- public A2
-{
- char _[93481];
- virtual ~A3() {}
-
- A1* getA12() {return A2::getA1();}
- A2* getA2() {return this;}
- A3* getA3() {return this;}
-};
-
-void test()
-{
- A1 a1;
- A2 a2;
- A3 a3;
- assert(dynamic_cast<A1*>(a1.getA1()) == a1.getA1());
- assert(dynamic_cast<A1*>(a2.getA1()) == a2.getA1());
- assert(dynamic_cast<A1*>(a3.getA12()) == a3.getA12());
-
- assert(dynamic_cast<A2*>(a1.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA2()) == a2.getA2());
- assert(dynamic_cast<A2*>(a3.getA12()) == 0);
- assert(dynamic_cast<A2*>(a3.getA2()) == a3.getA2());
-
- assert(dynamic_cast<A3*>(a1.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA12()) == 0);
- assert(dynamic_cast<A3*>(a3.getA2()) == a3.getA3());
- assert(dynamic_cast<A3*>(a3.getA3()) == a3.getA3());
-}
-
-} // t32
-
-namespace t33
-{
-
-struct A1
-{
- char _[43981];
- virtual ~A1() {}
-
- A1* getA1() {return this;}
-};
-
-struct A2
- : private A1
-{
- char _[34981];
- virtual ~A2() {}
-
- A1* getA1() {return this;}
- A2* getA2() {return this;}
-};
-
-struct A3
- : private A1,
- private A2
-{
- char _[93481];
- virtual ~A3() {}
-
- A1* getA12() {return A2::getA1();}
- A2* getA2() {return this;}
- A3* getA3() {return this;}
-};
-
-void test()
-{
- A1 a1;
- A2 a2;
- A3 a3;
- assert(dynamic_cast<A1*>(a1.getA1()) == a1.getA1());
- assert(dynamic_cast<A1*>(a2.getA1()) == a2.getA1());
- assert(dynamic_cast<A1*>(a3.getA12()) == a3.getA12());
-
- assert(dynamic_cast<A2*>(a1.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA2()) == a2.getA2());
- assert(dynamic_cast<A2*>(a3.getA12()) == 0);
- assert(dynamic_cast<A2*>(a3.getA2()) == a3.getA2());
-
- assert(dynamic_cast<A3*>(a1.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA12()) == 0);
- assert(dynamic_cast<A3*>(a3.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA3()) == a3.getA3());
-}
-
-} // t33
-
-/*
-
-A1
-| \
-A2 \
- \ |
- A3
-
-*/
-
-namespace t34
-{
-
-struct A1
-{
- char _[43981];
- virtual ~A1() {}
-
- A1* getA1() {return this;}
-};
-
-struct A2
- : public virtual A1
-{
- char _[34981];
- virtual ~A2() {}
-
- A1* getA1() {return this;}
- A2* getA2() {return this;}
-};
-
-struct A3
- : public virtual A1,
- public A2
-{
- char _[93481];
- virtual ~A3() {}
-
- A1* getA1() {return A1::getA1();}
- A2* getA2() {return this;}
- A3* getA3() {return this;}
-};
-
-void test()
-{
- A1 a1;
- A2 a2;
- A3 a3;
- assert(dynamic_cast<A1*>(a1.getA1()) == a1.getA1());
- assert(dynamic_cast<A1*>(a2.getA1()) == a2.getA1());
- assert(dynamic_cast<A1*>(a2.getA2()) == a2.getA1());
- assert(dynamic_cast<A1*>(a3.getA1()) == a3.getA1());
- assert(dynamic_cast<A1*>(a3.getA2()) == a3.getA1());
- assert(dynamic_cast<A1*>(a3.getA3()) == a3.getA1());
-
- assert(dynamic_cast<A2*>(a1.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA1()) == a2.getA2());
- assert(dynamic_cast<A2*>(a2.getA2()) == a2.getA2());
- assert(dynamic_cast<A2*>(a3.getA1()) == a3.getA2());
- assert(dynamic_cast<A2*>(a3.getA2()) == a3.getA2());
- assert(dynamic_cast<A2*>(a3.getA3()) == a3.getA2());
-
- assert(dynamic_cast<A3*>(a1.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA1()) == a3.getA3());
- assert(dynamic_cast<A3*>(a3.getA2()) == a3.getA3());
- assert(dynamic_cast<A3*>(a3.getA3()) == a3.getA3());
-}
-
-} // t34
-
-namespace t35
-{
-
-struct A1
-{
- char _[43981];
- virtual ~A1() {}
-
- A1* getA1() {return this;}
-};
-
-struct A2
- : private virtual A1
-{
- char _[34981];
- virtual ~A2() {}
-
- A1* getA1() {return this;}
- A2* getA2() {return this;}
-};
-
-struct A3
- : public virtual A1,
- public A2
-{
- char _[93481];
- virtual ~A3() {}
-
- A1* getA1() {return A1::getA1();}
- A2* getA2() {return this;}
- A3* getA3() {return this;}
-};
-
-void test()
-{
- A1 a1;
- A2 a2;
- A3 a3;
- assert(dynamic_cast<A1*>(a1.getA1()) == a1.getA1());
- assert(dynamic_cast<A1*>(a2.getA1()) == a2.getA1());
- assert(dynamic_cast<A1*>(a3.getA1()) == a3.getA1());
- assert(dynamic_cast<A1*>(a3.getA3()) == a3.getA1());
-
- assert(dynamic_cast<A2*>(a1.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA2()) == a2.getA2());
- assert(dynamic_cast<A2*>(a3.getA1()) == a3.getA2());
- assert(dynamic_cast<A2*>(a3.getA2()) == a3.getA2());
- assert(dynamic_cast<A2*>(a3.getA3()) == a3.getA2());
-
- assert(dynamic_cast<A3*>(a1.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA1()) == a3.getA3());
- assert(dynamic_cast<A3*>(a3.getA2()) == a3.getA3());
- assert(dynamic_cast<A3*>(a3.getA3()) == a3.getA3());
-}
-
-} // t35
-
-namespace t36
-{
-
-struct A1
-{
- char _[43981];
- virtual ~A1() {}
-
- A1* getA1() {return this;}
-};
-
-struct A2
- : public virtual A1
-{
- char _[34981];
- virtual ~A2() {}
-
- A1* getA1() {return this;}
- A2* getA2() {return this;}
-};
-
-struct A3
- : private virtual A1,
- public A2
-{
- char _[93481];
- virtual ~A3() {}
-
- A1* getA1() {return A1::getA1();}
- A2* getA2() {return this;}
- A3* getA3() {return this;}
-};
-
-void test()
-{
- A1 a1;
- A2 a2;
- A3 a3;
- assert(dynamic_cast<A1*>(a1.getA1()) == a1.getA1());
- assert(dynamic_cast<A1*>(a2.getA1()) == a2.getA1());
- assert(dynamic_cast<A1*>(a2.getA2()) == a2.getA1());
- assert(dynamic_cast<A1*>(a3.getA1()) == a3.getA1());
- assert(dynamic_cast<A1*>(a3.getA2()) == a3.getA1());
- assert(dynamic_cast<A1*>(a3.getA3()) == a3.getA1());
-
- assert(dynamic_cast<A2*>(a1.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA1()) == a2.getA2());
- assert(dynamic_cast<A2*>(a2.getA2()) == a2.getA2());
- assert(dynamic_cast<A2*>(a3.getA1()) == a3.getA2());
- assert(dynamic_cast<A2*>(a3.getA2()) == a3.getA2());
- assert(dynamic_cast<A2*>(a3.getA3()) == a3.getA2());
-
- assert(dynamic_cast<A3*>(a1.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA1()) == a3.getA3());
- assert(dynamic_cast<A3*>(a3.getA2()) == a3.getA3());
- assert(dynamic_cast<A3*>(a3.getA3()) == a3.getA3());
-}
-
-} // t36
-
-namespace t37
-{
-
-struct A1
-{
- char _[43981];
- virtual ~A1() {}
-
- A1* getA1() {return this;}
-};
-
-struct A2
- : public virtual A1
-{
- char _[34981];
- virtual ~A2() {}
-
- A1* getA1() {return this;}
- A2* getA2() {return this;}
-};
-
-struct A3
- : public virtual A1,
- private A2
-{
- char _[93481];
- virtual ~A3() {}
-
- A1* getA1() {return A1::getA1();}
- A2* getA2() {return this;}
- A3* getA3() {return this;}
-};
-
-void test()
-{
- A1 a1;
- A2 a2;
- A3 a3;
- assert(dynamic_cast<A1*>(a1.getA1()) == a1.getA1());
- assert(dynamic_cast<A1*>(a2.getA1()) == a2.getA1());
- assert(dynamic_cast<A1*>(a2.getA2()) == a2.getA1());
- assert(dynamic_cast<A1*>(a3.getA1()) == a3.getA1());
- assert(dynamic_cast<A1*>(a3.getA2()) == a3.getA1());
- assert(dynamic_cast<A1*>(a3.getA3()) == a3.getA1());
-
- assert(dynamic_cast<A2*>(a1.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA1()) == a2.getA2());
- assert(dynamic_cast<A2*>(a2.getA2()) == a2.getA2());
- assert(dynamic_cast<A2*>(a3.getA1()) == a3.getA2());
- assert(dynamic_cast<A2*>(a3.getA2()) == a3.getA2());
-
- assert(dynamic_cast<A3*>(a1.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA1()) == a3.getA3());
- assert(dynamic_cast<A3*>(a3.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA3()) == a3.getA3());
-}
-
-} // t37
-
-namespace t38
-{
-
-struct A1
-{
- char _[43981];
- virtual ~A1() {}
-
- A1* getA1() {return this;}
-};
-
-struct A2
- : public virtual A1
-{
- char _[34981];
- virtual ~A2() {}
-
- A1* getA1() {return this;}
- A2* getA2() {return this;}
-};
-
-struct A3
- : private virtual A1,
- private A2
-{
- char _[93481];
- virtual ~A3() {}
-
- A1* getA1() {return A1::getA1();}
- A2* getA2() {return this;}
- A3* getA3() {return this;}
-};
-
-void test()
-{
- A1 a1;
- A2 a2;
- A3 a3;
- assert(dynamic_cast<A1*>(a1.getA1()) == a1.getA1());
- assert(dynamic_cast<A1*>(a2.getA1()) == a2.getA1());
- assert(dynamic_cast<A1*>(a2.getA2()) == a2.getA1());
- assert(dynamic_cast<A1*>(a3.getA1()) == a3.getA1());
- assert(dynamic_cast<A1*>(a3.getA2()) == a3.getA1());
-
- assert(dynamic_cast<A2*>(a1.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA1()) == a2.getA2());
- assert(dynamic_cast<A2*>(a2.getA2()) == a2.getA2());
- assert(dynamic_cast<A2*>(a3.getA1()) == a3.getA2());
- assert(dynamic_cast<A2*>(a3.getA2()) == a3.getA2());
-
- assert(dynamic_cast<A3*>(a1.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA1()) == 0);
- assert(dynamic_cast<A3*>(a3.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA3()) == a3.getA3());
-}
-
-} // t38
-
-namespace t39
-{
-
-struct A1
-{
- char _[43981];
- virtual ~A1() {}
-
- A1* getA1() {return this;}
-};
-
-struct A2
- : private virtual A1
-{
- char _[34981];
- virtual ~A2() {}
-
- A1* getA1() {return this;}
- A2* getA2() {return this;}
-};
-
-struct A3
- : public virtual A1,
- private A2
-{
- char _[93481];
- virtual ~A3() {}
-
- A1* getA1() {return A1::getA1();}
- A2* getA2() {return this;}
- A3* getA3() {return this;}
-};
-
-void test()
-{
- A1 a1;
- A2 a2;
- A3 a3;
- assert(dynamic_cast<A1*>(a1.getA1()) == a1.getA1());
- assert(dynamic_cast<A1*>(a2.getA1()) == a2.getA1());
- assert(dynamic_cast<A1*>(a3.getA1()) == a3.getA1());
- assert(dynamic_cast<A1*>(a3.getA3()) == a3.getA1());
-
- assert(dynamic_cast<A2*>(a1.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA2()) == a2.getA2());
- assert(dynamic_cast<A2*>(a3.getA1()) == 0);
- assert(dynamic_cast<A2*>(a3.getA2()) == a3.getA2());
-
- assert(dynamic_cast<A3*>(a1.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA1()) == a3.getA3());
- assert(dynamic_cast<A3*>(a3.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA3()) == a3.getA3());
-}
-
-} // t39
-
-namespace t40
-{
-
-struct A1
-{
- char _[43981];
- virtual ~A1() {}
-
- A1* getA1() {return this;}
-};
-
-struct A2
- : private virtual A1
-{
- char _[34981];
- virtual ~A2() {}
-
- A1* getA1() {return this;}
- A2* getA2() {return this;}
-};
-
-struct A3
- : private virtual A1,
- public A2
-{
- char _[93481];
- virtual ~A3() {}
-
- A1* getA1() {return A1::getA1();}
- A2* getA2() {return this;}
- A3* getA3() {return this;}
-};
-
-void test()
-{
- A1 a1;
- A2 a2;
- A3 a3;
- assert(dynamic_cast<A1*>(a1.getA1()) == a1.getA1());
- assert(dynamic_cast<A1*>(a2.getA1()) == a2.getA1());
- assert(dynamic_cast<A1*>(a3.getA1()) == a3.getA1());
-
- assert(dynamic_cast<A2*>(a1.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA2()) == a2.getA2());
- assert(dynamic_cast<A2*>(a3.getA1()) == 0);
- assert(dynamic_cast<A2*>(a3.getA2()) == a3.getA2());
- assert(dynamic_cast<A2*>(a3.getA3()) == a3.getA2());
-
- assert(dynamic_cast<A3*>(a1.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA1()) == 0);
- assert(dynamic_cast<A3*>(a3.getA2()) == a3.getA3());
- assert(dynamic_cast<A3*>(a3.getA3()) == a3.getA3());
-}
-
-} // t40
-
-namespace t41
-{
-
-struct A1
-{
- char _[43981];
- virtual ~A1() {}
-
- A1* getA1() {return this;}
-};
-
-struct A2
- : private virtual A1
-{
- char _[34981];
- virtual ~A2() {}
-
- A1* getA1() {return this;}
- A2* getA2() {return this;}
-};
-
-struct A3
- : private virtual A1,
- private A2
-{
- char _[93481];
- virtual ~A3() {}
-
- A1* getA1() {return A1::getA1();}
- A2* getA2() {return this;}
- A3* getA3() {return this;}
-};
-
-void test()
-{
- A1 a1;
- A2 a2;
- A3 a3;
- assert(dynamic_cast<A1*>(a1.getA1()) == a1.getA1());
- assert(dynamic_cast<A1*>(a2.getA1()) == a2.getA1());
- assert(dynamic_cast<A1*>(a3.getA1()) == a3.getA1());
-
- assert(dynamic_cast<A2*>(a1.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA2()) == a2.getA2());
- assert(dynamic_cast<A2*>(a3.getA1()) == 0);
- assert(dynamic_cast<A2*>(a3.getA2()) == a3.getA2());
-
- assert(dynamic_cast<A3*>(a1.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA1()) == 0);
- assert(dynamic_cast<A3*>(a3.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA3()) == a3.getA3());
-}
-
-} // t41
-
-int main()
-{
- timer t;
- t1::test();
- t2::test();
- t3::test();
- t4::test();
- t5::test();
- t6::test();
- t7::test();
- t8::test();
- t9::test();
- t10::test();
- t11::test();
- t12::test();
- t13::test();
- t14::test();
- t15::test();
- t16::test();
- t17::test();
- t18::test();
- t19::test();
- t20::test();
- t21::test();
- t22::test();
- t23::test();
- t24::test();
- t25::test();
- t26::test();
- t27::test();
- t28::test();
- t29::test();
- t30::test();
- t31::test();
- t32::test();
- t33::test();
- t34::test();
- t35::test();
- t36::test();
- t37::test();
- t38::test();
- t39::test();
- t40::test();
- t41::test();
-}
Removed: libcxxabi/trunk/test/dynamic_cast5.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/dynamic_cast5.cpp?rev=226690&view=auto
==============================================================================
--- libcxxabi/trunk/test/dynamic_cast5.cpp (original)
+++ libcxxabi/trunk/test/dynamic_cast5.cpp (removed)
@@ -1,1315 +0,0 @@
-//===------------------------- dynamic_cast5.cpp --------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include <cassert>
-#include "support/timer.hpp"
-
-namespace t1
-{
-
-struct A1
-{
- char _[43981];
- virtual ~A1() {}
-
- A1* getA1() {return this;}
-};
-
-struct A2
-{
- char _[34981];
- virtual ~A2() {}
-
- A2* getA2() {return this;}
-};
-
-struct A3
- : public virtual A1,
- private A2
-{
- char _[93481];
- virtual ~A3() {}
-
- A1* getA1() {return A1::getA1();}
- A2* getA2() {return A2::getA2();}
- A3* getA3() {return this;}
-};
-
-struct A4
- : public A3,
- public A2
-{
- char _[13489];
- virtual ~A4() {}
-
- t1::A1* getA1() {return A3::getA1();}
- A2* getA2() {return A3::getA2();}
- A3* getA3() {return A3::getA3();}
- A4* getA4() {return this;}
-};
-
-struct A5
- : public A4,
- public A3
-{
- char _[13489];
- virtual ~A5() {}
-
- t1::A1* getA1() {return A4::getA1();}
- A2* getA2() {return A4::getA2();}
- A3* getA3() {return A4::getA3();}
- A4* getA4() {return A4::getA4();}
- A5* getA5() {return this;}
-};
-
-void test()
-{
- A1 a1;
- A2 a2;
- A3 a3;
- A4 a4;
- A5 a5;
-
- assert(dynamic_cast<A1*>(a1.getA1()) == a1.getA1());
- assert(dynamic_cast<A1*>(a2.getA2()) == 0);
- assert(dynamic_cast<A1*>(a3.getA1()) == a3.getA1());
- assert(dynamic_cast<A1*>(a3.getA2()) == 0);
- assert(dynamic_cast<A1*>(a3.getA3()) == a3.getA1());
- assert(dynamic_cast<A1*>(a4.getA1()) == a4.getA1());
- assert(dynamic_cast<A1*>(a4.getA2()) == 0);
- assert(dynamic_cast<A1*>(a4.getA3()) == a4.getA1());
- assert(dynamic_cast<A1*>(a4.getA4()) == a4.getA1());
- assert(dynamic_cast<A1*>(a5.getA1()) == a5.getA1());
- assert(dynamic_cast<A1*>(a5.getA2()) == 0);
- assert(dynamic_cast<A1*>(a5.getA3()) == a5.getA1());
- assert(dynamic_cast<A1*>(a5.getA4()) == a5.getA1());
- assert(dynamic_cast<A1*>(a5.getA5()) == a5.getA1());
-
- assert(dynamic_cast<A2*>(a1.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA2()) == a2.getA2());
- assert(dynamic_cast<A2*>(a3.getA1()) == 0);
- assert(dynamic_cast<A2*>(a3.getA2()) == a3.getA2());
-// assert(dynamic_cast<A2*>(a3.getA3()) == 0); // cast to private base
- assert(dynamic_cast<A2*>(a4.getA1()) == 0);
- assert(dynamic_cast<A2*>(a4.getA2()) == a4.getA2());
-// assert(dynamic_cast<A2*>(a4.getA3()) == 0); // cast to private base
-// assert(dynamic_cast<A2*>(a4.getA4()) == 0); // cast to ambiguous base
- assert(dynamic_cast<A2*>(a5.getA1()) == 0);
- assert(dynamic_cast<A2*>(a5.getA2()) == a5.getA2());
-// assert(dynamic_cast<A2*>(a5.getA3()) == 0); // cast to private base
-// assert(dynamic_cast<A2*>(a5.getA4()) == 0); // cast to ambiguous base
-// assert(dynamic_cast<A2*>(a5.getA5()) == 0); // cast to ambiguous base
-
- assert(dynamic_cast<A3*>(a1.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA1()) == a3.getA3());
- assert(dynamic_cast<A3*>(a3.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA3()) == a3.getA3());
- assert(dynamic_cast<A3*>(a4.getA1()) == a4.getA3());
- assert(dynamic_cast<A3*>(a4.getA2()) == 0);
- assert(dynamic_cast<A3*>(a4.getA3()) == a4.getA3());
- assert(dynamic_cast<A3*>(a4.getA4()) == a4.getA3());
- assert(dynamic_cast<A3*>(a5.getA1()) == 0);
- assert(dynamic_cast<A3*>(a5.getA2()) == 0);
- assert(dynamic_cast<A3*>(a5.getA3()) == a5.getA3());
- assert(dynamic_cast<A3*>(a5.getA4()) == a5.getA3());
-// assert(dynamic_cast<A3*>(a5.getA5()) == 0); // cast to ambiguous base
-
- assert(dynamic_cast<A4*>(a1.getA1()) == 0);
- assert(dynamic_cast<A4*>(a2.getA2()) == 0);
- assert(dynamic_cast<A4*>(a3.getA1()) == 0);
- assert(dynamic_cast<A4*>(a3.getA2()) == 0);
- assert(dynamic_cast<A4*>(a3.getA3()) == 0);
- assert(dynamic_cast<A4*>(a4.getA1()) == a4.getA4());
- assert(dynamic_cast<A4*>(a4.getA2()) == 0);
- assert(dynamic_cast<A4*>(a4.getA3()) == a4.getA4());
- assert(dynamic_cast<A4*>(a4.getA4()) == a4.getA4());
- assert(dynamic_cast<A4*>(a5.getA1()) == a5.getA4());
- assert(dynamic_cast<A4*>(a5.getA2()) == 0);
- assert(dynamic_cast<A4*>(a5.getA3()) == a5.getA4());
- assert(dynamic_cast<A4*>(a5.getA4()) == a5.getA4());
- assert(dynamic_cast<A4*>(a5.getA5()) == a5.getA4());
-
- assert(dynamic_cast<A5*>(a1.getA1()) == 0);
- assert(dynamic_cast<A5*>(a2.getA2()) == 0);
- assert(dynamic_cast<A5*>(a3.getA1()) == 0);
- assert(dynamic_cast<A5*>(a3.getA2()) == 0);
- assert(dynamic_cast<A5*>(a3.getA3()) == 0);
- assert(dynamic_cast<A5*>(a4.getA1()) == 0);
- assert(dynamic_cast<A5*>(a4.getA2()) == 0);
- assert(dynamic_cast<A5*>(a4.getA3()) == 0);
- assert(dynamic_cast<A5*>(a4.getA4()) == 0);
- assert(dynamic_cast<A5*>(a5.getA1()) == a5.getA5());
- assert(dynamic_cast<A5*>(a5.getA2()) == 0);
- assert(dynamic_cast<A5*>(a5.getA3()) == a5.getA5());
- assert(dynamic_cast<A5*>(a5.getA4()) == a5.getA5());
- assert(dynamic_cast<A5*>(a5.getA5()) == a5.getA5());
-}
-
-} // t1
-
-namespace t2
-{
-
-struct A1
-{
- char _[43981];
- virtual ~A1() {}
-
- A1* getA1() {return this;}
-};
-
-struct A2
-{
- char _[34981];
- virtual ~A2() {}
-
- A2* getA2() {return this;}
-};
-
-struct A3
- : public virtual A1,
- public A2
-{
- char _[93481];
- virtual ~A3() {}
-
- A1* getA1() {return A1::getA1();}
- A2* getA2() {return A2::getA2();}
- A3* getA3() {return this;}
-};
-
-struct A4
- : public A3,
- public A2
-{
- char _[13489];
- virtual ~A4() {}
-
- t2::A1* getA1() {return A3::getA1();}
- A2* getA2() {return A3::getA2();}
- A3* getA3() {return A3::getA3();}
- A4* getA4() {return this;}
-};
-
-struct A5
- : public A4,
- public A3
-{
- char _[13489];
- virtual ~A5() {}
-
- t2::A1* getA1() {return A4::getA1();}
- A2* getA2() {return A4::getA2();}
- A3* getA3() {return A4::getA3();}
- A4* getA4() {return A4::getA4();}
- A5* getA5() {return this;}
-};
-
-void test()
-{
- A1 a1;
- A2 a2;
- A3 a3;
- A4 a4;
- A5 a5;
-
- assert(dynamic_cast<A1*>(a1.getA1()) == a1.getA1());
- assert(dynamic_cast<A1*>(a2.getA2()) == 0);
- assert(dynamic_cast<A1*>(a3.getA1()) == a3.getA1());
- assert(dynamic_cast<A1*>(a3.getA2()) == a3.getA1());
- assert(dynamic_cast<A1*>(a3.getA3()) == a3.getA1());
- assert(dynamic_cast<A1*>(a4.getA1()) == a4.getA1());
- assert(dynamic_cast<A1*>(a4.getA2()) == a4.getA1());
- assert(dynamic_cast<A1*>(a4.getA3()) == a4.getA1());
- assert(dynamic_cast<A1*>(a4.getA4()) == a4.getA1());
- assert(dynamic_cast<A1*>(a5.getA1()) == a5.getA1());
- assert(dynamic_cast<A1*>(a5.getA2()) == a5.getA1());
- assert(dynamic_cast<A1*>(a5.getA3()) == a5.getA1());
- assert(dynamic_cast<A1*>(a5.getA4()) == a5.getA1());
- assert(dynamic_cast<A1*>(a5.getA5()) == a5.getA1());
-
- assert(dynamic_cast<A2*>(a1.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA2()) == a2.getA2());
- assert(dynamic_cast<A2*>(a3.getA1()) == a3.getA2());
- assert(dynamic_cast<A2*>(a3.getA2()) == a3.getA2());
- assert(dynamic_cast<A2*>(a3.getA3()) == a3.getA2());
- assert(dynamic_cast<A2*>(a4.getA1()) == 0);
- assert(dynamic_cast<A2*>(a4.getA2()) == a4.getA2());
- assert(dynamic_cast<A2*>(a4.getA3()) == a4.getA2());
-// assert(dynamic_cast<A2*>(a4.getA4()) == 0); // cast to ambiguous base
- assert(dynamic_cast<A2*>(a5.getA1()) == 0);
- assert(dynamic_cast<A2*>(a5.getA2()) == a5.getA2());
- assert(dynamic_cast<A2*>(a5.getA3()) == a5.getA2());
-// assert(dynamic_cast<A2*>(a5.getA4()) == 0); // cast to ambiguous base
-// assert(dynamic_cast<A2*>(a5.getA5()) == 0); // cast to ambiguous base
-
- assert(dynamic_cast<A3*>(a1.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA1()) == a3.getA3());
- assert(dynamic_cast<A3*>(a3.getA2()) == a3.getA3());
- assert(dynamic_cast<A3*>(a3.getA3()) == a3.getA3());
- assert(dynamic_cast<A3*>(a4.getA1()) == a4.getA3());
- assert(dynamic_cast<A3*>(a4.getA2()) == a4.getA3());
- assert(dynamic_cast<A3*>(a4.getA3()) == a4.getA3());
- assert(dynamic_cast<A3*>(a4.getA4()) == a4.getA3());
- assert(dynamic_cast<A3*>(a5.getA1()) == 0);
- assert(dynamic_cast<A3*>(a5.getA2()) == a5.getA3());
- assert(dynamic_cast<A3*>(a5.getA3()) == a5.getA3());
- assert(dynamic_cast<A3*>(a5.getA4()) == a5.getA3());
-// assert(dynamic_cast<A3*>(a5.getA5()) == 0); // cast to ambiguous base
-
- assert(dynamic_cast<A4*>(a1.getA1()) == 0);
- assert(dynamic_cast<A4*>(a2.getA2()) == 0);
- assert(dynamic_cast<A4*>(a3.getA1()) == 0);
- assert(dynamic_cast<A4*>(a3.getA2()) == 0);
- assert(dynamic_cast<A4*>(a3.getA3()) == 0);
- assert(dynamic_cast<A4*>(a4.getA1()) == a4.getA4());
- assert(dynamic_cast<A4*>(a4.getA2()) == a4.getA4());
- assert(dynamic_cast<A4*>(a4.getA3()) == a4.getA4());
- assert(dynamic_cast<A4*>(a4.getA4()) == a4.getA4());
- assert(dynamic_cast<A4*>(a5.getA1()) == a5.getA4());
- assert(dynamic_cast<A4*>(a5.getA2()) == a5.getA4());
- assert(dynamic_cast<A4*>(a5.getA3()) == a5.getA4());
- assert(dynamic_cast<A4*>(a5.getA4()) == a5.getA4());
- assert(dynamic_cast<A4*>(a5.getA5()) == a5.getA4());
-
- assert(dynamic_cast<A5*>(a1.getA1()) == 0);
- assert(dynamic_cast<A5*>(a2.getA2()) == 0);
- assert(dynamic_cast<A5*>(a3.getA1()) == 0);
- assert(dynamic_cast<A5*>(a3.getA2()) == 0);
- assert(dynamic_cast<A5*>(a3.getA3()) == 0);
- assert(dynamic_cast<A5*>(a4.getA1()) == 0);
- assert(dynamic_cast<A5*>(a4.getA2()) == 0);
- assert(dynamic_cast<A5*>(a4.getA3()) == 0);
- assert(dynamic_cast<A5*>(a4.getA4()) == 0);
- assert(dynamic_cast<A5*>(a5.getA1()) == a5.getA5());
- assert(dynamic_cast<A5*>(a5.getA2()) == a5.getA5());
- assert(dynamic_cast<A5*>(a5.getA3()) == a5.getA5());
- assert(dynamic_cast<A5*>(a5.getA4()) == a5.getA5());
- assert(dynamic_cast<A5*>(a5.getA5()) == a5.getA5());
-}
-
-} // t2
-
-namespace t3
-{
-
-struct A1
-{
- char _[43981];
- virtual ~A1() {}
-
- A1* getA1() {return this;}
-};
-
-struct A2
-{
- char _[34981];
- virtual ~A2() {}
-
- A2* getA2() {return this;}
-};
-
-struct A3
- : public A1,
- public virtual A2
-{
- char _[93481];
- virtual ~A3() {}
-
- A1* getA1() {return A1::getA1();}
- A2* getA2() {return A2::getA2();}
- A3* getA3() {return this;}
-};
-
-struct A4
- : public A1,
- public virtual A2
-{
- char _[13489];
- virtual ~A4() {}
-
- A1* getA1() {return A1::getA1();}
- A2* getA2() {return A2::getA2();}
- A4* getA4() {return this;}
-};
-
-struct A5
- : public A3,
- public A4
-{
- char _[41389];
- virtual ~A5() {}
-
- A1* getA14() {return A4::getA1();}
- A1* getA13() {return A3::getA1();}
- A2* getA2() {return A4::getA2();}
- A3* getA3() {return A3::getA3();}
- A4* getA4() {return A4::getA4();}
- A5* getA5() {return this;}
-};
-
-void test()
-{
- A1 a1;
- A2 a2;
- A3 a3;
- A4 a4;
- A5 a5;
-
- assert(dynamic_cast<A1*>(a1.getA1()) == a1.getA1());
- assert(dynamic_cast<A1*>(a2.getA2()) == 0);
- assert(dynamic_cast<A1*>(a3.getA1()) == a3.getA1());
- assert(dynamic_cast<A1*>(a3.getA2()) == a3.getA1());
- assert(dynamic_cast<A1*>(a3.getA3()) == a3.getA1());
- assert(dynamic_cast<A1*>(a4.getA1()) == a4.getA1());
- assert(dynamic_cast<A1*>(a4.getA2()) == a4.getA1());
- assert(dynamic_cast<A1*>(a4.getA4()) == a4.getA1());
- assert(dynamic_cast<A1*>(a5.getA14()) == a5.getA14());
- assert(dynamic_cast<A1*>(a5.getA13()) == a5.getA13());
- assert(dynamic_cast<A1*>(a5.getA2()) == 0);
- assert(dynamic_cast<A1*>(a5.getA3()) == a5.getA13());
- assert(dynamic_cast<A1*>(a5.getA4()) == a5.getA14());
-
- assert(dynamic_cast<A2*>(a1.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA2()) == a2.getA2());
- assert(dynamic_cast<A2*>(a3.getA1()) == a3.getA2());
- assert(dynamic_cast<A2*>(a3.getA2()) == a3.getA2());
- assert(dynamic_cast<A2*>(a3.getA3()) == a3.getA2());
- assert(dynamic_cast<A2*>(a4.getA1()) == a4.getA2());
- assert(dynamic_cast<A2*>(a4.getA2()) == a4.getA2());
- assert(dynamic_cast<A2*>(a4.getA4()) == a4.getA2());
- assert(dynamic_cast<A2*>(a5.getA14()) == a5.getA2());
- assert(dynamic_cast<A2*>(a5.getA13()) == a5.getA2());
- assert(dynamic_cast<A2*>(a5.getA2()) == a5.getA2());
- assert(dynamic_cast<A2*>(a5.getA3()) == a5.getA2());
- assert(dynamic_cast<A2*>(a5.getA4()) == a5.getA2());
- assert(dynamic_cast<A2*>(a5.getA5()) == a5.getA2());
-
- assert(dynamic_cast<A3*>(a1.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA1()) == a3.getA3());
- assert(dynamic_cast<A3*>(a3.getA2()) == a3.getA3());
- assert(dynamic_cast<A3*>(a3.getA3()) == a3.getA3());
- assert(dynamic_cast<A3*>(a4.getA1()) == 0);
- assert(dynamic_cast<A3*>(a4.getA2()) == 0);
- assert(dynamic_cast<A3*>(a4.getA4()) == 0);
- assert(dynamic_cast<A3*>(a5.getA14()) == a5.getA3());
- assert(dynamic_cast<A3*>(a5.getA13()) == a5.getA3());
- assert(dynamic_cast<A3*>(a5.getA2()) == a5.getA3());
- assert(dynamic_cast<A3*>(a5.getA3()) == a5.getA3());
- assert(dynamic_cast<A3*>(a5.getA4()) == a5.getA3());
- assert(dynamic_cast<A3*>(a5.getA5()) == a5.getA3());
-
- assert(dynamic_cast<A4*>(a1.getA1()) == 0);
- assert(dynamic_cast<A4*>(a2.getA2()) == 0);
- assert(dynamic_cast<A4*>(a3.getA1()) == 0);
- assert(dynamic_cast<A4*>(a3.getA2()) == 0);
- assert(dynamic_cast<A4*>(a3.getA3()) == 0);
- assert(dynamic_cast<A4*>(a4.getA1()) == a4.getA4());
- assert(dynamic_cast<A4*>(a4.getA2()) == a4.getA4());
- assert(dynamic_cast<A4*>(a4.getA4()) == a4.getA4());
- assert(dynamic_cast<A4*>(a5.getA14()) == a5.getA4());
- assert(dynamic_cast<A4*>(a5.getA13()) == a5.getA4());
- assert(dynamic_cast<A4*>(a5.getA2()) == a5.getA4());
- assert(dynamic_cast<A4*>(a5.getA3()) == a5.getA4());
- assert(dynamic_cast<A4*>(a5.getA4()) == a5.getA4());
- assert(dynamic_cast<A4*>(a5.getA5()) == a5.getA4());
-
- assert(dynamic_cast<A5*>(a1.getA1()) == 0);
- assert(dynamic_cast<A5*>(a2.getA2()) == 0);
- assert(dynamic_cast<A5*>(a3.getA1()) == 0);
- assert(dynamic_cast<A5*>(a3.getA2()) == 0);
- assert(dynamic_cast<A5*>(a3.getA3()) == 0);
- assert(dynamic_cast<A5*>(a4.getA1()) == 0);
- assert(dynamic_cast<A5*>(a4.getA2()) == 0);
- assert(dynamic_cast<A5*>(a4.getA4()) == 0);
- assert(dynamic_cast<A5*>(a5.getA14()) == a5.getA5());
- assert(dynamic_cast<A5*>(a5.getA13()) == a5.getA5());
- assert(dynamic_cast<A5*>(a5.getA2()) == a5.getA5());
- assert(dynamic_cast<A5*>(a5.getA3()) == a5.getA5());
- assert(dynamic_cast<A5*>(a5.getA4()) == a5.getA5());
- assert(dynamic_cast<A5*>(a5.getA5()) == a5.getA5());
-}
-
-} // t3
-
-namespace t4
-{
-
-struct A1
-{
- char _[43981];
- virtual ~A1() {}
-
- A1* getA1() {return this;}
-};
-
-struct A2
-{
- char _[34981];
- virtual ~A2() {}
-
- A2* getA2() {return this;}
-};
-
-struct A3
- : protected A1,
- public virtual A2
-{
- char _[93481];
- virtual ~A3() {}
-
- A1* getA1() {return A1::getA1();}
- A2* getA2() {return A2::getA2();}
- A3* getA3() {return this;}
-};
-
-struct A4
- : public A1,
- public virtual A2
-{
- char _[13489];
- virtual ~A4() {}
-
- A1* getA1() {return A1::getA1();}
- A2* getA2() {return A2::getA2();}
- A4* getA4() {return this;}
-};
-
-struct A5
- : public A3,
- public A4
-{
- char _[41389];
- virtual ~A5() {}
-
- A1* getA14() {return A4::getA1();}
- A1* getA13() {return A3::getA1();}
- A2* getA2() {return A4::getA2();}
- A3* getA3() {return A3::getA3();}
- A4* getA4() {return A4::getA4();}
- A5* getA5() {return this;}
-};
-
-void test()
-{
- A1 a1;
- A2 a2;
- A3 a3;
- A4 a4;
- A5 a5;
-
- assert(dynamic_cast<A1*>(a1.getA1()) == a1.getA1());
- assert(dynamic_cast<A1*>(a2.getA2()) == 0);
- assert(dynamic_cast<A1*>(a3.getA1()) == a3.getA1());
- assert(dynamic_cast<A1*>(a3.getA2()) == 0);
-// assert(dynamic_cast<A1*>(a3.getA3()) == a3.getA1()); // cast to protected base
- assert(dynamic_cast<A1*>(a4.getA1()) == a4.getA1());
- assert(dynamic_cast<A1*>(a4.getA2()) == a4.getA1());
- assert(dynamic_cast<A1*>(a4.getA4()) == a4.getA1());
- assert(dynamic_cast<A1*>(a5.getA14()) == a5.getA14());
- assert(dynamic_cast<A1*>(a5.getA13()) == a5.getA13());
- assert(dynamic_cast<A1*>(a5.getA2()) == 0);
-// assert(dynamic_cast<A1*>(a5.getA3()) == a5.getA13()); // cast to protected base
- assert(dynamic_cast<A1*>(a5.getA4()) == a5.getA14());
-
- assert(dynamic_cast<A2*>(a1.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA2()) == a2.getA2());
- assert(dynamic_cast<A2*>(a3.getA1()) == 0);
- assert(dynamic_cast<A2*>(a3.getA2()) == a3.getA2());
- assert(dynamic_cast<A2*>(a3.getA3()) == a3.getA2());
- assert(dynamic_cast<A2*>(a4.getA1()) == a4.getA2());
- assert(dynamic_cast<A2*>(a4.getA2()) == a4.getA2());
- assert(dynamic_cast<A2*>(a4.getA4()) == a4.getA2());
- assert(dynamic_cast<A2*>(a5.getA14()) == a5.getA2());
- assert(dynamic_cast<A2*>(a5.getA13()) == 0);
- assert(dynamic_cast<A2*>(a5.getA2()) == a5.getA2());
- assert(dynamic_cast<A2*>(a5.getA3()) == a5.getA2());
- assert(dynamic_cast<A2*>(a5.getA4()) == a5.getA2());
- assert(dynamic_cast<A2*>(a5.getA5()) == a5.getA2());
-
- assert(dynamic_cast<A3*>(a1.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA1()) == 0);
- assert(dynamic_cast<A3*>(a3.getA2()) == a3.getA3());
- assert(dynamic_cast<A3*>(a3.getA3()) == a3.getA3());
- assert(dynamic_cast<A3*>(a4.getA1()) == 0);
- assert(dynamic_cast<A3*>(a4.getA2()) == 0);
- assert(dynamic_cast<A3*>(a4.getA4()) == 0);
- assert(dynamic_cast<A3*>(a5.getA14()) == a5.getA3());
- assert(dynamic_cast<A3*>(a5.getA13()) == 0);
- assert(dynamic_cast<A3*>(a5.getA2()) == a5.getA3());
- assert(dynamic_cast<A3*>(a5.getA3()) == a5.getA3());
- assert(dynamic_cast<A3*>(a5.getA4()) == a5.getA3());
- assert(dynamic_cast<A3*>(a5.getA5()) == a5.getA3());
-
- assert(dynamic_cast<A4*>(a1.getA1()) == 0);
- assert(dynamic_cast<A4*>(a2.getA2()) == 0);
- assert(dynamic_cast<A4*>(a3.getA1()) == 0);
- assert(dynamic_cast<A4*>(a3.getA2()) == 0);
- assert(dynamic_cast<A4*>(a3.getA3()) == 0);
- assert(dynamic_cast<A4*>(a4.getA1()) == a4.getA4());
- assert(dynamic_cast<A4*>(a4.getA2()) == a4.getA4());
- assert(dynamic_cast<A4*>(a4.getA4()) == a4.getA4());
- assert(dynamic_cast<A4*>(a5.getA14()) == a5.getA4());
- assert(dynamic_cast<A4*>(a5.getA13()) == 0);
- assert(dynamic_cast<A4*>(a5.getA2()) == a5.getA4());
- assert(dynamic_cast<A4*>(a5.getA3()) == a5.getA4());
- assert(dynamic_cast<A4*>(a5.getA4()) == a5.getA4());
- assert(dynamic_cast<A4*>(a5.getA5()) == a5.getA4());
-
- assert(dynamic_cast<A5*>(a1.getA1()) == 0);
- assert(dynamic_cast<A5*>(a2.getA2()) == 0);
- assert(dynamic_cast<A5*>(a3.getA1()) == 0);
- assert(dynamic_cast<A5*>(a3.getA2()) == 0);
- assert(dynamic_cast<A5*>(a3.getA3()) == 0);
- assert(dynamic_cast<A5*>(a4.getA1()) == 0);
- assert(dynamic_cast<A5*>(a4.getA2()) == 0);
- assert(dynamic_cast<A5*>(a4.getA4()) == 0);
- assert(dynamic_cast<A5*>(a5.getA14()) == a5.getA5());
- assert(dynamic_cast<A5*>(a5.getA13()) == 0);
- assert(dynamic_cast<A5*>(a5.getA2()) == a5.getA5());
- assert(dynamic_cast<A5*>(a5.getA3()) == a5.getA5());
- assert(dynamic_cast<A5*>(a5.getA4()) == a5.getA5());
- assert(dynamic_cast<A5*>(a5.getA5()) == a5.getA5());
-}
-
-} // t4
-
-namespace t5
-{
-
-struct A1
-{
- char _[43981];
- virtual ~A1() {}
-
- A1* getA1() {return this;}
-};
-
-struct A2
-{
- char _[34981];
- virtual ~A2() {}
-
- A2* getA2() {return this;}
-};
-
-struct A3
- : public A1,
- protected virtual A2
-{
- char _[93481];
- virtual ~A3() {}
-
- A1* getA1() {return A1::getA1();}
- A2* getA2() {return A2::getA2();}
- A3* getA3() {return this;}
-};
-
-struct A4
- : public A1,
- public virtual A2
-{
- char _[13489];
- virtual ~A4() {}
-
- A1* getA1() {return A1::getA1();}
- A2* getA2() {return A2::getA2();}
- A4* getA4() {return this;}
-};
-
-struct A5
- : public A3,
- public A4
-{
- char _[41389];
- virtual ~A5() {}
-
- A1* getA14() {return A4::getA1();}
- A1* getA13() {return A3::getA1();}
- A2* getA2() {return A4::getA2();}
- A3* getA3() {return A3::getA3();}
- A4* getA4() {return A4::getA4();}
- A5* getA5() {return this;}
-};
-
-void test()
-{
- A1 a1;
- A2 a2;
- A3 a3;
- A4 a4;
- A5 a5;
-
- assert(dynamic_cast<A1*>(a1.getA1()) == a1.getA1());
- assert(dynamic_cast<A1*>(a2.getA2()) == 0);
- assert(dynamic_cast<A1*>(a3.getA1()) == a3.getA1());
- assert(dynamic_cast<A1*>(a3.getA2()) == 0);
- assert(dynamic_cast<A1*>(a3.getA3()) == a3.getA1());
- assert(dynamic_cast<A1*>(a4.getA1()) == a4.getA1());
- assert(dynamic_cast<A1*>(a4.getA2()) == a4.getA1());
- assert(dynamic_cast<A1*>(a4.getA4()) == a4.getA1());
- assert(dynamic_cast<A1*>(a5.getA14()) == a5.getA14());
- assert(dynamic_cast<A1*>(a5.getA13()) == a5.getA13());
- assert(dynamic_cast<A1*>(a5.getA2()) == 0);
- assert(dynamic_cast<A1*>(a5.getA3()) == a5.getA13());
- assert(dynamic_cast<A1*>(a5.getA4()) == a5.getA14());
-
- assert(dynamic_cast<A2*>(a1.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA2()) == a2.getA2());
- assert(dynamic_cast<A2*>(a3.getA1()) == 0);
- assert(dynamic_cast<A2*>(a3.getA2()) == a3.getA2());
-// assert(dynamic_cast<A2*>(a3.getA3()) == a3.getA2()); // cast to protected base
- assert(dynamic_cast<A2*>(a4.getA1()) == a4.getA2());
- assert(dynamic_cast<A2*>(a4.getA2()) == a4.getA2());
- assert(dynamic_cast<A2*>(a4.getA4()) == a4.getA2());
- assert(dynamic_cast<A2*>(a5.getA14()) == a5.getA2());
- assert(dynamic_cast<A2*>(a5.getA13()) == a5.getA2());
- assert(dynamic_cast<A2*>(a5.getA2()) == a5.getA2());
-// assert(dynamic_cast<A2*>(a5.getA3()) == a5.getA2()); // cast to protected base
- assert(dynamic_cast<A2*>(a5.getA4()) == a5.getA2());
- assert(dynamic_cast<A2*>(a5.getA5()) == a5.getA2());
-
- assert(dynamic_cast<A3*>(a1.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA1()) == a3.getA3());
- assert(dynamic_cast<A3*>(a3.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA3()) == a3.getA3());
- assert(dynamic_cast<A3*>(a4.getA1()) == 0);
- assert(dynamic_cast<A3*>(a4.getA2()) == 0);
- assert(dynamic_cast<A3*>(a4.getA4()) == 0);
- assert(dynamic_cast<A3*>(a5.getA14()) == a5.getA3());
- assert(dynamic_cast<A3*>(a5.getA13()) == a5.getA3());
- assert(dynamic_cast<A3*>(a5.getA2()) == a5.getA3());
- assert(dynamic_cast<A3*>(a5.getA3()) == a5.getA3());
- assert(dynamic_cast<A3*>(a5.getA4()) == a5.getA3());
- assert(dynamic_cast<A3*>(a5.getA5()) == a5.getA3());
-
- assert(dynamic_cast<A4*>(a1.getA1()) == 0);
- assert(dynamic_cast<A4*>(a2.getA2()) == 0);
- assert(dynamic_cast<A4*>(a3.getA1()) == 0);
- assert(dynamic_cast<A4*>(a3.getA2()) == 0);
- assert(dynamic_cast<A4*>(a3.getA3()) == 0);
- assert(dynamic_cast<A4*>(a4.getA1()) == a4.getA4());
- assert(dynamic_cast<A4*>(a4.getA2()) == a4.getA4());
- assert(dynamic_cast<A4*>(a4.getA4()) == a4.getA4());
- assert(dynamic_cast<A4*>(a5.getA14()) == a5.getA4());
- assert(dynamic_cast<A4*>(a5.getA13()) == a5.getA4());
- assert(dynamic_cast<A4*>(a5.getA2()) == a5.getA4());
- assert(dynamic_cast<A4*>(a5.getA3()) == a5.getA4());
- assert(dynamic_cast<A4*>(a5.getA4()) == a5.getA4());
- assert(dynamic_cast<A4*>(a5.getA5()) == a5.getA4());
-
- assert(dynamic_cast<A5*>(a1.getA1()) == 0);
- assert(dynamic_cast<A5*>(a2.getA2()) == 0);
- assert(dynamic_cast<A5*>(a3.getA1()) == 0);
- assert(dynamic_cast<A5*>(a3.getA2()) == 0);
- assert(dynamic_cast<A5*>(a3.getA3()) == 0);
- assert(dynamic_cast<A5*>(a4.getA1()) == 0);
- assert(dynamic_cast<A5*>(a4.getA2()) == 0);
- assert(dynamic_cast<A5*>(a4.getA4()) == 0);
- assert(dynamic_cast<A5*>(a5.getA14()) == a5.getA5());
- assert(dynamic_cast<A5*>(a5.getA13()) == a5.getA5());
- assert(dynamic_cast<A5*>(a5.getA2()) == a5.getA5());
- assert(dynamic_cast<A5*>(a5.getA3()) == a5.getA5());
- assert(dynamic_cast<A5*>(a5.getA4()) == a5.getA5());
- assert(dynamic_cast<A5*>(a5.getA5()) == a5.getA5());
-}
-
-} // t5
-
-namespace t6
-{
-
-struct A1
-{
- char _[43981];
- virtual ~A1() {}
-
- A1* getA1() {return this;}
-};
-
-struct A2
-{
- char _[34981];
- virtual ~A2() {}
-
- A2* getA2() {return this;}
-};
-
-struct A3
- : public A1,
- public virtual A2
-{
- char _[93481];
- virtual ~A3() {}
-
- A1* getA1() {return A1::getA1();}
- A2* getA2() {return A2::getA2();}
- A3* getA3() {return this;}
-};
-
-struct A4
- : protected A1,
- public virtual A2
-{
- char _[13489];
- virtual ~A4() {}
-
- A1* getA1() {return A1::getA1();}
- A2* getA2() {return A2::getA2();}
- A4* getA4() {return this;}
-};
-
-struct A5
- : public A3,
- public A4
-{
- char _[41389];
- virtual ~A5() {}
-
- A1* getA14() {return A4::getA1();}
- A1* getA13() {return A3::getA1();}
- A2* getA2() {return A4::getA2();}
- A3* getA3() {return A3::getA3();}
- A4* getA4() {return A4::getA4();}
- A5* getA5() {return this;}
-};
-
-void test()
-{
- A1 a1;
- A2 a2;
- A3 a3;
- A4 a4;
- A5 a5;
-
- assert(dynamic_cast<A1*>(a1.getA1()) == a1.getA1());
- assert(dynamic_cast<A1*>(a2.getA2()) == 0);
- assert(dynamic_cast<A1*>(a3.getA1()) == a3.getA1());
- assert(dynamic_cast<A1*>(a3.getA2()) == a3.getA1());
- assert(dynamic_cast<A1*>(a3.getA3()) == a3.getA1());
- assert(dynamic_cast<A1*>(a4.getA1()) == a4.getA1());
- assert(dynamic_cast<A1*>(a4.getA2()) == 0);
-// assert(dynamic_cast<A1*>(a4.getA4()) == a4.getA1()); // cast to protected base
- assert(dynamic_cast<A1*>(a5.getA14()) == a5.getA14());
- assert(dynamic_cast<A1*>(a5.getA13()) == a5.getA13());
- assert(dynamic_cast<A1*>(a5.getA2()) == 0);
- assert(dynamic_cast<A1*>(a5.getA3()) == a5.getA13());
-// assert(dynamic_cast<A1*>(a5.getA4()) == a5.getA14()); // cast to protected base
-
- assert(dynamic_cast<A2*>(a1.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA2()) == a2.getA2());
- assert(dynamic_cast<A2*>(a3.getA1()) == a3.getA2());
- assert(dynamic_cast<A2*>(a3.getA2()) == a3.getA2());
- assert(dynamic_cast<A2*>(a3.getA3()) == a3.getA2());
- assert(dynamic_cast<A2*>(a4.getA1()) == 0);
- assert(dynamic_cast<A2*>(a4.getA2()) == a4.getA2());
- assert(dynamic_cast<A2*>(a4.getA4()) == a4.getA2());
- assert(dynamic_cast<A2*>(a5.getA14()) == 0);
- assert(dynamic_cast<A2*>(a5.getA13()) == a5.getA2());
- assert(dynamic_cast<A2*>(a5.getA2()) == a5.getA2());
- assert(dynamic_cast<A2*>(a5.getA3()) == a5.getA2());
- assert(dynamic_cast<A2*>(a5.getA4()) == a5.getA2());
- assert(dynamic_cast<A2*>(a5.getA5()) == a5.getA2());
-
- assert(dynamic_cast<A3*>(a1.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA1()) == a3.getA3());
- assert(dynamic_cast<A3*>(a3.getA2()) == a3.getA3());
- assert(dynamic_cast<A3*>(a3.getA3()) == a3.getA3());
- assert(dynamic_cast<A3*>(a4.getA1()) == 0);
- assert(dynamic_cast<A3*>(a4.getA2()) == 0);
- assert(dynamic_cast<A3*>(a4.getA4()) == 0);
- assert(dynamic_cast<A3*>(a5.getA14()) == 0);
- assert(dynamic_cast<A3*>(a5.getA13()) == a5.getA3());
- assert(dynamic_cast<A3*>(a5.getA2()) == a5.getA3());
- assert(dynamic_cast<A3*>(a5.getA3()) == a5.getA3());
- assert(dynamic_cast<A3*>(a5.getA4()) == a5.getA3());
- assert(dynamic_cast<A3*>(a5.getA5()) == a5.getA3());
-
- assert(dynamic_cast<A4*>(a1.getA1()) == 0);
- assert(dynamic_cast<A4*>(a2.getA2()) == 0);
- assert(dynamic_cast<A4*>(a3.getA1()) == 0);
- assert(dynamic_cast<A4*>(a3.getA2()) == 0);
- assert(dynamic_cast<A4*>(a3.getA3()) == 0);
- assert(dynamic_cast<A4*>(a4.getA1()) == 0);
- assert(dynamic_cast<A4*>(a4.getA2()) == a4.getA4());
- assert(dynamic_cast<A4*>(a4.getA4()) == a4.getA4());
- assert(dynamic_cast<A4*>(a5.getA14()) == 0);
- assert(dynamic_cast<A4*>(a5.getA13()) == a5.getA4());
- assert(dynamic_cast<A4*>(a5.getA2()) == a5.getA4());
- assert(dynamic_cast<A4*>(a5.getA3()) == a5.getA4());
- assert(dynamic_cast<A4*>(a5.getA4()) == a5.getA4());
- assert(dynamic_cast<A4*>(a5.getA5()) == a5.getA4());
-
- assert(dynamic_cast<A5*>(a1.getA1()) == 0);
- assert(dynamic_cast<A5*>(a2.getA2()) == 0);
- assert(dynamic_cast<A5*>(a3.getA1()) == 0);
- assert(dynamic_cast<A5*>(a3.getA2()) == 0);
- assert(dynamic_cast<A5*>(a3.getA3()) == 0);
- assert(dynamic_cast<A5*>(a4.getA1()) == 0);
- assert(dynamic_cast<A5*>(a4.getA2()) == 0);
- assert(dynamic_cast<A5*>(a4.getA4()) == 0);
- assert(dynamic_cast<A5*>(a5.getA14()) == 0);
- assert(dynamic_cast<A5*>(a5.getA13()) == a5.getA5());
- assert(dynamic_cast<A5*>(a5.getA2()) == a5.getA5());
- assert(dynamic_cast<A5*>(a5.getA3()) == a5.getA5());
- assert(dynamic_cast<A5*>(a5.getA4()) == a5.getA5());
- assert(dynamic_cast<A5*>(a5.getA5()) == a5.getA5());
-}
-
-} // t6
-
-namespace t7
-{
-
-struct A1
-{
- char _[43981];
- virtual ~A1() {}
-
- A1* getA1() {return this;}
-};
-
-struct A2
-{
- char _[34981];
- virtual ~A2() {}
-
- A2* getA2() {return this;}
-};
-
-struct A3
- : public A1,
- public virtual A2
-{
- char _[93481];
- virtual ~A3() {}
-
- A1* getA1() {return A1::getA1();}
- A2* getA2() {return A2::getA2();}
- A3* getA3() {return this;}
-};
-
-struct A4
- : public A1,
- protected virtual A2
-{
- char _[13489];
- virtual ~A4() {}
-
- A1* getA1() {return A1::getA1();}
- A2* getA2() {return A2::getA2();}
- A4* getA4() {return this;}
-};
-
-struct A5
- : public A3,
- public A4
-{
- char _[41389];
- virtual ~A5() {}
-
- A1* getA14() {return A4::getA1();}
- A1* getA13() {return A3::getA1();}
- A2* getA2() {return A4::getA2();}
- A3* getA3() {return A3::getA3();}
- A4* getA4() {return A4::getA4();}
- A5* getA5() {return this;}
-};
-
-void test()
-{
- A1 a1;
- A2 a2;
- A3 a3;
- A4 a4;
- A5 a5;
-
- assert(dynamic_cast<A1*>(a1.getA1()) == a1.getA1());
- assert(dynamic_cast<A1*>(a2.getA2()) == 0);
- assert(dynamic_cast<A1*>(a3.getA1()) == a3.getA1());
- assert(dynamic_cast<A1*>(a3.getA2()) == a3.getA1());
- assert(dynamic_cast<A1*>(a3.getA3()) == a3.getA1());
- assert(dynamic_cast<A1*>(a4.getA1()) == a4.getA1());
- assert(dynamic_cast<A1*>(a4.getA2()) == 0);
- assert(dynamic_cast<A1*>(a4.getA4()) == a4.getA1());
- assert(dynamic_cast<A1*>(a5.getA14()) == a5.getA14());
- assert(dynamic_cast<A1*>(a5.getA13()) == a5.getA13());
- assert(dynamic_cast<A1*>(a5.getA2()) == 0);
- assert(dynamic_cast<A1*>(a5.getA3()) == a5.getA13());
- assert(dynamic_cast<A1*>(a5.getA4()) == a5.getA14());
-
- assert(dynamic_cast<A2*>(a1.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA2()) == a2.getA2());
- assert(dynamic_cast<A2*>(a3.getA1()) == a3.getA2());
- assert(dynamic_cast<A2*>(a3.getA2()) == a3.getA2());
- assert(dynamic_cast<A2*>(a3.getA3()) == a3.getA2());
- assert(dynamic_cast<A2*>(a4.getA1()) == 0);
- assert(dynamic_cast<A2*>(a4.getA2()) == a4.getA2());
-// assert(dynamic_cast<A2*>(a4.getA4()) == a4.getA2()); // cast to protected base
- assert(dynamic_cast<A2*>(a5.getA14()) == a5.getA2());
- assert(dynamic_cast<A2*>(a5.getA13()) == a5.getA2());
- assert(dynamic_cast<A2*>(a5.getA2()) == a5.getA2());
- assert(dynamic_cast<A2*>(a5.getA3()) == a5.getA2());
-// assert(dynamic_cast<A2*>(a5.getA4()) == a5.getA2()); // cast to protected base
- assert(dynamic_cast<A2*>(a5.getA5()) == a5.getA2());
-
- assert(dynamic_cast<A3*>(a1.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA1()) == a3.getA3());
- assert(dynamic_cast<A3*>(a3.getA2()) == a3.getA3());
- assert(dynamic_cast<A3*>(a3.getA3()) == a3.getA3());
- assert(dynamic_cast<A3*>(a4.getA1()) == 0);
- assert(dynamic_cast<A3*>(a4.getA2()) == 0);
- assert(dynamic_cast<A3*>(a4.getA4()) == 0);
- assert(dynamic_cast<A3*>(a5.getA14()) == a5.getA3());
- assert(dynamic_cast<A3*>(a5.getA13()) == a5.getA3());
- assert(dynamic_cast<A3*>(a5.getA2()) == a5.getA3());
- assert(dynamic_cast<A3*>(a5.getA3()) == a5.getA3());
- assert(dynamic_cast<A3*>(a5.getA4()) == a5.getA3());
- assert(dynamic_cast<A3*>(a5.getA5()) == a5.getA3());
-
- assert(dynamic_cast<A4*>(a1.getA1()) == 0);
- assert(dynamic_cast<A4*>(a2.getA2()) == 0);
- assert(dynamic_cast<A4*>(a3.getA1()) == 0);
- assert(dynamic_cast<A4*>(a3.getA2()) == 0);
- assert(dynamic_cast<A4*>(a3.getA3()) == 0);
- assert(dynamic_cast<A4*>(a4.getA1()) == a4.getA4());
- assert(dynamic_cast<A4*>(a4.getA2()) == 0);
- assert(dynamic_cast<A4*>(a4.getA4()) == a4.getA4());
- assert(dynamic_cast<A4*>(a5.getA14()) == a5.getA4());
- assert(dynamic_cast<A4*>(a5.getA13()) == a5.getA4());
- assert(dynamic_cast<A4*>(a5.getA2()) == a5.getA4());
- assert(dynamic_cast<A4*>(a5.getA3()) == a5.getA4());
- assert(dynamic_cast<A4*>(a5.getA4()) == a5.getA4());
- assert(dynamic_cast<A4*>(a5.getA5()) == a5.getA4());
-
- assert(dynamic_cast<A5*>(a1.getA1()) == 0);
- assert(dynamic_cast<A5*>(a2.getA2()) == 0);
- assert(dynamic_cast<A5*>(a3.getA1()) == 0);
- assert(dynamic_cast<A5*>(a3.getA2()) == 0);
- assert(dynamic_cast<A5*>(a3.getA3()) == 0);
- assert(dynamic_cast<A5*>(a4.getA1()) == 0);
- assert(dynamic_cast<A5*>(a4.getA2()) == 0);
- assert(dynamic_cast<A5*>(a4.getA4()) == 0);
- assert(dynamic_cast<A5*>(a5.getA14()) == a5.getA5());
- assert(dynamic_cast<A5*>(a5.getA13()) == a5.getA5());
- assert(dynamic_cast<A5*>(a5.getA2()) == a5.getA5());
- assert(dynamic_cast<A5*>(a5.getA3()) == a5.getA5());
- assert(dynamic_cast<A5*>(a5.getA4()) == a5.getA5());
- assert(dynamic_cast<A5*>(a5.getA5()) == a5.getA5());
-}
-
-} // t7
-
-namespace t8
-{
-
-struct A1
-{
- char _[43981];
- virtual ~A1() {}
-
- A1* getA1() {return this;}
-};
-
-struct A2
-{
- char _[34981];
- virtual ~A2() {}
-
- A2* getA2() {return this;}
-};
-
-struct A3
- : public A1,
- public virtual A2
-{
- char _[93481];
- virtual ~A3() {}
-
- A1* getA1() {return A1::getA1();}
- A2* getA2() {return A2::getA2();}
- A3* getA3() {return this;}
-};
-
-struct A4
- : public A1,
- public virtual A2
-{
- char _[13489];
- virtual ~A4() {}
-
- A1* getA1() {return A1::getA1();}
- A2* getA2() {return A2::getA2();}
- A4* getA4() {return this;}
-};
-
-struct A5
- : protected A3,
- public A4
-{
- char _[41389];
- virtual ~A5() {}
-
- A1* getA14() {return A4::getA1();}
- A1* getA13() {return A3::getA1();}
- A2* getA2() {return A4::getA2();}
- A3* getA3() {return A3::getA3();}
- A4* getA4() {return A4::getA4();}
- A5* getA5() {return this;}
-};
-
-void test()
-{
- A1 a1;
- A2 a2;
- A3 a3;
- A4 a4;
- A5 a5;
-
- assert(dynamic_cast<A1*>(a1.getA1()) == a1.getA1());
- assert(dynamic_cast<A1*>(a2.getA2()) == 0);
- assert(dynamic_cast<A1*>(a3.getA1()) == a3.getA1());
- assert(dynamic_cast<A1*>(a3.getA2()) == a3.getA1());
- assert(dynamic_cast<A1*>(a3.getA3()) == a3.getA1());
- assert(dynamic_cast<A1*>(a4.getA1()) == a4.getA1());
- assert(dynamic_cast<A1*>(a4.getA2()) == a4.getA1());
- assert(dynamic_cast<A1*>(a4.getA4()) == a4.getA1());
- assert(dynamic_cast<A1*>(a5.getA14()) == a5.getA14());
- assert(dynamic_cast<A1*>(a5.getA13()) == a5.getA13());
- assert(dynamic_cast<A1*>(a5.getA2()) == 0);
- assert(dynamic_cast<A1*>(a5.getA3()) == a5.getA13());
- assert(dynamic_cast<A1*>(a5.getA4()) == a5.getA14());
-
- assert(dynamic_cast<A2*>(a1.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA2()) == a2.getA2());
- assert(dynamic_cast<A2*>(a3.getA1()) == a3.getA2());
- assert(dynamic_cast<A2*>(a3.getA2()) == a3.getA2());
- assert(dynamic_cast<A2*>(a3.getA3()) == a3.getA2());
- assert(dynamic_cast<A2*>(a4.getA1()) == a4.getA2());
- assert(dynamic_cast<A2*>(a4.getA2()) == a4.getA2());
- assert(dynamic_cast<A2*>(a4.getA4()) == a4.getA2());
- assert(dynamic_cast<A2*>(a5.getA14()) == a5.getA2());
- assert(dynamic_cast<A2*>(a5.getA13()) == 0);
- assert(dynamic_cast<A2*>(a5.getA2()) == a5.getA2());
- assert(dynamic_cast<A2*>(a5.getA3()) == a5.getA2());
- assert(dynamic_cast<A2*>(a5.getA4()) == a5.getA2());
- assert(dynamic_cast<A2*>(a5.getA5()) == a5.getA2());
-
- assert(dynamic_cast<A3*>(a1.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA1()) == a3.getA3());
- assert(dynamic_cast<A3*>(a3.getA2()) == a3.getA3());
- assert(dynamic_cast<A3*>(a3.getA3()) == a3.getA3());
- assert(dynamic_cast<A3*>(a4.getA1()) == 0);
- assert(dynamic_cast<A3*>(a4.getA2()) == 0);
- assert(dynamic_cast<A3*>(a4.getA4()) == 0);
- assert(dynamic_cast<A3*>(a5.getA14()) == 0);
- assert(dynamic_cast<A3*>(a5.getA13()) == a5.getA3());
- assert(dynamic_cast<A3*>(a5.getA2()) == a5.getA3());
- assert(dynamic_cast<A3*>(a5.getA3()) == a5.getA3());
- assert(dynamic_cast<A3*>(a5.getA4()) == 0);
-// assert(dynamic_cast<A3*>(a5.getA5()) == a5.getA3()); // cast to protected base
-
- assert(dynamic_cast<A4*>(a1.getA1()) == 0);
- assert(dynamic_cast<A4*>(a2.getA2()) == 0);
- assert(dynamic_cast<A4*>(a3.getA1()) == 0);
- assert(dynamic_cast<A4*>(a3.getA2()) == 0);
- assert(dynamic_cast<A4*>(a3.getA3()) == 0);
- assert(dynamic_cast<A4*>(a4.getA1()) == a4.getA4());
- assert(dynamic_cast<A4*>(a4.getA2()) == a4.getA4());
- assert(dynamic_cast<A4*>(a4.getA4()) == a4.getA4());
- assert(dynamic_cast<A4*>(a5.getA14()) == a5.getA4());
- assert(dynamic_cast<A4*>(a5.getA13()) == 0);
- assert(dynamic_cast<A4*>(a5.getA2()) == a5.getA4());
- assert(dynamic_cast<A4*>(a5.getA3()) == 0);
- assert(dynamic_cast<A4*>(a5.getA4()) == a5.getA4());
- assert(dynamic_cast<A4*>(a5.getA5()) == a5.getA4());
-
- assert(dynamic_cast<A5*>(a1.getA1()) == 0);
- assert(dynamic_cast<A5*>(a2.getA2()) == 0);
- assert(dynamic_cast<A5*>(a3.getA1()) == 0);
- assert(dynamic_cast<A5*>(a3.getA2()) == 0);
- assert(dynamic_cast<A5*>(a3.getA3()) == 0);
- assert(dynamic_cast<A5*>(a4.getA1()) == 0);
- assert(dynamic_cast<A5*>(a4.getA2()) == 0);
- assert(dynamic_cast<A5*>(a4.getA4()) == 0);
- assert(dynamic_cast<A5*>(a5.getA14()) == a5.getA5());
- assert(dynamic_cast<A5*>(a5.getA13()) == 0);
- assert(dynamic_cast<A5*>(a5.getA2()) == a5.getA5());
- assert(dynamic_cast<A5*>(a5.getA3()) == 0);
- assert(dynamic_cast<A5*>(a5.getA4()) == a5.getA5());
- assert(dynamic_cast<A5*>(a5.getA5()) == a5.getA5());
-}
-
-} // t8
-
-namespace t9
-{
-
-struct A1
-{
- char _[43981];
- virtual ~A1() {}
-
- A1* getA1() {return this;}
-};
-
-struct A2
-{
- char _[34981];
- virtual ~A2() {}
-
- A2* getA2() {return this;}
-};
-
-struct A3
- : public A1,
- public virtual A2
-{
- char _[93481];
- virtual ~A3() {}
-
- A1* getA1() {return A1::getA1();}
- A2* getA2() {return A2::getA2();}
- A3* getA3() {return this;}
-};
-
-struct A4
- : public A1,
- public virtual A2
-{
- char _[13489];
- virtual ~A4() {}
-
- A1* getA1() {return A1::getA1();}
- A2* getA2() {return A2::getA2();}
- A4* getA4() {return this;}
-};
-
-struct A5
- : public A3,
- protected A4
-{
- char _[41389];
- virtual ~A5() {}
-
- A1* getA14() {return A4::getA1();}
- A1* getA13() {return A3::getA1();}
- A2* getA2() {return A4::getA2();}
- A3* getA3() {return A3::getA3();}
- A4* getA4() {return A4::getA4();}
- A5* getA5() {return this;}
-};
-
-void test()
-{
- A1 a1;
- A2 a2;
- A3 a3;
- A4 a4;
- A5 a5;
-
- assert(dynamic_cast<A1*>(a1.getA1()) == a1.getA1());
- assert(dynamic_cast<A1*>(a2.getA2()) == 0);
- assert(dynamic_cast<A1*>(a3.getA1()) == a3.getA1());
- assert(dynamic_cast<A1*>(a3.getA2()) == a3.getA1());
- assert(dynamic_cast<A1*>(a3.getA3()) == a3.getA1());
- assert(dynamic_cast<A1*>(a4.getA1()) == a4.getA1());
- assert(dynamic_cast<A1*>(a4.getA2()) == a4.getA1());
- assert(dynamic_cast<A1*>(a4.getA4()) == a4.getA1());
- assert(dynamic_cast<A1*>(a5.getA14()) == a5.getA14());
- assert(dynamic_cast<A1*>(a5.getA13()) == a5.getA13());
- assert(dynamic_cast<A1*>(a5.getA2()) == 0);
- assert(dynamic_cast<A1*>(a5.getA3()) == a5.getA13());
- assert(dynamic_cast<A1*>(a5.getA4()) == a5.getA14());
-
- assert(dynamic_cast<A2*>(a1.getA1()) == 0);
- assert(dynamic_cast<A2*>(a2.getA2()) == a2.getA2());
- assert(dynamic_cast<A2*>(a3.getA1()) == a3.getA2());
- assert(dynamic_cast<A2*>(a3.getA2()) == a3.getA2());
- assert(dynamic_cast<A2*>(a3.getA3()) == a3.getA2());
- assert(dynamic_cast<A2*>(a4.getA1()) == a4.getA2());
- assert(dynamic_cast<A2*>(a4.getA2()) == a4.getA2());
- assert(dynamic_cast<A2*>(a4.getA4()) == a4.getA2());
- assert(dynamic_cast<A2*>(a5.getA14()) == 0);
- assert(dynamic_cast<A2*>(a5.getA13()) == a5.getA2());
- assert(dynamic_cast<A2*>(a5.getA2()) == a5.getA2());
- assert(dynamic_cast<A2*>(a5.getA3()) == a5.getA2());
- assert(dynamic_cast<A2*>(a5.getA4()) == a5.getA2());
- assert(dynamic_cast<A2*>(a5.getA5()) == a5.getA2());
-
- assert(dynamic_cast<A3*>(a1.getA1()) == 0);
- assert(dynamic_cast<A3*>(a2.getA2()) == 0);
- assert(dynamic_cast<A3*>(a3.getA1()) == a3.getA3());
- assert(dynamic_cast<A3*>(a3.getA2()) == a3.getA3());
- assert(dynamic_cast<A3*>(a3.getA3()) == a3.getA3());
- assert(dynamic_cast<A3*>(a4.getA1()) == 0);
- assert(dynamic_cast<A3*>(a4.getA2()) == 0);
- assert(dynamic_cast<A3*>(a4.getA4()) == 0);
- assert(dynamic_cast<A3*>(a5.getA14()) == 0);
- assert(dynamic_cast<A3*>(a5.getA13()) == a5.getA3());
- assert(dynamic_cast<A3*>(a5.getA2()) == a5.getA3());
- assert(dynamic_cast<A3*>(a5.getA3()) == a5.getA3());
- assert(dynamic_cast<A3*>(a5.getA4()) == 0);
- assert(dynamic_cast<A3*>(a5.getA5()) == a5.getA3());
-
- assert(dynamic_cast<A4*>(a1.getA1()) == 0);
- assert(dynamic_cast<A4*>(a2.getA2()) == 0);
- assert(dynamic_cast<A4*>(a3.getA1()) == 0);
- assert(dynamic_cast<A4*>(a3.getA2()) == 0);
- assert(dynamic_cast<A4*>(a3.getA3()) == 0);
- assert(dynamic_cast<A4*>(a4.getA1()) == a4.getA4());
- assert(dynamic_cast<A4*>(a4.getA2()) == a4.getA4());
- assert(dynamic_cast<A4*>(a4.getA4()) == a4.getA4());
- assert(dynamic_cast<A4*>(a5.getA14()) == a5.getA4());
- assert(dynamic_cast<A4*>(a5.getA13()) == 0);
- assert(dynamic_cast<A4*>(a5.getA2()) == a5.getA4());
- assert(dynamic_cast<A4*>(a5.getA3()) == 0);
- assert(dynamic_cast<A4*>(a5.getA4()) == a5.getA4());
-// assert(dynamic_cast<A4*>(a5.getA5()) == a5.getA4()); // cast to protected base
-
- assert(dynamic_cast<A5*>(a1.getA1()) == 0);
- assert(dynamic_cast<A5*>(a2.getA2()) == 0);
- assert(dynamic_cast<A5*>(a3.getA1()) == 0);
- assert(dynamic_cast<A5*>(a3.getA2()) == 0);
- assert(dynamic_cast<A5*>(a3.getA3()) == 0);
- assert(dynamic_cast<A5*>(a4.getA1()) == 0);
- assert(dynamic_cast<A5*>(a4.getA2()) == 0);
- assert(dynamic_cast<A5*>(a4.getA4()) == 0);
- assert(dynamic_cast<A5*>(a5.getA14()) == 0);
- assert(dynamic_cast<A5*>(a5.getA13()) == a5.getA5());
- assert(dynamic_cast<A5*>(a5.getA2()) == a5.getA5());
- assert(dynamic_cast<A5*>(a5.getA3()) == a5.getA5());
- assert(dynamic_cast<A5*>(a5.getA4()) == 0);
- assert(dynamic_cast<A5*>(a5.getA5()) == a5.getA5());
-}
-
-} // t9
-
-
-int main()
-{
- timer t;
- t1::test();
- t2::test();
- t3::test();
- t4::test();
- t5::test();
- t6::test();
- t7::test();
- t8::test();
- t9::test();
-}
Removed: libcxxabi/trunk/test/dynamic_cast_stress.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/dynamic_cast_stress.cpp?rev=226690&view=auto
==============================================================================
--- libcxxabi/trunk/test/dynamic_cast_stress.cpp (original)
+++ libcxxabi/trunk/test/dynamic_cast_stress.cpp (removed)
@@ -1,79 +0,0 @@
-//===------------------------- dynamic_cast_stress.cpp --------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include <cassert>
-#include <tuple>
-#include "support/timer.hpp"
-
-template <std::size_t Indx, std::size_t Depth>
-struct C
- : public virtual C<Indx, Depth-1>,
- public virtual C<Indx+1, Depth-1>
-{
- virtual ~C() {}
-};
-
-template <std::size_t Indx>
-struct C<Indx, 0>
-{
- virtual ~C() {}
-};
-
-template <std::size_t Indx, std::size_t Depth>
-struct B
- : public virtual C<Indx, Depth-1>,
- public virtual C<Indx+1, Depth-1>
-{
-};
-
-template <class Indx, std::size_t Depth>
-struct makeB;
-
-template <std::size_t ...Indx, std::size_t Depth>
-struct makeB<std::__tuple_indices<Indx...>, Depth>
- : public B<Indx, Depth>...
-{
-};
-
-template <std::size_t Width, std::size_t Depth>
-struct A
- : public makeB<typename std::__make_tuple_indices<Width>::type, Depth>
-{
-};
-
-void test()
-{
- const std::size_t Width = 10;
- const std::size_t Depth = 5;
- A<Width, Depth> a;
- typedef B<Width/2, Depth> Destination;
-// typedef A<Width, Depth> Destination;
- Destination *b = nullptr;
- {
- timer t;
- b = dynamic_cast<Destination*>((C<Width/2, 0>*)&a);
- }
- assert(b != 0);
-}
-
-int main()
-{
- test();
-}
-
-/*
-Timing results I'm seeing (median of 3 microseconds):
-
- libc++abi gcc's dynamic_cast
-B<Width/2, Depth> -O3 48.334 93.190 libc++abi 93% faster
-B<Width/2, Depth> -Os 58.535 94.103 libc++abi 61% faster
-A<Width, Depth> -O3 11.515 33.134 libc++abi 188% faster
-A<Width, Depth> -Os 12.631 31.553 libc++abi 150% faster
-
-*/
Removed: libcxxabi/trunk/test/inherited_exception.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/inherited_exception.cpp?rev=226690&view=auto
==============================================================================
--- libcxxabi/trunk/test/inherited_exception.cpp (original)
+++ libcxxabi/trunk/test/inherited_exception.cpp (removed)
@@ -1,165 +0,0 @@
-//===--------------------- inherited_exception.cpp ------------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This test case checks specifically the cases under C++ ABI 15.3.1, and 15.3.2
-//
-// C++ ABI 15.3:
-// A handler is a match for an exception object of type E if
-// / * The handler is of type cv T or cv T& and E and T are the same type \
-// | (ignoring the top-level cv-qualifiers), or |
-// | * the handler is of type cv T or cv T& and T is an unambiguous base |
-// \ class of E, or /
-// * the handler is of type cv1 T* cv2 and E is a pointer type that can
-// be converted to the type of the handler by either or both of
-// o a standard pointer conversion (4.10 [conv.ptr]) not involving
-// conversions to private or protected or ambiguous classes
-// o a qualification conversion
-// * the handler is a pointer or pointer to member type and E is
-// std::nullptr_t
-//
-//===----------------------------------------------------------------------===//
-
-#include <assert.h>
-
-struct Base {
- int b1;
-};
-
-struct Base2 {
- int b2;
-};
-
-struct Child : public Base, public Base2 {
- int c;
-};
-
-void f1() {
- Child child;
- child.b1 = 10;
- child.b2 = 11;
- child.c = 12;
- throw child;
-}
-
-void f2() {
- Child child;
- child.b1 = 10;
- child.b2 = 11;
- child.c = 12;
- throw static_cast<Base2&>(child);
-}
-
-void f3() {
- static Child child;
- child.b1 = 10;
- child.b2 = 11;
- child.c = 12;
- throw static_cast<Base2*>(&child);
-}
-
-int main()
-{
- try
- {
- f1();
- assert(false);
- }
- catch (const Child& c)
- {
- assert(true);
- }
- catch (const Base& b)
- {
- assert(false);
- }
- catch (...)
- {
- assert(false);
- }
-
- try
- {
- f1();
- assert(false);
- }
- catch (const Base& c)
- {
- assert(true);
- }
- catch (const Child& b)
- {
- assert(false);
- }
- catch (...)
- {
- assert(false);
- }
-
- try
- {
- f1();
- assert(false);
- }
- catch (const Base2& c)
- {
- assert(true);
- }
- catch (const Child& b)
- {
- assert(false);
- }
- catch (...)
- {
- assert(false);
- }
-
- try
- {
- f2();
- assert(false);
- }
- catch (const Child& c)
- {
- assert(false);
- }
- catch (const Base& b)
- {
- assert(false);
- }
- catch (const Base2& b)
- {
- assert(true);
- }
- catch (...)
- {
- assert(false);
- }
-
- try
- {
- f3();
- assert(false);
- }
- catch (const Base* c)
- {
- assert(false);
- }
- catch (const Child* b)
- {
- assert(false);
- }
- catch (const Base2* c)
- {
- assert(true);
- }
- catch (...)
- {
- assert(false);
- }
-}
Removed: libcxxabi/trunk/test/test_aux_runtime.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/test_aux_runtime.cpp?rev=226690&view=auto
==============================================================================
--- libcxxabi/trunk/test/test_aux_runtime.cpp (original)
+++ libcxxabi/trunk/test/test_aux_runtime.cpp (removed)
@@ -1,64 +0,0 @@
-//===-------------------------- test_aux_runtime.cpp ----------------------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include <typeinfo>
-#include <iostream>
-
-// Test taken from 5.2.8.2
-// When typeid is applied to a glvalue expression whose type is a polymorphic
-// class type, (10.3), the result refers to a std::type_info object
-// representing the type of the most derived object (1.8) (that is, the
-// dynamic type) to which the glvalue refers. If the glvalue expression is
-// obtained by applying the unary * operator to a pointer(68) and the pointer
-// is a null pointer value (4.10), the typeid expression throws the
-// std::bad_typeid exception (18.7.3).
-//
-// 68) If p is an expression of pointer type, then *p, (*p), *(p),
-// ((*p)), *((p)), and so on all meet this requirement.
-bool bad_typeid_test () {
- class A { virtual void f() {}};
- class B { virtual void g() {}};
-
- B *bp = NULL;
- try {bool b = typeid(*bp) == typeid (A); }
- catch ( const std::bad_typeid &bc ) { return true; }
- return false;
- }
-
-
-// The value of a failed cast to pointer type is the null pointer value of
-// the required result type. A failed cast to reference type throws
-// std::bad_cast (18.7.2).
-bool bad_cast_test () {
- class A { virtual void f() {}};
- class B { virtual void g() {}};
- class D : public virtual A, private B {};
-
- D d;
- B *bp = (B*)&d; // cast needed to break protection
- try { D &dr = dynamic_cast<D&> (*bp); }
- catch ( const std::bad_cast &bc ) { return true; }
- return false;
- }
-
-int main ( int argc, char *argv [] ) {
- int ret_val = 0;
-
- if ( !bad_typeid_test ()) {
- std::cerr << "TypeID test failed!" << std::endl;
- ret_val = 1;
- }
-
- if ( !bad_cast_test ()) {
- std::cerr << "Bad cast test failed!" << std::endl;
- ret_val = 1;
- }
-
- return ret_val;
- }
Removed: libcxxabi/trunk/test/test_aux_runtime_op_array_new.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/test/test_aux_runtime_op_array_new.cpp?rev=226690&view=auto
==============================================================================
--- libcxxabi/trunk/test/test_aux_runtime_op_array_new.cpp (original)
+++ libcxxabi/trunk/test/test_aux_runtime_op_array_new.cpp (removed)
@@ -1,38 +0,0 @@
-//===-------------------------- test_aux_runtime_op_array_new.cpp ---------===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include <iostream>
-#include <cxxabi.h>
-
-// If the expression passed to operator new[] would result in an overflow, the
-// allocation function is not called, and a std::bad_array_new_length exception
-// is thrown instead (5.3.4p7).
-bool bad_array_new_length_test() {
- try {
- // We test this directly because Clang does not currently codegen the
- // correct call to __cxa_bad_array_new_length, so this test would result
- // in passing -1 to ::operator new[], which would then throw a
- // std::bad_alloc, causing the test to fail.
- __cxxabiv1::__cxa_throw_bad_array_new_length();
- } catch ( const std::bad_array_new_length &banl ) {
- return true;
- }
- return false;
-}
-
-int main(int argc, char *argv []) {
- int ret_val = 0;
-
- if ( !bad_array_new_length_test ()) {
- std::cerr << "Bad array new length test failed!" << std::endl;
- ret_val = 1;
- }
-
- return ret_val;
-}
More information about the cfe-commits
mailing list