[test-suite] r214126 - ABI-Testsuite: Bulk of the testsuite

Sunil Srivastava sunil_srivastava at playstation.sony.com
Mon Jul 28 14:20:39 PDT 2014


Propchange: test-suite/trunk/ABI-Testsuite/test/s2_6/T_vf53.x
------------------------------------------------------------------------------
    svn:executable = *

Added: test-suite/trunk/ABI-Testsuite/test/s2_6/lit.local.cfg
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/ABI-Testsuite/test/s2_6/lit.local.cfg?rev=214126&view=auto
==============================================================================
--- test-suite/trunk/ABI-Testsuite/test/s2_6/lit.local.cfg (added)
+++ test-suite/trunk/ABI-Testsuite/test/s2_6/lit.local.cfg Mon Jul 28 16:20:34 2014
@@ -0,0 +1,3 @@
+# This file is distributed under the University of Illinois Open Source License.
+# See LICENSE.TXT for details.
+config.suffixes = ['.c']

Propchange: test-suite/trunk/ABI-Testsuite/test/s2_6/lit.local.cfg
------------------------------------------------------------------------------
    svn:executable = *

Added: test-suite/trunk/ABI-Testsuite/test/s2_7/test01.xpp
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/ABI-Testsuite/test/s2_7/test01.xpp?rev=214126&view=auto
==============================================================================
--- test-suite/trunk/ABI-Testsuite/test/s2_7/test01.xpp (added)
+++ test-suite/trunk/ABI-Testsuite/test/s2_7/test01.xpp Mon Jul 28 16:20:34 2014
@@ -0,0 +1,65 @@
+// This file is distributed under the University of Illinois Open Source License.
+// See LICENSE.TXT for details.
+// RUN: cxx_compiler cxx_11 %s -c -o %t.o
+// RUN: linker cxx_11 %t.o -o %t%exeext
+// RUN: runtool %t%exeext | grep "TEST PASSED"
+
+#include <stdio.h>
+#include <new>
+
+// No cookie required for a trivial object
+
+#define BUFF_SIZE 4096
+
+// Globals
+unsigned char alloc_buff[BUFF_SIZE];
+int new_calls = 0;
+int delete_calls = 0;
+
+void *operator new[](size_t size) { new_calls++; return alloc_buff; }
+void operator delete[](void *p) { delete_calls++; }
+
+struct trivial { };
+
+int new_test() {
+  int errors = 0;
+  trivial *ptr = new trivial[2];
+  
+  if((void *)ptr != (void *)alloc_buff) {
+    errors++;
+    printf("ERROR: new_test() pointers differ!\n");
+  }
+  
+  delete [] ptr;
+  
+  return errors;
+}
+
+int placement_new_test() {
+  int errors = 0;
+  trivial *ptr = new (alloc_buff) trivial[5];
+
+  if((void *)ptr != (void *)alloc_buff) {
+    errors++;
+    printf("ERROR: new_test() pointers differ!\n");
+  }
+  
+  return errors;
+}
+
+int main(int argc, char *argv[]) {
+  int retval = 0;
+  
+  retval += new_test();
+  retval += placement_new_test();
+  
+  if(retval) {
+    printf("TEST FAILED\n");
+    retval = 1;
+  } else {
+    printf("TEST PASSED\n");
+    retval = 0;
+  }
+
+  return retval;
+}

Propchange: test-suite/trunk/ABI-Testsuite/test/s2_7/test01.xpp
------------------------------------------------------------------------------
    svn:executable = *

Added: test-suite/trunk/ABI-Testsuite/test/s2_7/test02.xpp
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/ABI-Testsuite/test/s2_7/test02.xpp?rev=214126&view=auto
==============================================================================
--- test-suite/trunk/ABI-Testsuite/test/s2_7/test02.xpp (added)
+++ test-suite/trunk/ABI-Testsuite/test/s2_7/test02.xpp Mon Jul 28 16:20:34 2014
@@ -0,0 +1,97 @@
+// This file is distributed under the University of Illinois Open Source License.
+// See LICENSE.TXT for details.
+// RUN: cxx_compiler cxx_11 %s -c -o %t.o
+// RUN: linker cxx_11 %t.o -o %t%exeext
+// RUN: runtool %t%exeext | grep "TEST PASSED"
+// RUN: cxx_compiler cxx_11 %s -c -o %t.o -DEXTRAF=char
+// RUN: linker cxx_11 %t.o -o %t%exeext
+// RUN: runtool %t%exeext | grep "TEST PASSED"
+// RUN: cxx_compiler cxx_11 %s -c -o %t.o -DEXTRAF=short
+// RUN: linker cxx_11 %t.o -o %t%exeext
+// RUN: runtool %t%exeext | grep "TEST PASSED"
+// RUN: cxx_compiler cxx_11 %s -c -o %t.o -DEXTRAF=int
+// RUN: linker cxx_11 %t.o -o %t%exeext
+// RUN: runtool %t%exeext | grep "TEST PASSED"
+
+#include <stdio.h>
+#include <new>
+
+// No cookie required for placement new
+
+#define BUFF_SIZE 1024
+#define ARRAY_LENGTH 5
+
+// Globals
+unsigned char alloc_buff[BUFF_SIZE];
+int new_calls = 0;
+int delete_calls = 0;
+
+void *operator new[](size_t size) { new_calls++; return alloc_buff; }
+void operator delete[](void *p) { delete_calls++; }
+
+struct non_trivial {
+#ifdef EXTRAF
+  EXTRAF m1;
+#endif
+  ~non_trivial() { }
+};
+
+struct array_cookie {
+  size_t element_count;
+};
+
+int new_test() {
+  int errors = 0;
+  non_trivial *ptr = new non_trivial[ARRAY_LENGTH];
+  
+  if((void *)ptr == (void *)alloc_buff) {
+    errors++;
+    printf("ERROR: new_test() pointers are equal!\n");
+  }
+
+  // Validate the cookie size
+  if(((unsigned char *)alloc_buff + sizeof(array_cookie)) != (unsigned char *)ptr) {
+    errors++;
+    printf("Cookie size incorrect (alloc_buff = 0x%p, ptr = 0x%p)\n", alloc_buff, ptr);
+  }
+  
+  // Validate the cookie contents
+  array_cookie *cookie = (array_cookie *)alloc_buff;
+  if(cookie->element_count != (size_t)ARRAY_LENGTH) {
+    errors++;
+    printf("Cookie value element_count incorrect, expected (%ld), got (%ld)\n", (size_t)ARRAY_LENGTH, cookie->element_count);
+  }
+  
+  delete [] ptr;
+  
+  return errors;
+}
+
+int placement_new_test() {
+  int errors = 0;
+  non_trivial *ptr = new (alloc_buff) non_trivial[ARRAY_LENGTH];
+
+  if((void *)ptr != (void *)alloc_buff) {
+    errors++;
+    printf("ERROR: new_test() pointers differ!\n");
+  }
+  
+  return errors;
+}
+
+int main(int argc, char *argv[]) {
+  int retval = 0;
+  
+  retval += new_test();
+  retval += placement_new_test();
+  
+  if(retval) {
+    printf("TEST FAILED\n");
+    retval = 1;
+  } else {
+    printf("TEST PASSED\n");
+    retval = 0;
+  }
+
+  return retval;
+}

Propchange: test-suite/trunk/ABI-Testsuite/test/s2_7/test02.xpp
------------------------------------------------------------------------------
    svn:executable = *

