[test-suite] r177681 - Testcase for PR15555 (r177680).
Bill Wendling
isanbard at gmail.com
Thu Mar 21 16:30:50 PDT 2013
Author: void
Date: Thu Mar 21 18:30:50 2013
New Revision: 177681
URL: http://llvm.org/viewvc/llvm-project?rev=177681&view=rev
Log:
Testcase for PR15555 (r177680).
Added:
test-suite/trunk/SingleSource/Regression/C++/EH/recursive-throw.cpp
test-suite/trunk/SingleSource/Regression/C++/EH/recursive-throw.reference_output
Added: test-suite/trunk/SingleSource/Regression/C++/EH/recursive-throw.cpp
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Regression/C%2B%2B/EH/recursive-throw.cpp?rev=177681&view=auto
==============================================================================
--- test-suite/trunk/SingleSource/Regression/C++/EH/recursive-throw.cpp (added)
+++ test-suite/trunk/SingleSource/Regression/C++/EH/recursive-throw.cpp Thu Mar 21 18:30:50 2013
@@ -0,0 +1,49 @@
+// Testcase for <rdar://problem/13360379> / PR15555
+#include <cstdlib>
+
+bool thrown = false;
+bool caught = false;
+
+class TestException {
+public:
+ TestException() {}
+};
+
+struct Z {
+ Z() {}
+ ~Z() {}
+};
+
+void thr(int n) {
+ if( --n <= 0 ) {
+ thrown = true;
+ throw TestException();
+ abort();
+ }
+
+ Z z;
+ thr(n - 1);
+}
+
+__attribute__((noinline))
+void run() {
+ try {
+ thr(10);
+ abort();
+ } catch(const TestException &e) {
+ caught = true;
+ }
+}
+
+int main(int argc, char* argv[]) {
+ try {
+ run();
+ } catch(...) {
+ abort();
+ }
+
+ if (thrown && caught)
+ return EXIT_SUCCESS;
+
+ return EXIT_FAILURE;
+}
Added: test-suite/trunk/SingleSource/Regression/C++/EH/recursive-throw.reference_output
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Regression/C%2B%2B/EH/recursive-throw.reference_output?rev=177681&view=auto
==============================================================================
--- test-suite/trunk/SingleSource/Regression/C++/EH/recursive-throw.reference_output (added)
+++ test-suite/trunk/SingleSource/Regression/C++/EH/recursive-throw.reference_output Thu Mar 21 18:30:50 2013
@@ -0,0 +1 @@
+exit 0
More information about the llvm-commits
mailing list