[llvm] 82d3c07 - [AIX] Add %pluginext and update tests to use proper pluginext

David Tenty via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 27 17:35:15 PDT 2021


Author: David Tenty
Date: 2021-04-27T20:34:54-04:00
New Revision: 82d3c0759fa0f0d3789f9b88d5f5e8cc6e97126f

URL: https://github.com/llvm/llvm-project/commit/82d3c0759fa0f0d3789f9b88d5f5e8cc6e97126f
DIFF: https://github.com/llvm/llvm-project/commit/82d3c0759fa0f0d3789f9b88d5f5e8cc6e97126f.diff

LOG: [AIX] Add %pluginext and update tests to use proper pluginext

As a follow on to D96282, since bug point passes is built as a module the proper file extension to use is LLVM_PLUGIN_EXT, rather than SHLIBEXT. Using SHLIBEXT causes the tests to load a non-existent file on AIX. We also adjust the PluginsTest unittest  to use LLVM_PLUGIN_EXT for similar reasons.

This change should hopefully make little difference to other platforms, since generally `SHLIBEXT=LTDL_SHLIB_EXT=CMAKE_SHARED_LIBRARY_SUFFIX` and `LLVM_PLUGIN_EXT=CMAKE_SHARED_LIBRARY_SUFFIX` on every platform except AIX.

Reviewed By: hubert.reinterpretcast

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

Added: 
    

Modified: 
    llvm/test/BugPoint/attr-crash.ll
    llvm/test/BugPoint/compile-custom.ll
    llvm/test/BugPoint/crash-narrowfunctiontest.ll
    llvm/test/BugPoint/func-attrs-keyval.ll
    llvm/test/BugPoint/func-attrs.ll
    llvm/test/BugPoint/invalid-debuginfo.ll
    llvm/test/BugPoint/metadata.ll
    llvm/test/BugPoint/named-md.ll
    llvm/test/BugPoint/remove_arguments_test.ll
    llvm/test/BugPoint/replace-funcs-with-null.ll
    llvm/test/BugPoint/retain-crashing-metadata.ll
    llvm/test/BugPoint/unsymbolized.ll
    llvm/test/lit.cfg.py
    llvm/test/lit.site.cfg.py.in
    llvm/unittests/Passes/PluginsTest.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/test/BugPoint/attr-crash.ll b/llvm/test/BugPoint/attr-crash.ll
index 7032e86a5cf3..08e43808ec50 100644
--- a/llvm/test/BugPoint/attr-crash.ll
+++ b/llvm/test/BugPoint/attr-crash.ll
@@ -1,4 +1,4 @@
-; RUN: bugpoint -load %llvmshlibdir/BugpointPasses%shlibext %s -output-prefix %t -bugpoint-crashfuncattr 2>&1 | FileCheck %s
+; RUN: bugpoint -load %llvmshlibdir/BugpointPasses%pluginext %s -output-prefix %t -bugpoint-crashfuncattr 2>&1 | FileCheck %s
 ; REQUIRES: plugins
 ;
 ; ModuleID = 'attr-crash.ll'

diff  --git a/llvm/test/BugPoint/compile-custom.ll b/llvm/test/BugPoint/compile-custom.ll
index c892f8227789..56bb281497ce 100644
--- a/llvm/test/BugPoint/compile-custom.ll
+++ b/llvm/test/BugPoint/compile-custom.ll
@@ -1,4 +1,4 @@
-; RUN: bugpoint -load %llvmshlibdir/BugpointPasses%shlibext --compile-custom --compile-command="%python %/s.py arg1 arg2" --output-prefix %t %s | FileCheck %s
+; RUN: bugpoint -load %llvmshlibdir/BugpointPasses%pluginext --compile-custom --compile-command="%python %/s.py arg1 arg2" --output-prefix %t %s | FileCheck %s
 ; REQUIRES: plugins
 
 ; Test that arguments are correctly passed in --compile-command.  The output