Added: test-suite/trunk/ABI-Testsuite/test/s2_7/test06.xpp
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/ABI-Testsuite/test/s2_7/test06.xpp?rev=214126&view=auto
==============================================================================
--- test-suite/trunk/ABI-Testsuite/test/s2_7/test06.xpp (added)
+++ test-suite/trunk/ABI-Testsuite/test/s2_7/test06.xpp Mon Jul 28 16:20:34 2014
@@ -0,0 +1,92 @@
+// This file is distributed under the University of Illinois Open Source License.
+// See LICENSE.TXT for details.
+// RUN: cxx_compiler cxx_11 %s -c -o %t.o
+// RUN: linker cxx_11 %t.o -o %t%exeext
+// RUN: runtool %t%exeext | grep "TEST PASSED"
+
+#include <stdio.h>
+#include <new>
+
+// No cookie required for placement new
+
+#define BUFF_SIZE 1024
+#define ARRAY_LENGTH 5
+
+// Globals
+unsigned char alloc_buff[BUFF_SIZE];
+int new_calls = 0;
+int delete_calls = 0;
+
+void *operator new[](size_t size) { new_calls++; return alloc_buff; }
+void operator delete[](void *p) { delete_calls++; }
+
+struct non_trivial {
+  long long m1;
+  ~non_trivial() { }
+};
+
+struct array_cookie {
+  size_t element_count;
+};
+
+static int calculate_padding() {
+  return (sizeof(size_t) > alignof(non_trivial)) ? sizeof(size_t) : alignof(non_trivial);
+}
+
+static int new_test() {
+  int errors = 0;
+  non_trivial *ptr = new non_trivial[ARRAY_LENGTH];
+  
+  if((void *)ptr == (void *)alloc_buff) {
+    errors++;
+    printf("ERROR: new_test() pointers are equal!\n");
+  }
+
+  // Validate the cookie size
+  int padding = calculate_padding() - sizeof(array_cookie);
+  printf("padding is %d\n", padding);
+  if(((unsigned char *)alloc_buff + padding + sizeof(array_cookie)) != (unsigned char *)ptr) {
+    errors++;
+    printf("Cookie size incorrect (alloc_buff = 0x%p, ptr = 0x%p, padding = %d, sizeof(array_cookie) = %d)\n", alloc_buff, ptr, padding, sizeof(array_cookie));
+  }
+  
+  // Validate the cookie contents
+  array_cookie *cookie = (array_cookie *)((unsigned char *)alloc_buff + padding);
+  if(cookie->element_count != (size_t)ARRAY_LENGTH) {
+    errors++;
+    printf("Cookie value element_count incorrect, expected (%ld), got (%ld)\n", (size_t)ARRAY_LENGTH, cookie->element_count);
+  }
+  
+  delete [] ptr;
+  
+  return errors;
+}
+
+static int placement_new_test() {
+  int errors = 0;
+  non_trivial *ptr = new (alloc_buff) non_trivial[ARRAY_LENGTH];
+
+  if((void *)ptr != (void *)alloc_buff) {
+    errors++;
+    printf("ERROR: new_test() pointers differ!\n");
+  }
+  
+  return errors;
+}
+
+int main(int argc, char *argv[]) {
+  int retval = 0;
+  
+  retval += new_test();
+  retval += placement_new_test();
+  
+  if(retval) {
+    printf("TEST FAILED\n");
+    retval = 1;
+  } else {
+    printf("TEST PASSED\n");
+    retval = 0;
+  }
+
+  return retval;
+}

Propchange: test-suite/trunk/ABI-Testsuite/test/s2_7/test06.xpp
------------------------------------------------------------------------------
    svn:executable = *

Added: test-suite/trunk/ABI-Testsuite/test/s2_7/test_align.xpp
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/ABI-Testsuite/test/s2_7/test_align.xpp?rev=214126&view=auto
==============================================================================
--- test-suite/trunk/ABI-Testsuite/test/s2_7/test_align.xpp (added)
+++ test-suite/trunk/ABI-Testsuite/test/s2_7/test_align.xpp Mon Jul 28 16:20:34 2014
@@ -0,0 +1,156 @@
+// This file is distributed under the University of Illinois Open Source License.
+// See LICENSE.TXT for details.
+// RUN: cxx_compiler cxx_11 -c -o %t.o %s -DALIGN=1 
+// RUN: linker cxx_11 %t.o -o %t%exeext
+// RUN: runtool %t%exeext | grep "TEST PASSED"
+// RUN: cxx_compiler cxx_11 -c -o %t.o %s -DALIGN=2 
+// RUN: linker cxx_11 %t.o -o %t%exeext
+// RUN: runtool %t%exeext | grep "TEST PASSED"
+// RUN: cxx_compiler cxx_11 -c -o %t.o %s -DALIGN=4 
+// RUN: linker cxx_11 %t.o -o %t%exeext
+// RUN: runtool %t%exeext | grep "TEST PASSED"
+// RUN: cxx_compiler cxx_11 -c -o %t.o %s -DALIGN=8 
+// RUN: linker cxx_11 %t.o -o %t%exeext
+// RUN: runtool %t%exeext | grep "TEST PASSED"
+// RUN: cxx_compiler cxx_11 -c -o %t.o %s -DALIGN=16 
+// RUN: linker cxx_11 %t.o -o %t%exeext
+// RUN: runtool %t%exeext | grep "TEST PASSED"
+// RUN: cxx_compiler cxx_11 -c -o %t.o %s -DALIGN=32 
+// RUN: linker cxx_11 %t.o -o %t%exeext
+// RUN: runtool %t%exeext | grep "TEST PASSED"
+// RUN: cxx_compiler cxx_11 -c -o %t.o %s -DALIGN=64 
+// RUN: linker cxx_11 %t.o -o %t%exeext
+// RUN: runtool %t%exeext | grep "TEST PASSED"
+// RUN: cxx_compiler cxx_11 -c -o %t.o %s -DALIGN=128 
+// RUN: linker cxx_11 %t.o -o %t%exeext
+// RUN: runtool %t%exeext | grep "TEST PASSED"
+// RUN: cxx_compiler cxx_11 -c -o %t.o %s -DALIGN=256 
+// RUN: linker cxx_11 %t.o -o %t%exeext
+// RUN: runtool %t%exeext | grep "TEST PASSED"
+// RUN: cxx_compiler cxx_11 -c -o %t.o %s -DALIGN=512 
+// RUN: linker cxx_11 %t.o -o %t%exeext
+// RUN: runtool %t%exeext | grep "TEST PASSED"
+// RUN: cxx_compiler cxx_11 -c -o %t.o %s -DALIGN=1024 
+// RUN: linker cxx_11 %t.o -o %t%exeext
+// RUN: runtool %t%exeext | grep "TEST PASSED"
+// RUN: cxx_compiler cxx_11 -c -o %t.o %s -DALIGN=2048 
+// RUN: linker cxx_11 %t.o -o %t%exeext
+// RUN: runtool %t%exeext | grep "TEST PASSED"
+// RUN: cxx_compiler cxx_11 -c -o %t.o %s -DALIGN=4096 
+// RUN: linker cxx_11 %t.o -o %t%exeext
+// RUN: runtool %t%exeext | grep "TEST PASSED"
+// RUN: cxx_compiler cxx_11 -c -o %t.o %s -DALIGN=8192 
+// RUN: linker cxx_11 %t.o -o %t%exeext
+// RUN: runtool %t%exeext | grep "TEST PASSED"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <new>
+
+// non-trivial struct with forced alignment test
+
+#define ARRAY_LENGTH 5
+#define BUFF_SIZE ALIGN * ARRAY_LENGTH * 2
+
+// Globals
+static unsigned char alloc_buff[BUFF_SIZE];
+int new_calls = 0;
+int delete_calls = 0;
+
+static void *array_new_return_value;
+
+void *operator new[](size_t size) { 
+    new_calls++; return array_new_return_value = malloc(size); 
+}
+
+
+#ifdef SKIP_STRONGLY_ALIGNED
+// continue to use inline version because we need over-aligned result
+inline void *operator new[](size_t size, size_t size2) { 
+    new_calls++; 
+    return array_new_return_value = alloc_buff; 
+}
+#endif // SKIP_STRONGLY_ALIGNED
+
+void operator delete[](void *p) { delete_calls++; }
+
+static int verbose;
+
+struct non_trivial {
+  ~non_trivial() { }
+} __attribute__((aligned(ALIGN)));
+
+struct array_cookie {
+  size_t element_count;
+};
+
+static int calculate_padding() {
+  int size = (int) sizeof(size_t);
+  int alignment = alignof(non_trivial);
+  int retval = size > alignment ? size : alignment;
+  
+  retval -= sizeof(array_cookie);
+  
+  return (retval > 0 ? retval : 0);
+}
+
+static int new_test() {
+  int errors = 0;
+  non_trivial *ptr = new non_trivial[ARRAY_LENGTH];
+  
+  if((void *)ptr == array_new_return_value) {
+    errors++;
+    printf("ERROR: new_test() pointers are equal!\n");
+  }
+
+  // Validate the cookie size
+  int padding = calculate_padding();
+  if(((unsigned char *)array_new_return_value + padding + sizeof(array_cookie)) != (unsigned char *)ptr) {
+    errors++;
+    printf("Cookie size incorrect (array_new_return_value = 0x%p, ptr = 0x%p, padding = %d, sizeof(array_cookie) = %d)\n", array_new_return_value, ptr, padding, (int) sizeof(array_cookie));
+  } else if (verbose)
+    printf("array_new_return_value = 0x%p, ptr = 0x%p, padding = %d, sizeof(array_cookie) = %d\n", array_new_return_value, ptr, padding, (int) sizeof(array_cookie));
+  
+  // Validate the cookie contents
+  array_cookie *cookie = (array_cookie *)((unsigned char *)array_new_return_value + padding);
+  if(cookie->element_count != (size_t)ARRAY_LENGTH) {
+    errors++;
+    printf("Cookie value element_count incorrect, expected (%ld), got (%ld)\n", (size_t)ARRAY_LENGTH, cookie->element_count);
+  }
+  
+  delete [] ptr;
+  
+  return errors;
+}
+
+static int placement_new_test() {
+  int errors = 0;
+#ifndef SKIP_STRONGLY_ALIGNED
+  non_trivial *ptr = new ((void*)alloc_buff) non_trivial[ARRAY_LENGTH];
+
+  if((void *)ptr != (void *)alloc_buff) {
+    errors++;
+    printf("ERROR: placement_new_test() pointers differ! %p != %p\n", ptr, array_new_return_value);
+  }
+#endif // SKIP_STRONGLY_ALIGNED
+
+  return errors;
+}
+
+int main(int argc, char *argv[]) {
+  int retval = 0;
+  if (argc > 1) verbose = 1;
+  
+  retval += new_test();
+  retval += placement_new_test();
+  
+  if(retval) {
+    printf("TEST FAILED align=%d\n", ALIGN);
+    retval = 1;
+  } else {
+    printf("TEST PASSED align=%d\n", ALIGN);
+    retval = 0;
+  }
+
+  return retval;
+}

