[flang-commits] [flang] 062644b - [flang][nfc] Move `external-hello-world` to flang/examples

Andrzej Warzynski via flang-commits flang-commits at lists.llvm.org
Wed Jun 16 01:02:58 PDT 2021


Author: Andrzej Warzynski
Date: 2021-06-16T08:00:50Z
New Revision: 062644bb399bd05fd0aeb3cb9d52fa0014db0bdd

URL: https://github.com/llvm/llvm-project/commit/062644bb399bd05fd0aeb3cb9d52fa0014db0bdd
DIFF: https://github.com/llvm/llvm-project/commit/062644bb399bd05fd0aeb3cb9d52fa0014db0bdd.diff

LOG: [flang][nfc] Move `external-hello-world` to flang/examples

As `external-hello-world` is not really a test, I am moving it from
`flang/unittest/Runtime` to `flang/examples` (it makes a lot of sense as
an example). I've not modified the source code (apart from adjusting the
include paths).

Differential Revision: https://reviews.llvm.org/D104320

Added: 
    flang/examples/CMakeLists.txt
    flang/examples/external-hello.cpp

Modified: 
    flang/CMakeLists.txt
    flang/unittests/Runtime/CMakeLists.txt

Removed: 
    flang/unittests/Runtime/external-hello.cpp


################################################################################
diff  --git a/flang/CMakeLists.txt b/flang/CMakeLists.txt
index 009092247c001..adf3dc819dc93 100644
--- a/flang/CMakeLists.txt
+++ b/flang/CMakeLists.txt
@@ -401,6 +401,7 @@ if (FLANG_BUILD_TOOLS)
   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
index 0000000000000..3ca9feddf33e9
--- /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
similarity index 93%
rename from flang/unittests/Runtime/external-hello.cpp
rename to flang/examples/external-hello.cpp
index a9394082805c9..7c300d702caeb 100644
--- 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 <cstring>
 #include <limits>
 

diff  --git a/flang/unittests/Runtime/CMakeLists.txt b/flang/unittests/Runtime/CMakeLists.txt
index f4dba0d68e4c9..fa6952737ad02 100644
--- a/flang/unittests/Runtime/CMakeLists.txt
+++ b/flang/unittests/Runtime/CMakeLists.txt
@@ -18,15 +18,6 @@ target_link_libraries(RuntimeTesting
   ${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


        


More information about the flang-commits mailing list