diff  --git a/llvm/test/BugPoint/crash-narrowfunctiontest.ll b/llvm/test/BugPoint/crash-narrowfunctiontest.ll
index fbccfc3d32ca..741a3a354537 100644
--- a/llvm/test/BugPoint/crash-narrowfunctiontest.ll
+++ b/llvm/test/BugPoint/crash-narrowfunctiontest.ll
@@ -1,6 +1,6 @@
 ; Test that bugpoint can narrow down the testcase to the important function
 ;
-; RUN: bugpoint -load %llvmshlibdir/BugpointPasses%shlibext %s -output-prefix %t -bugpoint-crashcalls -silence-passes > /dev/null
+; RUN: bugpoint -load %llvmshlibdir/BugpointPasses%pluginext %s -output-prefix %t -bugpoint-crashcalls -silence-passes > /dev/null
 ; REQUIRES: plugins
 
 define i32 @foo() { ret i32 1 }

diff  --git a/llvm/test/BugPoint/func-attrs-keyval.ll b/llvm/test/BugPoint/func-attrs-keyval.ll
index 0de5db9e307d..4637f4254967 100644
--- a/llvm/test/BugPoint/func-attrs-keyval.ll
+++ b/llvm/test/BugPoint/func-attrs-keyval.ll
@@ -1,4 +1,4 @@
-; RUN: bugpoint -load %llvmshlibdir/BugpointPasses%shlibext %s -output-prefix %t -bugpoint-crashfuncattr -silence-passes
+; RUN: bugpoint -load %llvmshlibdir/BugpointPasses%pluginext %s -output-prefix %t -bugpoint-crashfuncattr -silence-passes
 ; RUN: llvm-dis %t-reduced-simplified.bc -o - | FileCheck %s
 ; REQUIRES: plugins
 

diff  --git a/llvm/test/BugPoint/func-attrs.ll b/llvm/test/BugPoint/func-attrs.ll
index 234477927fdb..e8369531f217 100644
--- a/llvm/test/BugPoint/func-attrs.ll
+++ b/llvm/test/BugPoint/func-attrs.ll
@@ -1,6 +1,6 @@
-; RUN: bugpoint -load %llvmshlibdir/BugpointPasses%shlibext %s -output-prefix %t -bugpoint-crashfuncattr -silence-passes
+; RUN: bugpoint -load %llvmshlibdir/BugpointPasses%pluginext %s -output-prefix %t -bugpoint-crashfuncattr -silence-passes
 ; RUN: llvm-dis %t-reduced-simplified.bc -o - | FileCheck -check-prefixes=ALL,ENABLED %s
-; RUN: bugpoint -disable-attribute-remove -load %llvmshlibdir/BugpointPasses%shlibext %s -output-prefix %t -bugpoint-crashfuncattr -silence-passes
+; RUN: bugpoint -disable-attribute-remove -load %llvmshlibdir/BugpointPasses%pluginext %s -output-prefix %t -bugpoint-crashfuncattr -silence-passes
 ; RUN: llvm-dis %t-reduced-simplified.bc -o - | FileCheck -check-prefixes=ALL,DISABLED %s
 
 ; REQUIRES: plugins

diff  --git a/llvm/test/BugPoint/invalid-debuginfo.ll b/llvm/test/BugPoint/invalid-debuginfo.ll
index 9169984c0888..86745547d796 100644
--- a/llvm/test/BugPoint/invalid-debuginfo.ll
+++ b/llvm/test/BugPoint/invalid-debuginfo.ll
@@ -1,4 +1,4 @@
-; RUN: bugpoint -load %llvmshlibdir/BugpointPasses%shlibext %s -output-prefix %t -bugpoint-crash-too-many-cus -silence-passes 2>&1 | FileCheck %s
+; RUN: bugpoint -load %llvmshlibdir/BugpointPasses%pluginext %s -output-prefix %t -bugpoint-crash-too-many-cus -silence-passes 2>&1 | FileCheck %s
 ; REQUIRES: plugins
 ; CHECK: DICompileUnit not listed in llvm.dbg.cu
 