Propchange: test-suite/trunk/ABI-Testsuite/test/s2_7/test_align.xpp
------------------------------------------------------------------------------
    svn:executable = *

Added: test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_bool.xpp
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_bool.xpp?rev=214126&view=auto
==============================================================================
--- test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_bool.xpp (added)
+++ test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_bool.xpp Mon Jul 28 16:20:34 2014
@@ -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;
+}

Propchange: test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_bool.xpp
------------------------------------------------------------------------------
    svn:executable = *

Added: test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_char.xpp
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_char.xpp?rev=214126&view=auto
==============================================================================
--- test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_char.xpp (added)
+++ test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_char.xpp Mon Jul 28 16:20:34 2014
@@ -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;
+}

Propchange: test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_char.xpp
------------------------------------------------------------------------------
    svn:executable = *

Added: test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_double.xpp
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_double.xpp?rev=214126&view=auto
==============================================================================
--- test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_double.xpp (added)
+++ test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_double.xpp Mon Jul 28 16:20:34 2014
@@ -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;
+}

Propchange: test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_double.xpp
------------------------------------------------------------------------------
    svn:executable = *

Added: test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_float.xpp
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_float.xpp?rev=214126&view=auto
==============================================================================
--- test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_float.xpp (added)
+++ test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_float.xpp Mon Jul 28 16:20:34 2014
@@ -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;
+}

Propchange: test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_float.xpp
------------------------------------------------------------------------------
    svn:executable = *

Added: test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_int.xpp
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_int.xpp?rev=214126&view=auto
==============================================================================
--- test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_int.xpp (added)
+++ test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_int.xpp Mon Jul 28 16:20:34 2014
@@ -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;
+}

Propchange: test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_int.xpp
------------------------------------------------------------------------------
    svn:executable = *

Added: test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_long.xpp
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_long.xpp?rev=214126&view=auto
==============================================================================
--- test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_long.xpp (added)
+++ test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_long.xpp Mon Jul 28 16:20:34 2014
@@ -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;
+}

Propchange: test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_long.xpp
------------------------------------------------------------------------------
    svn:executable = *

Added: test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_long_double.xpp
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_long_double.xpp?rev=214126&view=auto
==============================================================================
--- test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_long_double.xpp (added)
+++ test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_long_double.xpp Mon Jul 28 16:20:34 2014
@@ -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;
+}

Propchange: test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_long_double.xpp
------------------------------------------------------------------------------
    svn:executable = *

Added: test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_long_long.xpp
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_long_long.xpp?rev=214126&view=auto
==============================================================================
--- test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_long_long.xpp (added)
+++ test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_long_long.xpp Mon Jul 28 16:20:34 2014
@@ -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;
+}

Propchange: test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_long_long.xpp
------------------------------------------------------------------------------
    svn:executable = *

Added: test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_short.xpp
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_short.xpp?rev=214126&view=auto
==============================================================================
--- test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_short.xpp (added)
+++ test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_short.xpp Mon Jul 28 16:20:34 2014
@@ -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;
+}

Propchange: test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_short.xpp
------------------------------------------------------------------------------
    svn:executable = *

Added: test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_signed_char.xpp
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_signed_char.xpp?rev=214126&view=auto
==============================================================================
--- test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_signed_char.xpp (added)
+++ test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_signed_char.xpp Mon Jul 28 16:20:34 2014
@@ -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;
+}

Propchange: test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_signed_char.xpp
------------------------------------------------------------------------------
    svn:executable = *

Added: test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_unsigned_char.xpp
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_unsigned_char.xpp?rev=214126&view=auto
==============================================================================
--- test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_unsigned_char.xpp (added)
+++ test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_unsigned_char.xpp Mon Jul 28 16:20:34 2014
@@ -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;
+}

Propchange: test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_unsigned_char.xpp
------------------------------------------------------------------------------
    svn:executable = *

Added: test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_unsigned_int.xpp
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_unsigned_int.xpp?rev=214126&view=auto
==============================================================================
--- test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_unsigned_int.xpp (added)
+++ test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_unsigned_int.xpp Mon Jul 28 16:20:34 2014
@@ -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;
+}

Propchange: test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_unsigned_int.xpp
------------------------------------------------------------------------------
    svn:executable = *

Added: test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_unsigned_long.xpp
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_unsigned_long.xpp?rev=214126&view=auto
==============================================================================
--- test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_unsigned_long.xpp (added)
+++ test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_unsigned_long.xpp Mon Jul 28 16:20:34 2014
@@ -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;
+}

Propchange: test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_unsigned_long.xpp
------------------------------------------------------------------------------
    svn:executable = *

Added: test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_unsigned_long_long.xpp
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_unsigned_long_long.xpp?rev=214126&view=auto
==============================================================================
--- test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_unsigned_long_long.xpp (added)
+++ test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_unsigned_long_long.xpp Mon Jul 28 16:20:34 2014
@@ -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;
+}

Propchange: test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_unsigned_long_long.xpp
------------------------------------------------------------------------------
    svn:executable = *

Added: test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_unsigned_short.xpp
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_unsigned_short.xpp?rev=214126&view=auto
==============================================================================
--- test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_unsigned_short.xpp (added)
+++ test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_unsigned_short.xpp Mon Jul 28 16:20:34 2014
@@ -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;
+}

Propchange: test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_unsigned_short.xpp
------------------------------------------------------------------------------
    svn:executable = *

