diff --git a/flang/CMakeLists.txt b/flang/CMakeLists.txt --- a/flang/CMakeLists.txt +++ b/flang/CMakeLists.txt @@ -401,6 +401,7 @@ add_subdirectory(tools) endif() add_subdirectory(runtime) +add_subdirectory(examples) if (FLANG_INCLUDE_TESTS) add_subdirectory(test) diff --git a/flang/examples/CMakeLists.txt b/flang/examples/CMakeLists.txt new file mode 100644 --- /dev/null +++ b/flang/examples/CMakeLists.txt @@ -0,0 +1,8 @@ +# This test is not run by default as it requires input. +add_executable(external-hello-world + external-hello.cpp +) + +target_link_libraries(external-hello-world + FortranRuntime +) diff --git a/flang/unittests/Runtime/external-hello.cpp b/flang/examples/external-hello.cpp rename from flang/unittests/Runtime/external-hello.cpp rename to flang/examples/external-hello.cpp --- a/flang/unittests/Runtime/external-hello.cpp +++ b/flang/examples/external-hello.cpp @@ -1,6 +1,6 @@ -#include "../../runtime/io-api.h" -#include "../../runtime/main.h" -#include "../../runtime/stop.h" +#include "../runtime/io-api.h" +#include "../runtime/main.h" +#include "../runtime/stop.h" #include #include diff --git a/flang/unittests/Runtime/CMakeLists.txt b/flang/unittests/Runtime/CMakeLists.txt --- a/flang/unittests/Runtime/CMakeLists.txt +++ b/flang/unittests/Runtime/CMakeLists.txt @@ -18,15 +18,6 @@ ${llvm_libs} ) -# This test is not run by default as it requires input. -add_executable(external-hello-world - external-hello.cpp -) - -target_link_libraries(external-hello-world - FortranRuntime -) - add_flang_nongtest_unittest(external-io RuntimeTesting FortranRuntime