summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authoranonymous <local@localhost>2010-11-25 04:16:44 +0000
committeranonymous <local@localhost>2010-11-25 04:16:44 +0000
commit0f29a300da1302eb27b0c5f561834d3a7ce5dfe4 (patch)
tree23afc0726d43d995f48b107d8a040b3a89cc65b7 /test
parente86befa5c02daa2fdc80539794a5208cbd5bbe28 (diff)
downloadlibcxxrt-0f29a300da1302eb27b0c5f561834d3a7ce5dfe4.tar.gz
libcxxrt-0f29a300da1302eb27b0c5f561834d3a7ce5dfe4.tar.bz2
libcxxrt-0f29a300da1302eb27b0c5f561834d3a7ce5dfe4.tar.xz
Fixed throwing / catching pointers.
Diffstat (limited to 'test')
-rw-r--r--test/test_exception.cc17
1 files changed, 16 insertions, 1 deletions
diff --git a/test/test_exception.cc b/test/test_exception.cc
index eb738ba..44fe5d0 100644
--- a/test/test_exception.cc
+++ b/test/test_exception.cc
@@ -5,7 +5,7 @@
#include <exception>
-#define fprintf(...)
+//#define fprintf(...)
void log(void* ignored)
{
@@ -178,6 +178,21 @@ void test_exceptions(void)
catch (int64_t i) {
TEST(0, "Caught int64_t, but that violates an exception spec");
}
+ int a;
+ try {
+ throw &a;
+ }
+ catch (const int *b)
+ {
+ TEST(&a==b, "Caught const int from thrown int");
+ }
+ try {
+ throw &a;
+ }
+ catch (int *b)
+ {
+ TEST(&a==b, "Caught int from thrown int");
+ }
//printf("Test: %s\n",
}