Added: test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_void.xpp
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_void.xpp?rev=214126&view=auto
==============================================================================
--- test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_void.xpp (added)
+++ test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_void.xpp Mon Jul 28 16:20:34 2014
@@ -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;
+}

Propchange: test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_void.xpp
------------------------------------------------------------------------------
    svn:executable = *

Added: test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_wchar_t.xpp
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_wchar_t.xpp?rev=214126&view=auto
==============================================================================
--- test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_wchar_t.xpp (added)
+++ test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_wchar_t.xpp Mon Jul 28 16:20:34 2014
@@ -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;
+}

Propchange: test-suite/trunk/ABI-Testsuite/test/s2_9/builtin_wchar_t.xpp
------------------------------------------------------------------------------
    svn:executable = *

Added: test-suite/trunk/ABI-Testsuite/test/s2_9/dynamic_cast_algorithm.xpp
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/ABI-Testsuite/test/s2_9/dynamic_cast_algorithm.xpp?rev=214126&view=auto
==============================================================================
--- test-suite/trunk/ABI-Testsuite/test/s2_9/dynamic_cast_algorithm.xpp (added)
+++ test-suite/trunk/ABI-Testsuite/test/s2_9/dynamic_cast_algorithm.xpp Mon Jul 28 16:20:34 2014
@@ -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;
+}

Propchange: test-suite/trunk/ABI-Testsuite/test/s2_9/dynamic_cast_algorithm.xpp
------------------------------------------------------------------------------
    svn:executable = *

Added: test-suite/trunk/ABI-Testsuite/test/s2_9/non_virtual.xpp
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/ABI-Testsuite/test/s2_9/non_virtual.xpp?rev=214126&view=auto
==============================================================================
--- test-suite/trunk/ABI-Testsuite/test/s2_9/non_virtual.xpp (added)
+++ test-suite/trunk/ABI-Testsuite/test/s2_9/non_virtual.xpp Mon Jul 28 16:20:34 2014
@@ -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();
+}

Propchange: test-suite/trunk/ABI-Testsuite/test/s2_9/non_virtual.xpp
------------------------------------------------------------------------------
    svn:executable = *

Added: test-suite/trunk/ABI-Testsuite/test/s2_9/virtual.xpp
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/ABI-Testsuite/test/s2_9/virtual.xpp?rev=214126&view=auto
==============================================================================
--- test-suite/trunk/ABI-Testsuite/test/s2_9/virtual.xpp (added)
+++ test-suite/trunk/ABI-Testsuite/test/s2_9/virtual.xpp Mon Jul 28 16:20:34 2014
@@ -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();
+}

Propchange: test-suite/trunk/ABI-Testsuite/test/s2_9/virtual.xpp
------------------------------------------------------------------------------
    svn:executable = *

Added: test-suite/trunk/ABI-Testsuite/test/s3_3_4/section1.xpp
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/ABI-Testsuite/test/s3_3_4/section1.xpp?rev=214126&view=auto
==============================================================================
--- test-suite/trunk/ABI-Testsuite/test/s3_3_4/section1.xpp (added)
+++ test-suite/trunk/ABI-Testsuite/test/s3_3_4/section1.xpp Mon Jul 28 16:20:34 2014
@@ -0,0 +1,38 @@
+// 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: runtool %t%exeext | tee %t.out | FileCheck %s
+
+#include <stdio.h>
+
+// 3.3.4.1 - File scope objects in a single object file are constructed in declaration order
+
+struct A { A() { printf("In %s()\n", __FUNCTION__); } };
+struct B { B() { printf("In %s()\n", __FUNCTION__); } };
+struct C { C() { printf("In %s()\n", __FUNCTION__); } };
+struct D { D() { printf("In %s()\n", __FUNCTION__); } };
+struct E { E() { printf("In %s()\n", __FUNCTION__); } };
+typedef A F;
+
+// CHECK: In A()
+// CHECK: In B()
+// CHECK: In D()
+// CHECK: In C()
+// CHECK: In B()
+// CHECK: In A()
+// CHECK: In E()
+// CHECK: In main()
+
+A v01;
+B v02;
+D v03;
+C v04;
+static B v05;
+F v06;
+E v07;
+
+int main(int argc, char *argv[]) {
+  printf("In %s()\n", __FUNCTION__);
+  return 0;
+}

Propchange: test-suite/trunk/ABI-Testsuite/test/s3_3_4/section1.xpp
------------------------------------------------------------------------------
    svn:executable = *

Added: test-suite/trunk/ABI-Testsuite/test/s3_3_4/section2.xpp
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/ABI-Testsuite/test/s3_3_4/section2.xpp?rev=214126&view=auto
==============================================================================
--- test-suite/trunk/ABI-Testsuite/test/s3_3_4/section2.xpp (added)
+++ test-suite/trunk/ABI-Testsuite/test/s3_3_4/section2.xpp Mon Jul 28 16:20:34 2014
@@ -0,0 +1,44 @@
+// This file is distributed under the University of Illinois Open Source License.
+// See LICENSE.TXT for details.
+// RUN: cxx_compiler -c %s -o %t.o
+// RUN: linker %t.o -o %t%exeext
+// RUN: runtool %t%exeext | tee %t.out | FileCheck %s
+
+// CHECK:A()
+// CHECK:D()
+// CHECK:B()
+// CHECK:C()
+// CHECK:main()
+// CHECK:Test Passed
+
+#include <stdio.h>
+
+static int counter = 0;
+
+#define INCREMENT_COUNTER counter++;
+#define DECREMENT_COUNTER counter--;
+
+struct A { A() { printf("%s()\n", __FUNCTION__); INCREMENT_COUNTER; } };
+struct B { B() { printf("%s()\n", __FUNCTION__); INCREMENT_COUNTER; } };
+struct C { C() { printf("%s()\n", __FUNCTION__); INCREMENT_COUNTER; } };
+struct D { D() { printf("%s()\n", __FUNCTION__); INCREMENT_COUNTER; } };
+
+A v01 __attribute__((init_priority(200)));
+B v02 __attribute__((init_priority(505)));
+C v03;
+D v04 __attribute__((init_priority(325)));
+
+int main()
+{
+  printf("%s()\n", __FUNCTION__);
+  DECREMENT_COUNTER;
+  DECREMENT_COUNTER;
+  DECREMENT_COUNTER;
+  DECREMENT_COUNTER;
+  if(counter == 0) {
+    printf("Test Passed\n");
+  } else {
+    printf("Test Failed\n");
+  }
+  return 0;
+}

Propchange: test-suite/trunk/ABI-Testsuite/test/s3_3_4/section2.xpp
------------------------------------------------------------------------------
    svn:executable = *

Added: test-suite/trunk/ABI-Testsuite/test/s3_3_4/test12.xpp
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/ABI-Testsuite/test/s3_3_4/test12.xpp?rev=214126&view=auto
==============================================================================
--- test-suite/trunk/ABI-Testsuite/test/s3_3_4/test12.xpp (added)
+++ test-suite/trunk/ABI-Testsuite/test/s3_3_4/test12.xpp Mon Jul 28 16:20:34 2014
@@ -0,0 +1,49 @@
+// This file is distributed under the University of Illinois Open Source License.
+// See LICENSE.TXT for details.
+/*
+ *
+ * test12.c:
+ *   - C++ source code
+ *   - Static destructor
+ *   - GCC destructor
+ *   - GCC init_priority attribute
+ *
+ * Expected output and order:
+ *   In BBBB()
+ *   In AAAA()
+ *   In main()
+ *   In foo()
+ *   In ~AAAA()
+ *   In ~BBBB()
+ *
+ *   :BBBB():AAAA():main():foo():~AAAA():~BBBB()
+ */
+
+// RUN: cxx_compiler %s -c -o %t.o
+// RUN: linker %t.o -o %t%exeext
+// RUN: runtool %t%exeext | tee %t.out | FileCheck %s
+
+// CHECK: :BBBB():AAAA():foo():main():~AAAA():~BBBB()
+
+#include <stdio.h>
+
+struct AAAA {
+  AAAA() { printf(":AAAA()"); }
+  ~AAAA() { printf(":~AAAA()"); }
+};
+
+struct BBBB {
+  BBBB() { printf(":BBBB()"); }
+  ~BBBB() { printf(":~BBBB()"); }
+};
+
+AAAA one __attribute__ ((init_priority(3000)));
+BBBB two __attribute__ ((init_priority(2000)));
+
+__attribute__((constructor)) void foo() { printf(":foo()"); }
+
+int main()
+{
+  printf(":main()");
+  return 0;
+}

