diff --git a/userspace/CMakeLists.txt b/userspace/CMakeLists.txt index 9874d570..79a7ab8a 100644 --- a/userspace/CMakeLists.txt +++ b/userspace/CMakeLists.txt @@ -23,6 +23,7 @@ set(USERSPACE_PROJECTS sync tee test + test-globals touch u8sum whoami diff --git a/userspace/test-globals/CMakeLists.txt b/userspace/test-globals/CMakeLists.txt new file mode 100644 index 00000000..8fe4151a --- /dev/null +++ b/userspace/test-globals/CMakeLists.txt @@ -0,0 +1,17 @@ +cmake_minimum_required(VERSION 3.26) + +project(test-globals CXX) + +set(SOURCES + main.cpp +) + +add_executable(test-globals ${SOURCES}) +target_compile_options(test-globals PUBLIC -O2 -g) +target_link_libraries(test-globals PUBLIC libc) + +add_custom_target(test-globals-install + COMMAND sudo cp ${CMAKE_CURRENT_BINARY_DIR}/test-globals ${BANAN_BIN}/ + DEPENDS test-globals + USES_TERMINAL +) diff --git a/userspace/test-globals/main.cpp b/userspace/test-globals/main.cpp new file mode 100644 index 00000000..bf156ae4 --- /dev/null +++ b/userspace/test-globals/main.cpp @@ -0,0 +1,14 @@ +#include + +struct foo_t +{ + foo_t() { printf("global constructor works\n"); } + ~foo_t() { printf("global destructor works\n"); } +}; + +foo_t foo; + +int main() +{ + +}