diff  --git a/llvm/test/BugPoint/metadata.ll b/llvm/test/BugPoint/metadata.ll
index 9cc4659b5767..b5a1e7377000 100644
--- a/llvm/test/BugPoint/metadata.ll
+++ b/llvm/test/BugPoint/metadata.ll
@@ -1,11 +1,11 @@
 ; REQUIRES: plugins
-; RUN: bugpoint -load %llvmshlibdir/BugpointPasses%shlibext %s -output-prefix %t -bugpoint-crashcalls -silence-passes -disable-namedmd-remove -disable-strip-debuginfo -disable-strip-debug-types > /dev/null
+; RUN: bugpoint -load %llvmshlibdir/BugpointPasses%pluginext %s -output-prefix %t -bugpoint-crashcalls -silence-passes -disable-namedmd-remove -disable-strip-debuginfo -disable-strip-debug-types > /dev/null
 ; RUN: llvm-dis %t-reduced-simplified.bc -o - | FileCheck %s
 ;
-; RUN: bugpoint -load %llvmshlibdir/BugpointPasses%shlibext %s -output-prefix %t-nodebug -bugpoint-crashcalls -silence-passes -disable-namedmd-remove > /dev/null
+; RUN: bugpoint -load %llvmshlibdir/BugpointPasses%pluginext %s -output-prefix %t-nodebug -bugpoint-crashcalls -silence-passes -disable-namedmd-remove > /dev/null
 ; RUN: llvm-dis %t-nodebug-reduced-simplified.bc -o - | FileCheck %s --check-prefix=NODEBUG
 ;
-; RUN: bugpoint -load %llvmshlibdir/BugpointPasses%shlibext %s -output-prefix %t-notype -bugpoint-crashcalls -silence-passes -disable-namedmd-remove -disable-strip-debuginfo > /dev/null
+; RUN: bugpoint -load %llvmshlibdir/BugpointPasses%pluginext %s -output-prefix %t-notype -bugpoint-crashcalls -silence-passes -disable-namedmd-remove -disable-strip-debuginfo > /dev/null
 ; RUN: llvm-dis %t-notype-reduced-simplified.bc -o - | FileCheck %s --check-prefix=NOTYPE
 ;
 ; Bugpoint can drop the metadata on the call, as it does not contrinute to the crash.

diff  --git a/llvm/test/BugPoint/named-md.ll b/llvm/test/BugPoint/named-md.ll
index dbdb18e234a1..4f4ceb71597c 100644
--- a/llvm/test/BugPoint/named-md.ll
+++ b/llvm/test/BugPoint/named-md.ll
@@ -1,6 +1,6 @@
-; RUN: bugpoint -load %llvmshlibdir/BugpointPasses%shlibext %s -output-prefix %t -bugpoint-crash-too-many-cus -silence-passes -disable-strip-debuginfo > /dev/null
+; RUN: bugpoint -load %llvmshlibdir/BugpointPasses%pluginext %s -output-prefix %t -bugpoint-crash-too-many-cus -silence-passes -disable-strip-debuginfo > /dev/null
 ; RUN: llvm-dis %t-reduced-simplified.bc -o - | FileCheck %s
-; RUN-DISABLE: bugpoint -disable-namedmd-remove -load %llvmshlibdir/BugpointPasses%shlibext %s -output-prefix %t -bugpoint-crash-too-many-cus -silence-passes > /dev/null
+; RUN-DISABLE: bugpoint -disable-namedmd-remove -load %llvmshlibdir/BugpointPasses%pluginext %s -output-prefix %t -bugpoint-crash-too-many-cus -silence-passes > /dev/null
 ; RUN-DISABLE: llvm-dis %t-reduced-simplified.bc -o - | FileCheck %s
 ; REQUIRES: plugins
 

