zhuhan0 created this revision.
Herald added subscribers: hoy, wenlei.
Herald added a project: All.
zhuhan0 requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Follow-up to the discussion in https://reviews.llvm.org/D141824. Because the
purpose of the test is to test loading a shared library, and clang tests
traditionally have not invoked actual linking, reduce this test case to loading
a shared library only.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D147823

Files:
  clang/test/Interpreter/Inputs/dynamic-library-test.cpp
  clang/test/Interpreter/Inputs/libdynamic-library-test.so
  clang/test/Interpreter/dynamic-library.cpp


Index: clang/test/Interpreter/dynamic-library.cpp
===================================================================
--- clang/test/Interpreter/dynamic-library.cpp
+++ clang/test/Interpreter/dynamic-library.cpp
@@ -1,8 +1,18 @@
 // REQUIRES: host-supports-jit, system-linux
 // UNSUPPORTED: target={{.*-(ps4|ps5)}}
 
-// RUN: %clang -xc++ -o %T/libdynamic-library-test.so -fPIC -shared -DLIBRARY 
%S/Inputs/dynamic-library-test.cpp
-// RUN: cat %s | env LD_LIBRARY_PATH=%T:$LD_LIBRARY_PATH clang-repl | 
FileCheck %s
+// RUN: cat %s | env LD_LIBRARY_PATH=%S/Inputs:$LD_LIBRARY_PATH clang-repl | 
FileCheck %s
+
+// Input source dynamic-library-test.cpp:
+//
+// int ultimate_answer = 0;
+// int calculate_answer() {
+//   ultimate_answer = 42;
+//   return 5;
+// }
+//
+// Compile with:
+// clang -xc++ -o libdynamic-library-test.so -fPIC -shared -DLIBRARY 
dynamic-library-test.cpp
 
 #include <cstdio>
 
Index: clang/test/Interpreter/Inputs/dynamic-library-test.cpp
===================================================================
--- clang/test/Interpreter/Inputs/dynamic-library-test.cpp
+++ /dev/null
@@ -1,6 +0,0 @@
-int ultimate_answer = 0;
-
-int calculate_answer() {
-  ultimate_answer = 42;
-  return 5;
-}


Index: clang/test/Interpreter/dynamic-library.cpp
===================================================================
--- clang/test/Interpreter/dynamic-library.cpp
+++ clang/test/Interpreter/dynamic-library.cpp
@@ -1,8 +1,18 @@
 // REQUIRES: host-supports-jit, system-linux
 // UNSUPPORTED: target={{.*-(ps4|ps5)}}
 
-// RUN: %clang -xc++ -o %T/libdynamic-library-test.so -fPIC -shared -DLIBRARY %S/Inputs/dynamic-library-test.cpp
-// RUN: cat %s | env LD_LIBRARY_PATH=%T:$LD_LIBRARY_PATH clang-repl | FileCheck %s
+// RUN: cat %s | env LD_LIBRARY_PATH=%S/Inputs:$LD_LIBRARY_PATH clang-repl | FileCheck %s
+
+// Input source dynamic-library-test.cpp:
+//
+// int ultimate_answer = 0;
+// int calculate_answer() {
+//   ultimate_answer = 42;
+//   return 5;
+// }
+//
+// Compile with:
+// clang -xc++ -o libdynamic-library-test.so -fPIC -shared -DLIBRARY dynamic-library-test.cpp
 
 #include <cstdio>
 
Index: clang/test/Interpreter/Inputs/dynamic-library-test.cpp
===================================================================
--- clang/test/Interpreter/Inputs/dynamic-library-test.cpp
+++ /dev/null
@@ -1,6 +0,0 @@
-int ultimate_answer = 0;
-
-int calculate_answer() {
-  ultimate_answer = 42;
-  return 5;
-}
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to