[PATCH] D104320: [flang] Move `external-hello-world` to flang/examples

Andrzej Warzynski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 15 13:33:34 PDT 2021


awarzynski created this revision.
Herald added a subscriber: mgorny.
awarzynski requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

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


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D104320

Files:
  flang/CMakeLists.txt
  flang/examples/CMakeLists.txt
  flang/examples/external-hello.cpp
  flang/unittests/Runtime/CMakeLists.txt
  flang/unittests/Runtime/external-hello.cpp


Index: flang/unittests/Runtime/CMakeLists.txt
===================================================================
--- flang/unittests/Runtime/CMakeLists.txt
+++ 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
Index: flang/examples/external-hello.cpp
===================================================================
--- flang/examples/external-hello.cpp
+++ 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>
 
Index: flang/examples/CMakeLists.txt
===================================================================
--- /dev/null
+++ 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
+)
Index: flang/CMakeLists.txt
===================================================================
--- flang/CMakeLists.txt
+++ flang/CMakeLists.txt
@@ -401,6 +401,7 @@
   add_subdirectory(tools)
 endif()
 add_subdirectory(runtime)
+add_subdirectory(examples)
 
 if (FLANG_INCLUDE_TESTS)
   add_subdirectory(test)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104320.352232.patch
Type: text/x-patch
Size: 1606 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210615/6c324bf3/attachment-0001.bin>


More information about the llvm-commits mailing list