Propchange: test-suite/trunk/ABI-Testsuite/test/s3_3_4/test12.xpp
------------------------------------------------------------------------------
    svn:executable = *

Added: test-suite/trunk/ABI-Testsuite/test/s3_3_4/test13-2.xpp
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/ABI-Testsuite/test/s3_3_4/test13-2.xpp?rev=214126&view=auto
==============================================================================
--- test-suite/trunk/ABI-Testsuite/test/s3_3_4/test13-2.xpp (added)
+++ test-suite/trunk/ABI-Testsuite/test/s3_3_4/test13-2.xpp Mon Jul 28 16:20:34 2014
@@ -0,0 +1,55 @@
+// This file is distributed under the University of Illinois Open Source License.
+// See LICENSE.TXT for details.
+/*
+ *
+ * test13-2.c:
+ *   - C++ source code
+ *   - Static destructor
+ *   - GCC destructors using priority
+ *   - GCC init_priority attributes
+ *
+ * Expected output and order:
+ *   In BBBB()
+ *   In AAAA()
+ *   In main()
+ *   In ~AAAA()
+ *   In bar()
+ *   In baz()
+ *   In foo()
+ *   In ~BBBB()
+ *
+ *   :BBBB():AAAA():main():~AAAA():bar():baz():foo():~BBBB()
+ */
+
+// RUN: cxx_compiler %s -c -o %t.o
+// RUN: linker %t.o -o %t%exeext
+// RUN: runtool %t%exeext | tee %t.out | FileCheck %s
+
+// CHECK: :BBBB():foo():baz():bar():AAAA():main():~AAAA():~BBBB()
+
+#include <stdio.h>
+
+struct AAAA {
+  AAAA() { printf(":AAAA()"); }
+  ~AAAA() { printf(":~AAAA()"); }
+};
+
+struct BBBB {
+  BBBB() { printf(":BBBB()"); }
+  ~BBBB() { printf(":~BBBB()"); }
+};
+
+AAAA one __attribute__ ((init_priority(3000)));
+BBBB two __attribute__ ((init_priority(2000)));
+
+__attribute__((constructor(2250))) void foo() { printf(":foo()"); }
+
+__attribute__((constructor(2750))) void bar() { printf(":bar()"); }
+
+__attribute__((constructor(2500))) void baz() { printf(":baz()"); }
+
+int main()
+{
+  printf(":main()");
+  return 0;
+}

Propchange: test-suite/trunk/ABI-Testsuite/test/s3_3_4/test13-2.xpp
------------------------------------------------------------------------------
    svn:executable = *

Added: test-suite/trunk/ABI-Testsuite/test/s3_3_4/test13-3.xpp
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/ABI-Testsuite/test/s3_3_4/test13-3.xpp?rev=214126&view=auto
==============================================================================
--- test-suite/trunk/ABI-Testsuite/test/s3_3_4/test13-3.xpp (added)
+++ test-suite/trunk/ABI-Testsuite/test/s3_3_4/test13-3.xpp Mon Jul 28 16:20:34 2014
@@ -0,0 +1,55 @@
+// This file is distributed under the University of Illinois Open Source License.
+// See LICENSE.TXT for details.
+/*
+ *
+ * test13-3.c:
+ *   - C++ source code
+ *   - Static destructor
+ *   - GCC destructors using priority
+ *   - GCC init_priority attributes
+ *
+ * Expected output and order:
+ *   In AAAA()
+ *   In BBBB()
+ *   In main()
+ *   In ~BBBB()
+ *   In bar()
+ *   In ~AAAA()
+ *   In baz()
+ *   In foo()
+ *
+ *   :AAAA():BBBB():main():~BBBB():bar():~AAAA():baz():foo()
+ */
+
+// RUN: cxx_compiler %s -c -o %t.o
+// RUN: linker %t.o -o %t%exeext
+// RUN: runtool %t%exeext | tee %t.out | FileCheck %s
+
+// CHECK: :foo():baz():AAAA():bar():BBBB():main():~BBBB():~AAAA()
+
+#include <stdio.h>
+
+struct AAAA {
+  AAAA() { printf(":AAAA()"); }
+  ~AAAA() { printf(":~AAAA()"); }
+};
+
+struct BBBB {
+  BBBB() { printf(":BBBB()"); }
+  ~BBBB() { printf(":~BBBB()"); }
+};
+
+AAAA one __attribute__ ((init_priority(3000)));
+BBBB two;
+
+__attribute__((constructor(1500))) void foo() { printf(":foo()"); }
+
+__attribute__((constructor(3500))) void bar() { printf(":bar()"); }
+
+__attribute__((constructor(2500))) void baz() { printf(":baz()"); }
+
+int main()
+{
+  printf(":main()");
+  return 0;
+}

Propchange: test-suite/trunk/ABI-Testsuite/test/s3_3_4/test13-3.xpp
------------------------------------------------------------------------------
    svn:executable = *

Added: test-suite/trunk/ABI-Testsuite/test/s3_3_4/test13-4.xpp
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/ABI-Testsuite/test/s3_3_4/test13-4.xpp?rev=214126&view=auto
==============================================================================
--- test-suite/trunk/ABI-Testsuite/test/s3_3_4/test13-4.xpp (added)
+++ test-suite/trunk/ABI-Testsuite/test/s3_3_4/test13-4.xpp Mon Jul 28 16:20:34 2014
@@ -0,0 +1,55 @@
+// This file is distributed under the University of Illinois Open Source License.
+// See LICENSE.TXT for details.
+/*
+ *
+ * test13-4.c:
+ *   - C++ source code
+ *   - Static destructor
+ *   - GCC destructors using priority
+ *   - GCC init_priority attributes
+ *
+ * Expected output and order:
+ *   In AAAA()
+ *   In BBBB()
+ *   In main()
+ *   In ~BBBB()
+ *   In ~AAAA()
+ *   In bar()
+ *   In baz()
+ *   In foo()
+ *
+ *   :AAAA():BBBB():main():~BBBB():~AAAA():bar():baz():foo()
+ */
+
+// RUN: cxx_compiler %s -c -o %t.o
+// RUN: linker %t.o -o %t%exeext
+// RUN: runtool %t%exeext | tee %t.out | FileCheck %s
+
+// CHECK: :foo():baz():bar():AAAA():BBBB():main():~BBBB():~AAAA()
+
+#include <stdio.h>
+
+struct AAAA {
+  AAAA() { printf(":AAAA()"); }
+  ~AAAA() { printf(":~AAAA()"); }
+};
+
+struct BBBB {
+  BBBB() { printf(":BBBB()"); }
+  ~BBBB() { printf(":~BBBB()"); }
+};
+
+AAAA one __attribute__ ((init_priority(4000)));
+BBBB two;
+
+__attribute__((constructor(1500))) void foo() { printf(":foo()"); }
+
+__attribute__((constructor(3500))) void bar() { printf(":bar()"); }
+
+__attribute__((constructor(2500))) void baz() { printf(":baz()"); }
+
+int main()
+{
+  printf(":main()");
+  return 0;
+}

Propchange: test-suite/trunk/ABI-Testsuite/test/s3_3_4/test13-4.xpp
------------------------------------------------------------------------------
    svn:executable = *