diff  --git a/llvm/test/BugPoint/remove_arguments_test.ll b/llvm/test/BugPoint/remove_arguments_test.ll
index 904c91788ce1..aaf12a193b6e 100644
--- a/llvm/test/BugPoint/remove_arguments_test.ll
+++ b/llvm/test/BugPoint/remove_arguments_test.ll
@@ -1,4 +1,4 @@
-; RUN: bugpoint -load %llvmshlibdir/BugpointPasses%shlibext %s -output-prefix %t -bugpoint-crashcalls -silence-passes
+; RUN: bugpoint -load %llvmshlibdir/BugpointPasses%pluginext %s -output-prefix %t -bugpoint-crashcalls -silence-passes
 ; RUN: llvm-dis %t-reduced-simplified.bc -o - | FileCheck %s
 ; REQUIRES: plugins
 

diff  --git a/llvm/test/BugPoint/replace-funcs-with-null.ll b/llvm/test/BugPoint/replace-funcs-with-null.ll
index 1de0d9e8e044..3bc4acd01b2a 100644
--- a/llvm/test/BugPoint/replace-funcs-with-null.ll
+++ b/llvm/test/BugPoint/replace-funcs-with-null.ll
@@ -1,6 +1,6 @@
 ; Test that bugpoint can reduce the set of functions by replacing them with null.
 ;
-; RUN: bugpoint -load %llvmshlibdir/BugpointPasses%shlibext %s -output-prefix %t -replace-funcs-with-null -bugpoint-crash-decl-funcs -silence-passes -safe-run-llc
+; RUN: bugpoint -load %llvmshlibdir/BugpointPasses%pluginext %s -output-prefix %t -replace-funcs-with-null -bugpoint-crash-decl-funcs -silence-passes -safe-run-llc
 ; REQUIRES: plugins
 
 @foo2 = alias i32 (), i32 ()* @foo

diff  --git a/llvm/test/BugPoint/retain-crashing-metadata.ll b/llvm/test/BugPoint/retain-crashing-metadata.ll
index ddceb807848e..756364190da5 100644
--- a/llvm/test/BugPoint/retain-crashing-metadata.ll
+++ b/llvm/test/BugPoint/retain-crashing-metadata.ll
@@ -1,5 +1,5 @@
 ; REQUIRES: plugins
-; RUN: bugpoint -load %llvmshlibdir/BugpointPasses%shlibext %s -output-prefix %t-notype -bugpoint-crashmetadata -silence-passes > /dev/null
+; RUN: bugpoint -load %llvmshlibdir/BugpointPasses%pluginext %s -output-prefix %t-notype -bugpoint-crashmetadata -silence-passes > /dev/null
 ; RUN: llvm-dis %t-notype-reduced-simplified.bc -o - | FileCheck %s
 ;
 ; Make sure BugPoint retains metadata contributing to a crash.

diff  --git a/llvm/test/BugPoint/unsymbolized.ll b/llvm/test/BugPoint/unsymbolized.ll
index 55aadc35884c..d0658b1b6b3a 100644
--- a/llvm/test/BugPoint/unsymbolized.ll
+++ b/llvm/test/BugPoint/unsymbolized.ll
@@ -2,9 +2,9 @@
 ; RUN: echo "import sys" > %t.py
 ; RUN: echo "print('args = ' + str(sys.argv))" >> %t.py
 ; RUN: echo "exit(1)" >> %t.py
