From 81adee0f2476af72ce3923874f35dceff9fedf9a Mon Sep 17 00:00:00 2001 From: anonymous Date: Mon, 28 Jun 2010 17:44:35 +0000 Subject: Added std:: functions for setting unexpected / terminate handlers. --- test/Makefile | 28 ++++++++-------------------- test/test_guard.cc | 2 ++ test/test_typeinfo.cc | 2 +- 3 files changed, 11 insertions(+), 21 deletions(-) (limited to 'test') 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 -- cgit v1.2.3