Added: test-suite/trunk/ABI-Testsuite/test/s3_3_4/test13-5.xpp
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/ABI-Testsuite/test/s3_3_4/test13-5.xpp?rev=214126&view=auto
==============================================================================
--- test-suite/trunk/ABI-Testsuite/test/s3_3_4/test13-5.xpp (added)
+++ test-suite/trunk/ABI-Testsuite/test/s3_3_4/test13-5.xpp Mon Jul 28 16:20:34 2014
@@ -0,0 +1,55 @@
+// This file is distributed under the University of Illinois Open Source License.
+// See LICENSE.TXT for details.
+/*
+ *
+ * test13-5.c:
+ *   - C++ source code
+ *   - Static destructor
+ *   - GCC destructors using priority
+ *   - GCC init_priority attributes
+ *
+ * Expected output and order:
+ *   In AAAA()
+ *   In BBBB()
+ *   In main()
+ *   In bar()
+ *   In baz()
+ *   In foo()
+ *   In ~BBBB()
+ *   In ~AAAA()
+ *
+ *   :AAAA():BBBB():main():bar():baz():foo():~BBBB():~AAAA()
+ */
+
+// RUN: cxx_compiler %s -c -o %t.o
+// RUN: linker %t.o -o %t%exeext
+// RUN: runtool %t%exeext | tee %t.out | FileCheck %s
+
+// CHECK: :AAAA():BBBB():foo():baz():bar():main():~BBBB():~AAAA()
+
+#include <stdio.h>
+
+struct AAAA {
+  AAAA() { printf(":AAAA()"); }
+  ~AAAA() { printf(":~AAAA()"); }
+};
+
+struct BBBB {
+  BBBB() { printf(":BBBB()"); }
+  ~BBBB() { printf(":~BBBB()"); }
+};
+
+AAAA one __attribute__ ((init_priority(1000)));
+BBBB two __attribute__ ((init_priority(2000)));
+
+__attribute__((constructor(3500))) void foo() { printf(":foo()"); }
+
+__attribute__((constructor(5500))) void bar() { printf(":bar()"); }
+
+__attribute__((constructor(4500))) void baz() { printf(":baz()"); }
+
+int main()
+{
+  printf(":main()");
+  return 0;
+}

Propchange: test-suite/trunk/ABI-Testsuite/test/s3_3_4/test13-5.xpp
------------------------------------------------------------------------------
    svn:executable = *

Added: test-suite/trunk/ABI-Testsuite/test/s3_3_4/test13-6.xpp
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/ABI-Testsuite/test/s3_3_4/test13-6.xpp?rev=214126&view=auto
==============================================================================
--- test-suite/trunk/ABI-Testsuite/test/s3_3_4/test13-6.xpp (added)
+++ test-suite/trunk/ABI-Testsuite/test/s3_3_4/test13-6.xpp Mon Jul 28 16:20:34 2014
@@ -0,0 +1,55 @@
+// This file is distributed under the University of Illinois Open Source License.
+// See LICENSE.TXT for details.
+/*
+ *
+ * test13-6.c:
+ *   - C++ source code
+ *   - Static destructor
+ *   - GCC destructors using priority
+ *   - GCC init_priority attributes
+ *
+ * Expected output and order:
+ *   In AAAA()
+ *   In BBBB()
+ *   In main()
+ *   In bar()
+ *   In baz()
+ *   In ~BBBB()
+ *   In ~AAAA()
+ *   In foo()
+ *
+ *   :AAAA():BBBB():main():bar():baz():~BBBB():~AAAA():foo()
+ */
+
+// RUN: cxx_compiler %s -c -o %t.o
+// RUN: linker %t.o -o %t%exeext
+// RUN: runtool %t%exeext | tee %t.out | FileCheck %s
+
+// CHECK: :foo():AAAA():BBBB():baz():bar():main():~BBBB():~AAAA()
+
+#include <stdio.h>
+
+struct AAAA {
+  AAAA() { printf(":AAAA()"); }
+  ~AAAA() { printf(":~AAAA()"); }
+};
+
+struct BBBB {
+  BBBB() { printf(":BBBB()"); }
+  ~BBBB() { printf(":~BBBB()"); }
+};
+
+AAAA one __attribute__ ((init_priority(2000)));
+BBBB two __attribute__ ((init_priority(3000)));
+
+__attribute__((constructor(1500))) void foo() { printf(":foo()"); }
+
+__attribute__((constructor(5500))) void bar() { printf(":bar()"); }
+
+__attribute__((constructor(4500))) void baz() { printf(":baz()"); }
+
+int main()
+{
+  printf(":main()");
+  return 0;
+}

Propchange: test-suite/trunk/ABI-Testsuite/test/s3_3_4/test13-6.xpp
------------------------------------------------------------------------------
    svn:executable = *

Added: test-suite/trunk/ABI-Testsuite/test/s3_3_4/test13.xpp
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/ABI-Testsuite/test/s3_3_4/test13.xpp?rev=214126&view=auto
==============================================================================
--- test-suite/trunk/ABI-Testsuite/test/s3_3_4/test13.xpp (added)
+++ test-suite/trunk/ABI-Testsuite/test/s3_3_4/test13.xpp Mon Jul 28 16:20:34 2014
@@ -0,0 +1,55 @@
+// This file is distributed under the University of Illinois Open Source License.
+// See LICENSE.TXT for details.
+/*
+ *
+ * test13.c:
+ *   - C++ source code
+ *   - Static destructor
+ *   - GCC destructors using priority
+ *   - GCC init_priority attributes
+ *
+ * Expected output and order:
+ *   In BBBB()
+ *   In AAAA()
+ *   In main()
+ *   In bar()
+ *   In ~AAAA()
+ *   In baz()
+ *   In ~BBBB()
+ *   In foo()
+ *
+ *   :BBBB():AAAA():main():bar():~AAAA():baz():~BBBB():foo()
+ */
+
+// RUN: cxx_compiler %s -c -o %t.o
+// RUN: linker %t.o -o %t%exeext
+// RUN: runtool %t%exeext | tee %t.out | FileCheck %s
+
+// CHECK: :foo():BBBB():baz():AAAA():bar():main():~AAAA():~BBBB()
+
+#include <stdio.h>
+
+struct AAAA {
+  AAAA() { printf(":AAAA()"); }
+  ~AAAA() { printf(":~AAAA()"); }
+};
+
+struct BBBB {
+  BBBB() { printf(":BBBB()"); }
+  ~BBBB() { printf(":~BBBB()"); }
+};
+
+AAAA one __attribute__ ((init_priority(3000)));
+BBBB two __attribute__ ((init_priority(2000)));
+
+__attribute__((constructor(1500))) void foo() { printf(":foo()"); }
+
+__attribute__((constructor(3500))) void bar() { printf(":bar()"); }
+
+__attribute__((constructor(2500))) void baz() { printf(":baz()"); }
+
+int main()
+{
+  printf(":main()");
+  return 0;
+}

Propchange: test-suite/trunk/ABI-Testsuite/test/s3_3_4/test13.xpp
------------------------------------------------------------------------------
    svn:executable = *

