diff options
Diffstat (limited to 'share/gcc-arm-none-eabi/samples/src/cpp')
-rw-r--r-- | share/gcc-arm-none-eabi/samples/src/cpp/Makefile | 12 | ||||
-rw-r--r-- | share/gcc-arm-none-eabi/samples/src/cpp/cpp.cc | 19 |
2 files changed, 31 insertions, 0 deletions
diff --git a/share/gcc-arm-none-eabi/samples/src/cpp/Makefile b/share/gcc-arm-none-eabi/samples/src/cpp/Makefile new file mode 100644 index 0000000..294c09c --- /dev/null +++ b/share/gcc-arm-none-eabi/samples/src/cpp/Makefile @@ -0,0 +1,12 @@ +include ../makefile.conf +NAME=cpp +STARTUP_DEFS=-D__NO_SYSTEM_INIT + +LDSCRIPTS=-L. -L$(BASE)/ldscripts -T gcc.ld +LFLAGS=$(USE_NANO) $(USE_SEMIHOST) $(LDSCRIPTS) $(GC) $(MAP) + +$(NAME)-$(CORE).axf: $(NAME).cc $(STARTUP) + $(CXX) $^ $(CXXFLAGS) -fno-exceptions $(LFLAGS) -o $@ + +clean: + rm -f $(NAME)*.axf *.map diff --git a/share/gcc-arm-none-eabi/samples/src/cpp/cpp.cc b/share/gcc-arm-none-eabi/samples/src/cpp/cpp.cc new file mode 100644 index 0000000..d9b083a --- /dev/null +++ b/share/gcc-arm-none-eabi/samples/src/cpp/cpp.cc @@ -0,0 +1,19 @@ +#include <stdio.h> + +struct test_class { + test_class () { + m = new char[10]; + printf("In ctor\n"); + } + ~test_class () { + delete m; + printf("In dtor\n"); + } + char * m; +} g; + +int main() +{ + printf("In main\n"); + return 0; +} |