summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authoranonymous <local@localhost>2010-06-28 17:44:35 +0000
committeranonymous <local@localhost>2010-06-28 17:44:35 +0000
commit81adee0f2476af72ce3923874f35dceff9fedf9a (patch)
treecaa361ed02d8ce227bf982a36f4219e97211dddc /test
parente55300bb3884cf91c0d2735649a68984703a6350 (diff)
downloadlibcxxrt-81adee0f2476af72ce3923874f35dceff9fedf9a.tar.gz
libcxxrt-81adee0f2476af72ce3923874f35dceff9fedf9a.tar.bz2
libcxxrt-81adee0f2476af72ce3923874f35dceff9fedf9a.tar.xz
Added std:: functions for setting unexpected / terminate handlers.
Diffstat (limited to 'test')
-rw-r--r--test/Makefile28
-rw-r--r--test/test_guard.cc2
-rw-r--r--test/test_typeinfo.cc2
3 files changed, 11 insertions, 21 deletions
diff --git a/test/Makefile b/test/Makefile
index 0d0e203..fdbdc8f 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -1,11 +1,5 @@
-OBJECTS = typeinfo.o exception.o dynamic_cast.o terminate.o guard.o
-
TEST_OBJECTS = test_typeinfo.o test.o test_exception.o new.o test_guard.o
-# Needed for building the shared library
-CXXFLAGS = -fPIC
-# Needed for GCC atomic ops to work on x86.
-CXXFLAGS += -march=native
# This library implements exception handling, so make sure that the compiler
# emits the correct code
CXXFLAGS += -fexceptions
@@ -18,19 +12,18 @@ CXXFLAGS += -Wall -pedantic -g
# Find the unwind.h header installed from ports
CPPFLAGS += -I/usr/local/include
-LDFLAGS += -L/usr/local/lib -L. -lpthread -fexceptions
-
-
-
+LDFLAGS += -L/usr/local/lib -L. -lpthread -fexceptions -lcxxabi
+PRODUCTS = test libcxxabi.so.1 system_test
-all: test libcxxabi.so.1
+test: $(TEST_OBJECTS) libcxxabi.so library
+ @gcc $(CPPFLAGS) $(LDFLAGS) -o test $(TEST_OBJECTS)
-PRODUCTS = test libcxxabi.so.1 system_test
+library:
+ @cd ../src && $(MAKE)
-test: $(TEST_OBJECTS) libcxxabi.so.1
- @echo
- @gcc $(CPPFLAGS) $(LDFLAGS) -lcxxabi -o test $(TEST_OBJECTS)
+libcxxabi.so:
+ @ln -sf ../src/libcxxabi.so.1 libcxxabi.so
# Fudge the dynamic library search path to include the current directory so
# that we can run the tests without having to install the .so
@@ -57,13 +50,8 @@ compare: test
@LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ./test 2>&1 | tail -1 | diff system_test.out -
-libcxxabi.so.1: $(OBJECTS)
- @echo Linking $@...
- @gcc -fexception -shared $(OBJECTS) $(LDFLAGS) -o libcxxabi.so.1 #-lunwind
-
.cc.o:
@echo Compiling $<...
- @echo $(CXXFLAGS)
@$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c -o $@ $<
clean:
diff --git a/test/test_guard.cc b/test/test_guard.cc
index baeb0e7..5f8521d 100644
--- a/test/test_guard.cc
+++ b/test/test_guard.cc
@@ -12,6 +12,8 @@ struct static_struct
};
};
+static static_struct ss;
+
int init_static(void)
{
static static_struct s;
diff --git a/test/test_typeinfo.cc b/test/test_typeinfo.cc
index dd5321a..7e9e308 100644
--- a/test/test_typeinfo.cc
+++ b/test/test_typeinfo.cc
@@ -1,4 +1,4 @@
-#include "typeinfo.h"
+#include "../src/typeinfo.h"
#include "test.h"
#include <stdio.h>