Added: test-suite/trunk/ABI-Testsuite/test/s3_3_4/test14.xpp
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/ABI-Testsuite/test/s3_3_4/test14.xpp?rev=214126&view=auto
==============================================================================
--- test-suite/trunk/ABI-Testsuite/test/s3_3_4/test14.xpp (added)
+++ test-suite/trunk/ABI-Testsuite/test/s3_3_4/test14.xpp Mon Jul 28 16:20:34 2014
@@ -0,0 +1,58 @@
+// This file is distributed under the University of Illinois Open Source License.
+// See LICENSE.TXT for details.
+/*
+ *
+ * test14.c:
+ *   - C++ source code
+ *   - Static destructor
+ *   - GCC destructor
+ *   - GCC destructors using priority
+ *
+ * Expected output and order:
+ *   In BBBB()
+ *   In AAAA()
+ *   In main()
+ *   In foobarbaz()
+ *   In bar()
+ *   In ~AAAA()
+ *   In baz()
+ *   In ~BBBB()
+ *   In foo()
+ *
+ *   :BBBB():AAAA():main():foobarbaz():bar():~AAAA():baz():~BBBB():foo()
+ */
+
+// RUN: cxx_compiler %s -c -o %t.o
+// RUN: linker %t.o -o %t%exeext
+// RUN: runtool %t%exeext | tee %t.out | FileCheck %s
+
+// CHECK: :foo():BBBB():baz():AAAA():bar():foobarbaz():main():~AAAA():~BBBB()
+
+#include <stdio.h>
+
+struct AAAA {
+  AAAA() { printf(":AAAA()"); }
+  ~AAAA() { printf(":~AAAA()"); }
+};
+
+struct BBBB {
+  BBBB() { printf(":BBBB()"); }
+  ~BBBB() { printf(":~BBBB()"); }
+};
+
+AAAA one __attribute__ ((init_priority(3000)));
+BBBB two __attribute__ ((init_priority(2000)));
+
+__attribute__((constructor(1500))) void foo() { printf(":foo()"); }
+
+__attribute__((constructor(3500))) void bar() { printf(":bar()"); }
+
+__attribute__((constructor(2500))) void baz() { printf(":baz()"); }
+
+__attribute__((constructor)) void foobarbaz() { printf(":foobarbaz()"); }
+
+int main()
+{
+  printf(":main()");
+  return 0;
+}

Propchange: test-suite/trunk/ABI-Testsuite/test/s3_3_4/test14.xpp
------------------------------------------------------------------------------
    svn:executable = *

Added: test-suite/trunk/ABI-Testsuite/test/s3_3_5/lambda.cpp
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/ABI-Testsuite/test/s3_3_5/lambda.cpp?rev=214126&view=auto
==============================================================================
--- test-suite/trunk/ABI-Testsuite/test/s3_3_5/lambda.cpp (added)
+++ test-suite/trunk/ABI-Testsuite/test/s3_3_5/lambda.cpp Mon Jul 28 16:20:34 2014
@@ -0,0 +1,24 @@
+// This file is distributed under the University of Illinois Open Source License.
+// See LICENSE.TXT for details.
+// RUN: cxx_compiler %s -c cxx_11 -o %t.o
+// RUN: linker %t.o -o %t%exeext
+// RUN: runtool %t%exeext | tee %t.out |FileCheck %s
+
+// section 1: testing number of functions registered with atexit()
+
+#include <stdio.h>
+#include <stdlib.h>
+
+void fn01() { printf("%s()", __FUNCTION__); }
+void fn02() { printf("%s()", __FUNCTION__); }
+
+int main(int argc, char *argv[]) {
+  printf("main()");
+
+  // CHECK: main()fn02()operator()()fn01()
+  atexit(fn01);
+  atexit([]() { printf("%s()", __FUNCTION__); });
+  atexit(fn02);
+
+  return 0;
+}

Propchange: test-suite/trunk/ABI-Testsuite/test/s3_3_5/lambda.cpp
------------------------------------------------------------------------------
    svn:executable = *

Added: test-suite/trunk/ABI-Testsuite/test/s3_3_5/s1.cpp
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/ABI-Testsuite/test/s3_3_5/s1.cpp?rev=214126&view=auto
==============================================================================
--- test-suite/trunk/ABI-Testsuite/test/s3_3_5/s1.cpp (added)
+++ test-suite/trunk/ABI-Testsuite/test/s3_3_5/s1.cpp Mon Jul 28 16:20:34 2014
@@ -0,0 +1,153 @@
+// This file is distributed under the University of Illinois Open Source License.
+// See LICENSE.TXT for details.
+// RUN: cxx_compiler %s -c -o %t.o
+// RUN: linker %t.o -o %t%exeext
+// RUN: runtool %t%exeext | tee %t.out | FileCheck %s
+
+// section 1: testing number of functions registered with atexit()
+
+#include <stdio.h>
+#include <stdlib.h>
+
+int global_counter = 0;
+
+void fn01() { printf("%s()\n", __FUNCTION__); }
+void fn02() { printf("%s()\n", __FUNCTION__); }
+void fn03() { printf("%s()\n", __FUNCTION__); }
+void fn04() { printf("%s()\n", __FUNCTION__); }
+void fn05() { printf("%s()\n", __FUNCTION__); }
+void fn06() { printf("%s()\n", __FUNCTION__); }
+void fn07() { printf("%s()\n", __FUNCTION__); }
+void fn08() { printf("%s()\n", __FUNCTION__); }
+void fn09() { printf("%s()\n", __FUNCTION__); }
+void fn10() { printf("%s()\n", __FUNCTION__); }
+
+void fn11() { printf("%s()\n", __FUNCTION__); }
+void fn12() { printf("%s()\n", __FUNCTION__); }
+void fn13() { printf("%s()\n", __FUNCTION__); }
+void fn14() { printf("%s()\n", __FUNCTION__); }
+void fn15() { printf("%s()\n", __FUNCTION__); }
+void fn16() { printf("%s()\n", __FUNCTION__); }
+void fn17() { printf("%s()\n", __FUNCTION__); }
+void fn18() { printf("%s()\n", __FUNCTION__); }
+void fn19() { printf("%s()\n", __FUNCTION__); }
+void fn20() { printf("%s()\n", __FUNCTION__); }
+
+void fn21() { printf("%s()\n", __FUNCTION__); }
+void fn22() { printf("%s()\n", __FUNCTION__); }
+void fn23() { printf("%s()\n", __FUNCTION__); }
+void fn24() { printf("%s()\n", __FUNCTION__); }
+void fn25() { printf("%s()\n", __FUNCTION__); }
+void fn26() { printf("%s()\n", __FUNCTION__); }
+void fn27() { printf("%s()\n", __FUNCTION__); }
+void fn28() { printf("%s()\n", __FUNCTION__); }
+void fn29() { printf("%s()\n", __FUNCTION__); }
+void fn30() { printf("%s()\n", __FUNCTION__); }
+
+void fn31() { printf("%s()\n", __FUNCTION__); }
+void fn32() { printf("%s()\n", __FUNCTION__); }
+void fn33() { printf("%s()\n", __FUNCTION__); }
+void fn34() { printf("%s()\n", __FUNCTION__); }
+void fn35() { printf("%s()\n", __FUNCTION__); }
+void fn36() { printf("%s()\n", __FUNCTION__); }
+void fn37() { printf("%s()\n", __FUNCTION__); }
+void fn38() { printf("%s()\n", __FUNCTION__); }
+void fn39() { printf("%s()\n", __FUNCTION__); }
+void fn40() { printf("%s()\n", __FUNCTION__); }
+
+void call_me_at_exit() { printf("global_counter = %d\n", ++global_counter); }
+
+int main(int argc, char *argv[]) {
+  // CHECK: In main()
+  printf("In main()\n");
+
+  // CHECK: fn40()
+  // CHECK: fn39()
+  // CHECK: fn38()
+  // CHECK: fn37()
+  // CHECK: fn36()
+  // CHECK: fn35()
+  // CHECK: fn34()
+  // CHECK: fn33()
+  // CHECK: fn32()
+  // CHECK: fn31()
+  
+  // CHECK: fn30()
+  // CHECK: fn29()
+  // CHECK: fn28()
+  // CHECK: fn27()
+  // CHECK: fn26()
+  // CHECK: fn25()
+  // CHECK: fn24()
+  // CHECK: fn23()
+  // CHECK: fn22()
+  // CHECK: fn21()
+  
+  // CHECK: fn20()
+  // CHECK: fn19()
+  // CHECK: fn18()
+  // CHECK: fn17()
+  // CHECK: fn16()
+  // CHECK: fn15()
+  // CHECK: fn14()
+  // CHECK: fn13()
+  // CHECK: fn12()
+  // CHECK: fn11()
+  
+  // CHECK: fn10()
+  // CHECK: fn09()
+  // CHECK: fn08()
+  // CHECK: fn07()
+  // CHECK: fn06()
+  // CHECK: fn05()
+  // CHECK: fn04()
+  // CHECK: fn03()
+  // CHECK: fn02()
+  // CHECK: fn01()
+
+  atexit(fn01);
+  atexit(fn02);
+  atexit(fn03);
+  atexit(fn04);
+  atexit(fn05);
+  atexit(fn06);
+  atexit(fn07);
+  atexit(fn08);
+  atexit(fn09);
+  atexit(fn10);
+
+  atexit(fn11);
+  atexit(fn12);
+  atexit(fn13);
+  atexit(fn14);
+  atexit(fn15);
+  atexit(fn16);
+  atexit(fn17);
+  atexit(fn18);
+  atexit(fn19);
+  atexit(fn20);
+
+  atexit(fn21);
+  atexit(fn22);
+  atexit(fn23);
+  atexit(fn24);
+  atexit(fn25);
+  atexit(fn26);
+  atexit(fn27);
+  atexit(fn28);
+  atexit(fn29);
+  atexit(fn30);
+
+  atexit(fn31);
+  atexit(fn32);
+  atexit(fn33);
+  atexit(fn34);
+  atexit(fn35);
+  atexit(fn36);
+  atexit(fn37);
+  atexit(fn38);
+  atexit(fn39);
+  atexit(fn40);
+
+  return 0;
+}