-; RUN: not bugpoint -load %llvmshlibdir/BugpointPasses%shlibext %s -output-prefix %t -bugpoint-crashcalls -opt-command=%python -opt-args %t.py | FileCheck %s
-; RUN: not --crash opt -enable-new-pm=0 -load %llvmshlibdir/BugpointPasses%shlibext %s -bugpoint-crashcalls -disable-symbolication 2>&1 | FileCheck --check-prefix=CRASH %s
-; RUN: not bugpoint -load %llvmshlibdir/BugpointPasses%shlibext %s -output-prefix %t -bugpoint-crashcalls -opt-command=%t.non.existent.opt.binary -opt-args %t.py 2>&1 | FileCheck %s --check-prefix=BAD-OPT
+; RUN: not bugpoint -load %llvmshlibdir/BugpointPasses%pluginext %s -output-prefix %t -bugpoint-crashcalls -opt-command=%python -opt-args %t.py | FileCheck %s
+; RUN: not --crash opt -enable-new-pm=0 -load %llvmshlibdir/BugpointPasses%pluginext %s -bugpoint-crashcalls -disable-symbolication 2>&1 | FileCheck --check-prefix=CRASH %s
+; RUN: not bugpoint -load %llvmshlibdir/BugpointPasses%pluginext %s -output-prefix %t -bugpoint-crashcalls -opt-command=%t.non.existent.opt.binary -opt-args %t.py 2>&1 | FileCheck %s --check-prefix=BAD-OPT
 
 ; Test that bugpoint disables symbolication on the opt tool to reduce runtime overhead when opt crashes
 ; CHECK: args = {{.*}}'-disable-symbolication'

diff  --git a/llvm/test/lit.cfg.py b/llvm/test/lit.cfg.py
index 944276461be6..8b28c6b5be2f 100644
--- a/llvm/test/lit.cfg.py
+++ b/llvm/test/lit.cfg.py
@@ -88,6 +88,7 @@ def get_asan_rtlib():
 # Add site-specific substitutions.
 config.substitutions.append(('%llvmshlibdir', config.llvm_shlib_dir))
 config.substitutions.append(('%shlibext', config.llvm_shlib_ext))
+config.substitutions.append(('%pluginext', config.llvm_plugin_ext))
 config.substitutions.append(('%exeext', config.llvm_exe_ext))
 
 

diff  --git a/llvm/test/lit.site.cfg.py.in b/llvm/test/lit.site.cfg.py.in
index 37080f923694..a42ccc93800a 100644
--- a/llvm/test/lit.site.cfg.py.in
+++ b/llvm/test/lit.site.cfg.py.in
@@ -10,6 +10,7 @@ config.llvm_tools_dir = path(r"@LLVM_TOOLS_DIR@")
 config.llvm_lib_dir = path(r"@LLVM_LIBS_DIR@")
 config.llvm_shlib_dir = path(r"@SHLIBDIR@")
 config.llvm_shlib_ext = "@SHLIBEXT@"
+config.llvm_plugin_ext = "@LLVM_PLUGIN_EXT@"
 config.llvm_exe_ext = "@EXEEXT@"
 config.lit_tools_dir = path(r"@LLVM_LIT_TOOLS_DIR@")
 config.errc_messages = "@LLVM_LIT_ERRC_MESSAGES@"

diff  --git a/llvm/unittests/Passes/PluginsTest.cpp b/llvm/unittests/Passes/PluginsTest.cpp
index e250f1967de8..62334c828cb4 100644
--- a/llvm/unittests/Passes/PluginsTest.cpp
+++ b/llvm/unittests/Passes/PluginsTest.cpp
@@ -33,7 +33,7 @@ static std::string LibPath(const std::string Name = "TestPlugin") {
   void *Ptr = (void *)(intptr_t)anchor;
   std::string Path = sys::fs::getMainExecutable(Argv0, Ptr);
   llvm::SmallString<256> Buf{sys::path::parent_path(Path)};
-  sys::path::append(Buf, (Name + LTDL_SHLIB_EXT).c_str());
+  sys::path::append(Buf, (Name + LLVM_PLUGIN_EXT).c_str());
   return std::string(Buf.str());
 }
 


        


More information about the llvm-commits mailing list