[llvm-commits] [test-suite] r58160 - /test-suite/trunk/SingleSource/Regression/C++/EH/exception_spec_test.cpp
Dan Gohman
gohman at apple.com
Sat Oct 25 15:22:45 PDT 2008
Author: djg
Date: Sat Oct 25 17:22:45 2008
New Revision: 58160
URL: http://llvm.org/viewvc/llvm-project?rev=58160&view=rev
Log:
Fix this test so that it actually works as intended. This lets it
actually pass, instead of failing in the llc/jit/cbe runs the same
way as the native run, which is judged to be a pass.
Modified:
test-suite/trunk/SingleSource/Regression/C++/EH/exception_spec_test.cpp
Modified: test-suite/trunk/SingleSource/Regression/C++/EH/exception_spec_test.cpp
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Regression/C%2B%2B/EH/exception_spec_test.cpp?rev=58160&r1=58159&r2=58160&view=diff
==============================================================================
--- test-suite/trunk/SingleSource/Regression/C++/EH/exception_spec_test.cpp (original)
+++ test-suite/trunk/SingleSource/Regression/C++/EH/exception_spec_test.cpp Sat Oct 25 17:22:45 2008
@@ -5,8 +5,13 @@
#include <stdio.h>
#include <stdlib.h>
-static void TerminateHandler() {
- printf("std::terminate called\n");
+static void TerminateHandler0() {
+ printf("std::terminate called, as expected\n");
+ exit(0);
+}
+
+static void TerminateHandler1() {
+ printf("std::terminate called, but it was not expected!\n");
exit(1);
}
@@ -31,13 +36,14 @@
}
int main() {
+ std::set_terminate(TerminateHandler1);
+
try {
test(false);
} catch (double D) {
printf("Double successfully caught!\n");
}
- std::set_terminate(TerminateHandler);
std::set_unexpected(UnexpectedHandler1);
try {
@@ -46,6 +52,10 @@
printf("Double successfully caught!\n");
}
+ std::set_terminate(TerminateHandler0);
std::set_unexpected(UnexpectedHandler2);
test(true);
+
+ printf("TerminateHandler0 should have been called!\n");
+ return 1;
}
More information about the llvm-commits
mailing list