These tests got moved to test/Programs/SingleSource/Regression/C++/EH
authorChris Lattner <sabre@nondot.org>
Tue, 30 Sep 2003 18:57:56 +0000 (18:57 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 30 Sep 2003 18:57:56 +0000 (18:57 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8785 91177308-0d34-0410-b5e6-96231b3b80d8

test/C++Frontend/EH/ctor_dtor_count.cpp [deleted file]
test/C++Frontend/EH/dead_try_block.cpp [deleted file]
test/C++Frontend/EH/exception_spec_test.cpp [deleted file]
test/C++Frontend/EH/function_try_block.cpp [deleted file]
test/C++Frontend/EH/simple_rethrow.cpp [deleted file]
test/C++Frontend/EH/simple_throw.cpp [deleted file]
test/C++Frontend/EH/throw_rethrow_test.cpp [deleted file]

diff --git a/test/C++Frontend/EH/ctor_dtor_count.cpp b/test/C++Frontend/EH/ctor_dtor_count.cpp
deleted file mode 100644 (file)
index a399c09..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-#include <stdio.h>
-
-static int c;
-
-struct A {
-  A() { ++c; }
-  A(const A&) { ++c; }
-  ~A() { --c; }
-};
-
-struct B {
-  A a;
-  B() { A a; throw 1; }
-};
-
-int main() {
-  try {
-    B b;
-  } catch (...) {}
-  if (!c) printf("All ok!\n");
-  return c;
-}
-
diff --git a/test/C++Frontend/EH/dead_try_block.cpp b/test/C++Frontend/EH/dead_try_block.cpp
deleted file mode 100644 (file)
index 00a5b11..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-// This testcase doesn't actually DO any EH
-#include <stdio.h>
-
-static void foo() {}
-int main() {
-       try {
-               foo();
-       } catch(...) {
-               return 1;
-       }
-       printf("All ok\n");
-       return 0;
-}
diff --git a/test/C++Frontend/EH/exception_spec_test.cpp b/test/C++Frontend/EH/exception_spec_test.cpp
deleted file mode 100644 (file)
index f80f0ee..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-// This tests that exception specifications interact properly with unexpected
-// handlers.
-
-#include <exception>
-#include <stdio.h>
-#include <stdlib.h>
-
-static void TerminateHandler() {
-  printf("std::terminate called\n");
-  exit(1);
-}
-
-static void UnexpectedHandler1() {
-  printf("std::unexpected called: throwing a double\n");
-  throw 1.0;
-}
-
-static void UnexpectedHandler2() {
-  printf("std::unexpected called: throwing an int!\n");
-  throw 1;
-}
-
-void test(bool Int) throw (double) {
-  if (Int) {
-    printf("Throwing an int from a function which only allows doubles!\n");
-    throw 1;
-  } else {
-    printf("Throwing a double from a function which allows doubles!\n");
-    throw 1.0;
-  }
-}
-
-int main() {
-  try {
-    test(false);
-  } catch (double D) {
-    printf("Double successfully caught!\n");
-  }
-
-  std::set_terminate(TerminateHandler);
-  std::set_unexpected(UnexpectedHandler1);
-
-  try {
-    test(true);
-  } catch (double D) {
-    printf("Double successfully caught!\n");
-  }
-
-  std::set_unexpected(UnexpectedHandler2);
-  test(true);
-}
diff --git a/test/C++Frontend/EH/function_try_block.cpp b/test/C++Frontend/EH/function_try_block.cpp
deleted file mode 100644 (file)
index 001b7c5..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-
-#include <stdio.h>
-
-static unsigned NumAs = 0;
-
-struct A {
-  unsigned ANum;
-  A() : ANum(NumAs++) { printf("Created A #%d\n", ANum); }
-  A(const A &a) : ANum(NumAs++) { printf("Copy Created A #%d\n", ANum); }
-  ~A() { printf("Destroyed A #%d\n", ANum); }
-};
-
-static bool ShouldThrow = false;
-
-int throws()
-  try
-{
-  if (ShouldThrow) throw 7; return 123;
-} catch (...) {
-  printf("'throws' threw an exception: rethrowing!\n");
-  throw;
-}
-
-struct B {
-  A a0, a1, a2;
-  int i;
-  A a3, a4;
-
-  B();
-  ~B() { printf("B destructor!\n"); }
-};
-
-B::B()
-try 
-: i(throws())
-{
-  printf("In B constructor!\n");
-}
-catch (int i) {
-  printf("In B catch block with int %d: auto rethrowing\n", i);
-}
-
-
-int main() {
-  {
-    B b;   // Shouldn't throw.
-  }
-
-  try {
-    ShouldThrow = true;
-    B b;
-  } catch (...) {
-    printf("Caught exception!\n");
-  }
-}
diff --git a/test/C++Frontend/EH/simple_rethrow.cpp b/test/C++Frontend/EH/simple_rethrow.cpp
deleted file mode 100644 (file)
index 34c4681..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-#include <stdio.h>
-
-int throws() {
-  printf("Throwing int\n");
-  throw 16;
-};
-
-int callsthrows() {
-  try {
-    throws();
-  } catch (...) {
-    printf("Caught something, rethrowing...\n");
-    throw;
-  }
-}
-
-int main() {
-  try {
-    callsthrows();
-  } catch (int i) {
-    printf("Caught int: %d\n", i);
-    return i-16;
-  }
-  return 1;
-}
diff --git a/test/C++Frontend/EH/simple_throw.cpp b/test/C++Frontend/EH/simple_throw.cpp
deleted file mode 100644 (file)
index 7289c6d..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-// Test throwing a constant int
-#include <stdio.h>
-
-static void foo() { throw 5; }
-int main() {
-       try {
-               foo();
-       } catch (...) {
-               printf("All ok\n");
-               return 0;
-       }
-       return 1;
-}
diff --git a/test/C++Frontend/EH/throw_rethrow_test.cpp b/test/C++Frontend/EH/throw_rethrow_test.cpp
deleted file mode 100644 (file)
index cbaaa1b..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-// This tests hard situations for throwing, including the case where an
-// exception is active in more than one handler at a time (ie, it needs
-// refcounting)
-#include <cstdio>
-
-struct foo {
-  int i;
-  foo() : i(1) { }
-  foo(const foo&) : i(2) {}
-};
-
-int callee(unsigned i) {
-  if (i < 3) throw (int)i;
-  if (i < 6) throw 1.0;
-  if (i < 9) throw foo();
-  return 0;
-}
-
-void rethrow() {
-  throw;
-}
-
-int main() {
-  for (unsigned i = 0; i < 10; ++i) {
-    try {
-      return callee(i);
-    } catch (foo &F) {
-      try {
-       rethrow();
-      } catch (foo &F) {
-        std::printf("%d: 3\n", i);
-      }
-    } catch (int) {
-      std::printf("%d: 1\n", i);
-    } catch (...) {
-      std::printf("%d: 2\n", i);
-    }
-  }
-}
-