[llvm-commits] [test-suite] r140286 - in /test-suite/trunk/SingleSource/UnitTests/EH: filter-1.cpp filter-1.reference_output
Bill Wendling
isanbard at gmail.com
Wed Sep 21 18:34:16 PDT 2011
Author: void
Date: Wed Sep 21 20:34:15 2011
New Revision: 140286
URL: http://llvm.org/viewvc/llvm-project?rev=140286&view=rev
Log:
Add a filter test to the nightly test suite.
Added:
test-suite/trunk/SingleSource/UnitTests/EH/filter-1.cpp
test-suite/trunk/SingleSource/UnitTests/EH/filter-1.reference_output
Added: test-suite/trunk/SingleSource/UnitTests/EH/filter-1.cpp
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/UnitTests/EH/filter-1.cpp?rev=140286&view=auto
==============================================================================
--- test-suite/trunk/SingleSource/UnitTests/EH/filter-1.cpp (added)
+++ test-suite/trunk/SingleSource/UnitTests/EH/filter-1.cpp Wed Sep 21 20:34:15 2011
@@ -0,0 +1,25 @@
+#include <exception>
+#include <iostream>
+
+void bar() throw (int) {
+ std::cout << "Throwing in bar(): \"hello world\"\n";
+ throw "hello world";
+}
+
+void foo() {
+ try {
+ bar();
+ } catch (int i) {
+ std::cout << "Caught in foo(): " << i << "\n";
+ }
+}
+
+void unexpected() {
+ std::cout << "Throwing in unexpected(): 42\n";
+ throw 42;
+}
+
+int main() {
+ std::set_unexpected(unexpected);
+ foo();
+}
Added: test-suite/trunk/SingleSource/UnitTests/EH/filter-1.reference_output
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/UnitTests/EH/filter-1.reference_output?rev=140286&view=auto
==============================================================================
--- test-suite/trunk/SingleSource/UnitTests/EH/filter-1.reference_output (added)
+++ test-suite/trunk/SingleSource/UnitTests/EH/filter-1.reference_output Wed Sep 21 20:34:15 2011
@@ -0,0 +1,4 @@
+Throwing in bar(): "hello world"
+Throwing in unexpected(): 42
+Caught in foo(): 42
+exit 0
More information about the llvm-commits
mailing list