Propchange: test-suite/trunk/ABI-Testsuite/test/s3_3_5/s1.cpp
------------------------------------------------------------------------------
    svn:executable = *

Added: test-suite/trunk/ABI-Testsuite/test/s3_3_5/s3a.xpp
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/ABI-Testsuite/test/s3_3_5/s3a.xpp?rev=214126&view=auto
==============================================================================
--- test-suite/trunk/ABI-Testsuite/test/s3_3_5/s3a.xpp (added)
+++ test-suite/trunk/ABI-Testsuite/test/s3_3_5/s3a.xpp Mon Jul 28 16:20:34 2014
@@ -0,0 +1,43 @@
+// This file is distributed under the University of Illinois Open Source License.
+// See LICENSE.TXT for details.
+// RUN: cxx_compiler %s -c -o %t.o
+// RUN: linker %t.o -o %t%exeext
+// RUN: runtool %t%exeext | tee %t.tmp | FileCheck %s
+
+#include <stdio.h>
+#include <stdlib.h>
+
+// CHECK: main()
+// CHECK: fn05()
+// CHECK: fn04()
+// CHECK: fn03()
+// CHECK: ~non_trivial()
+// CHECK: fn02()
+// CHECK: fn01()
+
+void fn01() { printf("%s()\n", __FUNCTION__); }
+void fn02() { printf("%s()\n", __FUNCTION__); }
+void fn03() { printf("%s()\n", __FUNCTION__); }
+void fn04() { printf("%s()\n", __FUNCTION__); }
+void fn05() { printf("%s()\n", __FUNCTION__); }
+
+struct non_trivial {
+  non_trivial() { atexit(fn02); }
+  ~non_trivial() { printf("%s()\n", __FUNCTION__); }
+  int v1;
+};
+
+void foo(void (*fp)()) {
+  static non_trivial v1;
+  atexit(fp);
+}
+
+int main(int argc, char *argv[]) {
+  atexit(fn01);
+  foo(fn03);
+  foo(fn04);
+  atexit(fn05);
+  printf("%s()\n", __FUNCTION__);
+  
+  return 0;
+}

Propchange: test-suite/trunk/ABI-Testsuite/test/s3_3_5/s3a.xpp
------------------------------------------------------------------------------
    svn:executable = *

Added: test-suite/trunk/ABI-Testsuite/test/s3_3_5/s3a2.xpp
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/ABI-Testsuite/test/s3_3_5/s3a2.xpp?rev=214126&view=auto
==============================================================================
--- test-suite/trunk/ABI-Testsuite/test/s3_3_5/s3a2.xpp (added)
+++ test-suite/trunk/ABI-Testsuite/test/s3_3_5/s3a2.xpp Mon Jul 28 16:20:34 2014
@@ -0,0 +1,35 @@
+// This file is distributed under the University of Illinois Open Source License.
+// See LICENSE.TXT for details.
+// RUN: cxx_compiler %s -c -o %t.o
+// RUN: linker %t.o -o %t%exeext
+// RUN: runtool %t%exeext | tee %t.tmp | FileCheck %s
+
+#include <stdio.h>
+#include <stdlib.h>
+
+// CHECK: main()
+// CHECK: fn03()
+// CHECK: ~non_trivial(), v1 = 2
+// CHECK: fn02()
+// CHECK: ~non_trivial(), v1 = 1
+// CHECK: fn01()
+
+void fn01() { printf("%s()\n", __FUNCTION__); }
+void fn02() { printf("%s()\n", __FUNCTION__); }
+void fn03() { printf("%s()\n", __FUNCTION__); }
+
+struct non_trivial {
+  non_trivial(void (*fp)(), int val) { atexit(fp); v1 = val; }
+  ~non_trivial() { printf("%s(), v1 = %d\n", __FUNCTION__, v1); }
+  int v1;
+};
+
+non_trivial v1(fn01, 1);
+non_trivial v2(fn02, 2);
+
+int main(int argc, char *argv[]) {
+  atexit(fn03);
+  printf("%s()\n", __FUNCTION__);
+  
+  return 0;
+}

Propchange: test-suite/trunk/ABI-Testsuite/test/s3_3_5/s3a2.xpp
------------------------------------------------------------------------------
    svn:executable = *

Added: test-suite/trunk/ABI-Testsuite/test/s3_3_5/s3c.cpp
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/ABI-Testsuite/test/s3_3_5/s3c.cpp?rev=214126&view=auto
==============================================================================
--- test-suite/trunk/ABI-Testsuite/test/s3_3_5/s3c.cpp (added)
+++ test-suite/trunk/ABI-Testsuite/test/s3_3_5/s3c.cpp Mon Jul 28 16:20:34 2014
@@ -0,0 +1,19 @@
+// This file is distributed under the University of Illinois Open Source License.
+// See LICENSE.TXT for details.
+// RUN: cxx_compiler %s -c -o %t.o
+// RUN: linker %t.o -o %t%exeext
+// RUN: bindump %t%exeext | tee %t.out |  FileCheck %s
+
+#include <stdio.h>
+#include <stdlib.h>
+
+// Check that __dso_handle is present in an executable that calls atexit()
+
+// CHECK: __dso_handle
+
+void fn01() { printf("%s()\n", __FUNCTION__); }
+
+int main(int argc, char *argv[]) {
+  atexit(fn01);
+  return 0;
+}

Propchange: test-suite/trunk/ABI-Testsuite/test/s3_3_5/s3c.cpp
------------------------------------------------------------------------------
    svn:executable = *

Added: test-suite/trunk/ABI-Testsuite/test/s3_3_5/s3c2.xpp
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/ABI-Testsuite/test/s3_3_5/s3c2.xpp?rev=214126&view=auto
==============================================================================
--- test-suite/trunk/ABI-Testsuite/test/s3_3_5/s3c2.xpp (added)
+++ test-suite/trunk/ABI-Testsuite/test/s3_3_5/s3c2.xpp Mon Jul 28 16:20:34 2014
@@ -0,0 +1,18 @@
+// This file is distributed under the University of Illinois Open Source License.
+// See LICENSE.TXT for details.
+// RUN: cxx_compiler %s -c -o %t.o
+// RUN: bindump %t.o | tee %t.tmp | FileCheck %s
+
+#include <stdio.h>
+#include <stdlib.h>
+
+// Check that atexit is not defined in the module (it should be provided by the library)
+
+// CHECK: {{(U|SHN_UNDEF) atexit}}
+
+void fn01() { printf("%s()\n", __FUNCTION__); }
+
+int main(int argc, char *argv[]) {
+  atexit(fn01);
+  return 0;
+}

Propchange: test-suite/trunk/ABI-Testsuite/test/s3_3_5/s3c2.xpp
------------------------------------------------------------------------------
    svn:executable = *





More information about the llvm-commits mailing list