aboutsummaryrefslogtreecommitdiff
path: root/final/ABI-Testsuite/test/s2_9
diff options
context:
space:
mode:
Diffstat (limited to 'final/ABI-Testsuite/test/s2_9')
-rwxr-xr-xfinal/ABI-Testsuite/test/s2_9/builtin_bool.xpp21
-rwxr-xr-xfinal/ABI-Testsuite/test/s2_9/builtin_char.xpp21
-rwxr-xr-xfinal/ABI-Testsuite/test/s2_9/builtin_double.xpp21
-rwxr-xr-xfinal/ABI-Testsuite/test/s2_9/builtin_float.xpp21
-rwxr-xr-xfinal/ABI-Testsuite/test/s2_9/builtin_int.xpp21
-rwxr-xr-xfinal/ABI-Testsuite/test/s2_9/builtin_long.xpp21
-rwxr-xr-xfinal/ABI-Testsuite/test/s2_9/builtin_long_double.xpp21
-rwxr-xr-xfinal/ABI-Testsuite/test/s2_9/builtin_long_long.xpp21
-rwxr-xr-xfinal/ABI-Testsuite/test/s2_9/builtin_short.xpp21
-rwxr-xr-xfinal/ABI-Testsuite/test/s2_9/builtin_signed_char.xpp21
-rwxr-xr-xfinal/ABI-Testsuite/test/s2_9/builtin_unsigned_char.xpp21
-rwxr-xr-xfinal/ABI-Testsuite/test/s2_9/builtin_unsigned_int.xpp21
-rwxr-xr-xfinal/ABI-Testsuite/test/s2_9/builtin_unsigned_long.xpp21
-rwxr-xr-xfinal/ABI-Testsuite/test/s2_9/builtin_unsigned_long_long.xpp21
-rwxr-xr-xfinal/ABI-Testsuite/test/s2_9/builtin_unsigned_short.xpp21
-rwxr-xr-xfinal/ABI-Testsuite/test/s2_9/builtin_void.xpp23
-rwxr-xr-xfinal/ABI-Testsuite/test/s2_9/builtin_wchar_t.xpp21
-rwxr-xr-xfinal/ABI-Testsuite/test/s2_9/dynamic_cast_algorithm.xpp140
-rwxr-xr-xfinal/ABI-Testsuite/test/s2_9/non_virtual.xpp18
-rwxr-xr-xfinal/ABI-Testsuite/test/s2_9/virtual.xpp18
20 files changed, 535 insertions, 0 deletions
diff --git a/final/ABI-Testsuite/test/s2_9/builtin_bool.xpp b/final/ABI-Testsuite/test/s2_9/builtin_bool.xpp
new file mode 100755
index 00000000..a0fecc43
--- /dev/null
+++ b/final/ABI-Testsuite/test/s2_9/builtin_bool.xpp
@@ -0,0 +1,21 @@
+// This file is distributed under the University of Illinois Open Source License.
+// See LICENSE.TXT for details.
+// RUN: cxx_compiler -c cxx_rtti cxx_exceptions %s -o %t.o
+// RUN: linker %t.o -o %t%exeext
+// RUN: bindump %t.o| FileCheck %s
+
+// Test run-time library includes support for builtin type "bool"
+
+bool global_var = true;
+bool const *global_ptr;
+
+// CHECK-DAG: _ZTIb
+void foo1() { throw global_var; }
+// CHECK-DAG: _ZTIPb
+void foo2() { throw &global_var; }
+// CHECK-DAG: _ZTIPKb
+void foo3() { throw global_ptr; }
+
+int main(int argc, char *argv[]) {
+ return 0;
+}
diff --git a/final/ABI-Testsuite/test/s2_9/builtin_char.xpp b/final/ABI-Testsuite/test/s2_9/builtin_char.xpp
new file mode 100755
index 00000000..d4416e0f
--- /dev/null
+++ b/final/ABI-Testsuite/test/s2_9/builtin_char.xpp
@@ -0,0 +1,21 @@
+// This file is distributed under the University of Illinois Open Source License.
+// See LICENSE.TXT for details.
+// RUN: cxx_compiler -c cxx_rtti cxx_exceptions %s -o %t.o
+// RUN: linker %t.o -o %t%exeext
+// RUN: bindump %t.o| FileCheck %s
+
+// Test run-time library includes support for builtin type "char"
+
+char global_var = 'a';
+char const *global_ptr;
+
+// CHECK-DAG: _ZTIc
+void foo1() { throw global_var; }
+// CHECK-DAG: _ZTIPc
+void foo2() { throw &global_var; }
+// CHECK-DAG: _ZTIPKc
+void foo3() { throw global_ptr; }
+
+int main(int argc, char *argv[]) {
+ return 0;
+}
diff --git a/final/ABI-Testsuite/test/s2_9/builtin_double.xpp b/final/ABI-Testsuite/test/s2_9/builtin_double.xpp
new file mode 100755
index 00000000..314926a2
--- /dev/null
+++ b/final/ABI-Testsuite/test/s2_9/builtin_double.xpp
@@ -0,0 +1,21 @@
+// This file is distributed under the University of Illinois Open Source License.
+// See LICENSE.TXT for details.
+// RUN: cxx_compiler -c cxx_rtti cxx_exceptions %s -o %t.o
+// RUN: linker %t.o -o %t%exeext
+// RUN: bindump %t.o| FileCheck %s
+
+// Test run-time library includes support for builtin type "double"
+
+double global_var = 123.456;
+double const *global_ptr;
+
+// CHECK-DAG: _ZTId
+void foo1() { throw global_var; }
+// CHECK-DAG: _ZTIPd
+void foo2() { throw &global_var; }
+// CHECK-DAG: _ZTIPKd
+void foo3() { throw global_ptr; }
+
+int main(int argc, char *argv[]) {
+ return 0;
+}
diff --git a/final/ABI-Testsuite/test/s2_9/builtin_float.xpp b/final/ABI-Testsuite/test/s2_9/builtin_float.xpp
new file mode 100755
index 00000000..8aa1a8c3
--- /dev/null
+++ b/final/ABI-Testsuite/test/s2_9/builtin_float.xpp
@@ -0,0 +1,21 @@
+// This file is distributed under the University of Illinois Open Source License.
+// See LICENSE.TXT for details.
+// RUN: cxx_compiler -c cxx_rtti cxx_exceptions %s -o %t.o
+// RUN: linker %t.o -o %t%exeext
+// RUN: bindump %t.o| FileCheck %s
+
+// Test run-time library includes support for builtin type "float"
+
+float global_var = 1.5f;
+float const *global_ptr;
+
+// CHECK-DAG: _ZTIf
+void foo1() { throw global_var; }
+// CHECK-DAG: _ZTIPf
+void foo2() { throw &global_var; }
+// CHECK-DAG: _ZTIPKf
+void foo3() { throw global_ptr; }
+
+int main(int argc, char *argv[]) {
+ return 0;
+}
diff --git a/final/ABI-Testsuite/test/s2_9/builtin_int.xpp b/final/ABI-Testsuite/test/s2_9/builtin_int.xpp
new file mode 100755
index 00000000..d8de1d18
--- /dev/null
+++ b/final/ABI-Testsuite/test/s2_9/builtin_int.xpp
@@ -0,0 +1,21 @@
+// This file is distributed under the University of Illinois Open Source License.
+// See LICENSE.TXT for details.
+// RUN: cxx_compiler -c cxx_rtti cxx_exceptions %s -o %t.o
+// RUN: linker %t.o -o %t%exeext
+// RUN: bindump %t.o| FileCheck %s
+
+// Test run-time library includes support for builtin type "int"
+
+int global_var = 5;
+int const *global_ptr;
+
+// CHECK-DAG: _ZTIi
+void foo1() { throw global_var; }
+// CHECK-DAG: _ZTIPi
+void foo2() { throw &global_var; }
+// CHECK-DAG: _ZTIPKi
+void foo3() { throw global_ptr; }
+
+int main(int argc, char *argv[]) {
+ return 0;
+}
diff --git a/final/ABI-Testsuite/test/s2_9/builtin_long.xpp b/final/ABI-Testsuite/test/s2_9/builtin_long.xpp
new file mode 100755
index 00000000..c5c4de50
--- /dev/null
+++ b/final/ABI-Testsuite/test/s2_9/builtin_long.xpp
@@ -0,0 +1,21 @@
+// This file is distributed under the University of Illinois Open Source License.
+// See LICENSE.TXT for details.
+// RUN: cxx_compiler -c cxx_rtti cxx_exceptions %s -o %t.o
+// RUN: linker %t.o -o %t%exeext
+// RUN: bindump %t.o| FileCheck %s
+
+// Test run-time library includes support for builtin type "long"
+
+long global_var = 5;
+long const *global_ptr;
+
+// CHECK-DAG: _ZTIl
+void foo1() { throw global_var; }
+// CHECK-DAG: _ZTIPl
+void foo2() { throw &global_var; }
+// CHECK-DAG: _ZTIPKl
+void foo3() { throw global_ptr; }
+
+int main(int argc, char *argv[]) {
+ return 0;
+}
diff --git a/final/ABI-Testsuite/test/s2_9/builtin_long_double.xpp b/final/ABI-Testsuite/test/s2_9/builtin_long_double.xpp
new file mode 100755
index 00000000..dad569a7
--- /dev/null
+++ b/final/ABI-Testsuite/test/s2_9/builtin_long_double.xpp
@@ -0,0 +1,21 @@
+// This file is distributed under the University of Illinois Open Source License.
+// See LICENSE.TXT for details.
+// RUN: cxx_compiler -c cxx_rtti cxx_exceptions %s -o %t.o
+// RUN: linker %t.o -o %t%exeext
+// RUN: bindump %t.o| FileCheck %s
+
+// Test run-time library includes support for builtin type "long double"
+
+long double global_var = 123.456;
+long double const *global_ptr;
+
+// CHECK-DAG: _ZTIe
+void foo1() { throw global_var; }
+// CHECK-DAG: _ZTIPe
+void foo2() { throw &global_var; }
+// CHECK-DAG: _ZTIPKe
+void foo3() { throw global_ptr; }
+
+int main(int argc, char *argv[]) {
+ return 0;
+}
diff --git a/final/ABI-Testsuite/test/s2_9/builtin_long_long.xpp b/final/ABI-Testsuite/test/s2_9/builtin_long_long.xpp
new file mode 100755
index 00000000..b6536138
--- /dev/null
+++ b/final/ABI-Testsuite/test/s2_9/builtin_long_long.xpp
@@ -0,0 +1,21 @@
+// This file is distributed under the University of Illinois Open Source License.
+// See LICENSE.TXT for details.
+// RUN: cxx_compiler -c cxx_rtti cxx_exceptions %s -o %t.o
+// RUN: linker %t.o -o %t%exeext
+// RUN: bindump %t.o| FileCheck %s
+
+// Test run-time library includes support for builtin type "long long"
+
+long long global_var = 5;
+long long const *global_ptr;
+
+// CHECK-DAG: _ZTIx
+void foo1() { throw global_var; }
+// CHECK-DAG: _ZTIPx
+void foo2() { throw &global_var; }
+// CHECK-DAG: _ZTIPKx
+void foo3() { throw global_ptr; }
+
+int main(int argc, char *argv[]) {
+ return 0;
+}
diff --git a/final/ABI-Testsuite/test/s2_9/builtin_short.xpp b/final/ABI-Testsuite/test/s2_9/builtin_short.xpp
new file mode 100755
index 00000000..57302d0f
--- /dev/null
+++ b/final/ABI-Testsuite/test/s2_9/builtin_short.xpp
@@ -0,0 +1,21 @@
+// This file is distributed under the University of Illinois Open Source License.
+// See LICENSE.TXT for details.
+// RUN: cxx_compiler -c cxx_rtti cxx_exceptions %s -o %t.o
+// RUN: linker %t.o -o %t%exeext
+// RUN: bindump %t.o| FileCheck %s
+
+// Test run-time library includes support for builtin type "short"
+
+short global_var = 10;
+short const *global_ptr;
+
+// CHECK-DAG: _ZTIs
+void foo1() { throw global_var; }
+// CHECK-DAG: _ZTIPs
+void foo2() { throw &global_var; }
+// CHECK-DAG: _ZTIPKs
+void foo3() { throw global_ptr; }
+
+int main(int argc, char *argv[]) {
+ return 0;
+}
diff --git a/final/ABI-Testsuite/test/s2_9/builtin_signed_char.xpp b/final/ABI-Testsuite/test/s2_9/builtin_signed_char.xpp
new file mode 100755
index 00000000..d14308fe
--- /dev/null
+++ b/final/ABI-Testsuite/test/s2_9/builtin_signed_char.xpp
@@ -0,0 +1,21 @@
+// This file is distributed under the University of Illinois Open Source License.
+// See LICENSE.TXT for details.
+// RUN: cxx_compiler -c cxx_rtti cxx_exceptions %s -o %t.o
+// RUN: linker %t.o -o %t%exeext
+// RUN: bindump %t.o| FileCheck %s
+
+// Test run-time library includes support for builtin type "signed char"
+
+signed char global_var = 'a';
+signed char const *global_ptr;
+
+// CHECK-DAG: _ZTIa
+void foo1() { throw global_var; }
+// CHECK-DAG: _ZTIPa
+void foo2() { throw &global_var; }
+// CHECK-DAG: _ZTIPKa
+void foo3() { throw global_ptr; }
+
+int main(int argc, char *argv[]) {
+ return 0;
+}
diff --git a/final/ABI-Testsuite/test/s2_9/builtin_unsigned_char.xpp b/final/ABI-Testsuite/test/s2_9/builtin_unsigned_char.xpp
new file mode 100755
index 00000000..2c736dfe
--- /dev/null
+++ b/final/ABI-Testsuite/test/s2_9/builtin_unsigned_char.xpp
@@ -0,0 +1,21 @@
+// This file is distributed under the University of Illinois Open Source License.
+// See LICENSE.TXT for details.
+// RUN: cxx_compiler -c cxx_rtti cxx_exceptions %s -o %t.o
+// RUN: linker %t.o -o %t%exeext
+// RUN: bindump %t.o| FileCheck %s
+
+// Test run-time library includes support for builtin type "unsigned char"
+
+unsigned char global_var = 'a';
+unsigned char const *global_ptr;
+
+// CHECK-DAG: _ZTIh
+void foo1() { throw global_var; }
+// CHECK-DAG: _ZTIPh
+void foo2() { throw &global_var; }
+// CHECK-DAG: _ZTIPKh
+void foo3() { throw global_ptr; }
+
+int main(int argc, char *argv[]) {
+ return 0;
+}
diff --git a/final/ABI-Testsuite/test/s2_9/builtin_unsigned_int.xpp b/final/ABI-Testsuite/test/s2_9/builtin_unsigned_int.xpp
new file mode 100755
index 00000000..05d956dc
--- /dev/null
+++ b/final/ABI-Testsuite/test/s2_9/builtin_unsigned_int.xpp
@@ -0,0 +1,21 @@
+// This file is distributed under the University of Illinois Open Source License.
+// See LICENSE.TXT for details.
+// RUN: cxx_compiler -c cxx_rtti cxx_exceptions %s -o %t.o
+// RUN: linker %t.o -o %t%exeext
+// RUN: bindump %t.o| FileCheck %s
+
+// Test run-time library includes support for builtin type "unsigned int"
+
+unsigned int global_var = 5;
+unsigned int const *global_ptr;
+
+// CHECK-DAG: _ZTIj
+void foo1() { throw global_var; }
+// CHECK-DAG: _ZTIPj
+void foo2() { throw &global_var; }
+// CHECK-DAG: _ZTIPKj
+void foo3() { throw global_ptr; }
+
+int main(int argc, char *argv[]) {
+ return 0;
+}
diff --git a/final/ABI-Testsuite/test/s2_9/builtin_unsigned_long.xpp b/final/ABI-Testsuite/test/s2_9/builtin_unsigned_long.xpp
new file mode 100755
index 00000000..81dc135f
--- /dev/null
+++ b/final/ABI-Testsuite/test/s2_9/builtin_unsigned_long.xpp
@@ -0,0 +1,21 @@
+// This file is distributed under the University of Illinois Open Source License.
+// See LICENSE.TXT for details.
+// RUN: cxx_compiler -c cxx_rtti cxx_exceptions %s -o %t.o
+// RUN: linker %t.o -o %t%exeext
+// RUN: bindump %t.o| FileCheck %s
+
+// Test run-time library includes support for builtin type "unsigned long"
+
+unsigned long global_var = 5;
+unsigned long const *global_ptr;
+
+// CHECK-DAG: _ZTIm
+void foo1() { throw global_var; }
+// CHECK-DAG: _ZTIPm
+void foo2() { throw &global_var; }
+// CHECK-DAG: _ZTIPKm
+void foo3() { throw global_ptr; }
+
+int main(int argc, char *argv[]) {
+ return 0;
+}
diff --git a/final/ABI-Testsuite/test/s2_9/builtin_unsigned_long_long.xpp b/final/ABI-Testsuite/test/s2_9/builtin_unsigned_long_long.xpp
new file mode 100755
index 00000000..846c46ab
--- /dev/null
+++ b/final/ABI-Testsuite/test/s2_9/builtin_unsigned_long_long.xpp
@@ -0,0 +1,21 @@
+// This file is distributed under the University of Illinois Open Source License.
+// See LICENSE.TXT for details.
+// RUN: cxx_compiler -c cxx_rtti cxx_exceptions %s -o %t.o
+// RUN: linker %t.o -o %t%exeext
+// RUN: bindump %t.o| FileCheck %s
+
+// Test run-time library includes support for builtin type "unsigned long long"
+
+unsigned long long global_var = 5;
+unsigned long long const *global_ptr;
+
+// CHECK-DAG: _ZTIy
+void foo1() { throw global_var; }
+// CHECK-DAG: _ZTIPy
+void foo2() { throw &global_var; }
+// CHECK-DAG: _ZTIPKy
+void foo3() { throw global_ptr; }
+
+int main(int argc, char *argv[]) {
+ return 0;
+}
diff --git a/final/ABI-Testsuite/test/s2_9/builtin_unsigned_short.xpp b/final/ABI-Testsuite/test/s2_9/builtin_unsigned_short.xpp
new file mode 100755
index 00000000..9e7cc115
--- /dev/null
+++ b/final/ABI-Testsuite/test/s2_9/builtin_unsigned_short.xpp
@@ -0,0 +1,21 @@
+// This file is distributed under the University of Illinois Open Source License.
+// See LICENSE.TXT for details.
+// RUN: cxx_compiler -c cxx_rtti cxx_exceptions %s -o %t.o
+// RUN: linker %t.o -o %t%exeext
+// RUN: bindump %t.o| FileCheck %s
+
+// Test run-time library includes support for builtin type "unsigned short"
+
+unsigned short global_var = 10;
+unsigned short const *global_ptr;
+
+// CHECK-DAG: _ZTIt
+void foo1() { throw global_var; }
+// CHECK-DAG: _ZTIPt
+void foo2() { throw &global_var; }
+// CHECK-DAG: _ZTIPKt
+void foo3() { throw global_ptr; }
+
+int main(int argc, char *argv[]) {
+ return 0;
+}
diff --git a/final/ABI-Testsuite/test/s2_9/builtin_void.xpp b/final/ABI-Testsuite/test/s2_9/builtin_void.xpp
new file mode 100755
index 00000000..5a31d548
--- /dev/null
+++ b/final/ABI-Testsuite/test/s2_9/builtin_void.xpp
@@ -0,0 +1,23 @@
+// This file is distributed under the University of Illinois Open Source License.
+// See LICENSE.TXT for details.
+// RUN: cxx_compiler -c cxx_rtti cxx_exceptions %s -o %t.o
+// RUN: linker %t.o -o %t%exeext
+// RUN: bindump %t.o| FileCheck %s
+
+#include <typeinfo>
+
+// Test run-time library includes support for builtin type "void"
+
+int global_int = 10;
+void const *global_ptr;
+
+// CHECK-DAG: _ZTIv
+const std::type_info &foo1() { const std::type_info &t = typeid(void); return t; }
+// CHECK-DAG: _ZTIPv
+void foo2() { throw (void *)&global_int; }
+// CHECK-DAG: _ZTIPKv
+void foo3() { try { foo2(); } catch(void const *p) { } }
+
+int main(int argc, char *argv[]) {
+ return 0;
+}
diff --git a/final/ABI-Testsuite/test/s2_9/builtin_wchar_t.xpp b/final/ABI-Testsuite/test/s2_9/builtin_wchar_t.xpp
new file mode 100755
index 00000000..018c9752
--- /dev/null
+++ b/final/ABI-Testsuite/test/s2_9/builtin_wchar_t.xpp
@@ -0,0 +1,21 @@
+// This file is distributed under the University of Illinois Open Source License.
+// See LICENSE.TXT for details.
+// RUN: cxx_compiler -c cxx_rtti cxx_exceptions %s -o %t.o
+// RUN: linker %t.o -o %t%exeext
+// RUN: bindump %t.o| FileCheck %s
+
+// Test run-time library includes support for builtin type "wchar_t"
+
+wchar_t global_var = true;
+wchar_t const *global_ptr;
+
+// CHECK-DAG: _ZTIw
+void foo1() { throw global_var; }
+// CHECK-DAG: _ZTIPw
+void foo2() { throw &global_var; }
+// CHECK-DAG: _ZTIPKw
+void foo3() { throw global_ptr; }
+
+int main(int argc, char *argv[]) {
+ return 0;
+}
diff --git a/final/ABI-Testsuite/test/s2_9/dynamic_cast_algorithm.xpp b/final/ABI-Testsuite/test/s2_9/dynamic_cast_algorithm.xpp
new file mode 100755
index 00000000..a1d09db4
--- /dev/null
+++ b/final/ABI-Testsuite/test/s2_9/dynamic_cast_algorithm.xpp
@@ -0,0 +1,140 @@
+// This file is distributed under the University of Illinois Open Source License.
+// See LICENSE.TXT for details.
+// RUN: cxx_compiler -c cxx_rtti %s -o %t.o
+// RUN: linker %t.o -o %t%exeext
+// RUN: runtool %t%exeext | grep "Test passed"
+
+#include <stdio.h>
+
+// Direct inheritance
+struct A1 { virtual ~A1() {} };
+struct B1 : A1 { };
+
+A1 A1_obj;
+B1 B1_obj;
+
+struct A2 { virtual ~A2() {} };
+struct B2 : A2 { };
+struct C2 : A2 { };
+
+A2 A2_obj;
+B2 B2_obj;
+C2 C2_obj;
+
+// Virtual inheritance
+struct A3 { virtual ~A3() {} };
+struct B3 : virtual A3 { };
+
+A3 A3_obj;
+B3 B3_obj;
+
+struct A4 { virtual ~A4() {} };
+struct B4 : virtual A4 { };
+struct C4 : A4 { };
+
+A4 A4_obj;
+B4 B4_obj;
+C4 C4_obj;
+
+struct A5 { virtual ~A5() {} };
+struct B5 : A5 { };
+struct C5 : virtual A5 { };
+
+A5 A5_obj;
+B5 B5_obj;
+C5 C5_obj;
+
+struct A6 { virtual ~A6() {} };
+struct B6 : virtual A6 { };
+struct C6 : virtual A6 { };
+
+A6 A6_obj;
+B6 B6_obj;
+C6 C6_obj;
+
+struct A7 { virtual ~A7() {} };
+struct B7_1 : A7 { };
+struct B7_2 : A7 { };
+struct C7 : B7_1, B7_2 { };
+
+A7 A7_obj;
+B7_1 B7_1_obj;
+B7_2 B7_2_obj;
+C7 C7_obj;
+
+int failed_tests = 0;
+
+void base_to_derived_cast() {
+ A1 *A1_ptr = &B1_obj;
+ B1 *B1_ptr = dynamic_cast<B1 *>(A1_ptr);
+ if(!B1_ptr) { printf("Test failed %s:%d\n", __FILE__, __LINE__); failed_tests++; }
+
+ A2 *A2_ptr1 = &B2_obj, *A2_ptr2 = &C2_obj;
+ B2 *B2_ptr = dynamic_cast<B2 *>(A2_ptr1);
+ C2 *C2_ptr = dynamic_cast<C2 *>(A2_ptr2);
+ if(!B2_ptr) { printf("Test failed %s:%d\n", __FILE__, __LINE__); failed_tests++; }
+ if(!C2_ptr) { printf("Test failed %s:%d\n", __FILE__, __LINE__); failed_tests++; }
+
+ A3 *A3_ptr = &B3_obj;
+ B3 *B3_ptr = dynamic_cast<B3 *>(A3_ptr);
+ if(!B3_ptr) { printf("Test failed %s:%d\n", __FILE__, __LINE__); failed_tests++; }
+
+ A4 *A4_ptr1 = &B4_obj, *A4_ptr2 = &C4_obj;
+ B4 *B4_ptr = dynamic_cast<B4 *>(A4_ptr1);
+ C4 *C4_ptr = dynamic_cast<C4 *>(A4_ptr2);
+ if(!B4_ptr) { printf("Test failed %s:%d\n", __FILE__, __LINE__); failed_tests++; }
+ if(!C4_ptr) { printf("Test failed %s:%d\n", __FILE__, __LINE__); failed_tests++; }
+
+ A5 *A5_ptr1 = &B5_obj, *A5_ptr2 = &C5_obj;
+ B5 *B5_ptr = dynamic_cast<B5 *>(A5_ptr1);
+ C5 *C5_ptr = dynamic_cast<C5 *>(A5_ptr2);
+ if(!B5_ptr) { printf("Test failed %s:%d\n", __FILE__, __LINE__); failed_tests++; }
+ if(!C5_ptr) { printf("Test failed %s:%d\n", __FILE__, __LINE__); failed_tests++; }
+
+ A6 *A6_ptr1 = &B6_obj, *A6_ptr2 = &C6_obj;
+ B6 *B6_ptr = dynamic_cast<B6 *>(A6_ptr1);
+ C6 *C6_ptr = dynamic_cast<C6 *>(A6_ptr2);
+ if(!B6_ptr) { printf("Test failed %s:%d\n", __FILE__, __LINE__); failed_tests++; }
+ if(!C6_ptr) { printf("Test failed %s:%d\n", __FILE__, __LINE__); failed_tests++; }
+}
+
+void cross_cast() {
+ C7* C7_ptr = &C7_obj;
+ B7_1 *B7_1_ptr = dynamic_cast<B7_1 *>(C7_ptr);
+ B7_2 *B7_2_ptr = dynamic_cast<B7_2 *>(C7_ptr);
+
+ if(!B7_1_ptr) { printf("Test failed %s:%d\n", __FILE__, __LINE__); failed_tests++; }
+ if(!B7_2_ptr) { printf("Test failed %s:%d\n", __FILE__, __LINE__); failed_tests++; }
+
+ B7_1 *cc1 = dynamic_cast<B7_1 *>(B7_2_ptr);
+ B7_2 *cc2 = dynamic_cast<B7_2 *>(B7_1_ptr);
+
+ if(!cc1) { printf("Test failed %s:%d\n", __FILE__, __LINE__); failed_tests++; }
+ if(!cc2) { printf("Test failed %s:%d\n", __FILE__, __LINE__); failed_tests++; }
+}
+
+void void_ptr_cast() {
+ C7* C7_ptr = &C7_obj;
+ B7_1 *B7_1_ptr = dynamic_cast<B7_1 *>(C7_ptr);
+ B7_2 *B7_2_ptr = dynamic_cast<B7_2 *>(C7_ptr);
+
+ if(!B7_1_ptr) { printf("Test failed %s:%d\n", __FILE__, __LINE__); failed_tests++; }
+ if(!B7_2_ptr) { printf("Test failed %s:%d\n", __FILE__, __LINE__); failed_tests++; }
+ if(!(dynamic_cast<void *>(B7_1_ptr) == dynamic_cast<void *>(B7_2_ptr))) { printf("Test failed %s:%d\n", __FILE__, __LINE__); failed_tests++; }
+}
+
+int main(int argc, char *argv[]) {
+ base_to_derived_cast();
+ cross_cast();
+ void_ptr_cast();
+
+ if(failed_tests > 0) {
+ printf("Test failed\n");
+ } else {
+ printf("Test passed\n");
+ }
+
+ printf("\x1a");
+
+ return 0;
+}
diff --git a/final/ABI-Testsuite/test/s2_9/non_virtual.xpp b/final/ABI-Testsuite/test/s2_9/non_virtual.xpp
new file mode 100755
index 00000000..16f2bed3
--- /dev/null
+++ b/final/ABI-Testsuite/test/s2_9/non_virtual.xpp
@@ -0,0 +1,18 @@
+// This file is distributed under the University of Illinois Open Source License.
+// See LICENSE.TXT for details.
+// RUN: cxx_compiler -c cxx_rtti cxx_exceptions %s -o %t.o
+// RUN: linker %t.o -o %t%exeext
+// RUN: bindump %t.o| FileCheck %s
+
+struct foo { };
+
+// Section 2.9.2
+// Check that the type-info was generated and no v-table was generated
+
+// CHECK-NOT: _ZTV3foo
+// CHECK-DAG: _ZTI3foo
+// CHECK-NOT: _ZTV3foo
+
+int main(int argc, char *argv[]) {
+ throw foo();
+}
diff --git a/final/ABI-Testsuite/test/s2_9/virtual.xpp b/final/ABI-Testsuite/test/s2_9/virtual.xpp
new file mode 100755
index 00000000..d2f1893c
--- /dev/null
+++ b/final/ABI-Testsuite/test/s2_9/virtual.xpp
@@ -0,0 +1,18 @@
+// This file is distributed under the University of Illinois Open Source License.
+// See LICENSE.TXT for details.
+// RUN: cxx_compiler -c cxx_rtti cxx_exceptions %s -o %t.o
+// RUN: linker %t.o -o %t%exeext
+// RUN: bindump %t.o| FileCheck %s
+
+struct foo { };
+struct bar : virtual foo { };
+
+// Section 2.9.2
+// Check that the type-info was generated and a v-table was generated
+
+// CHECK-DAG: _ZTV3bar
+// CHECK-DAG: _ZTI3bar
+
+int main(int argc, char *argv[]) {
+ throw bar();
+}