[PATCH] D49432: [compiler-rt] Add NewPM testing to CFI tests

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 17 09:50:59 PDT 2018


tejohnson created this revision.
tejohnson added a reviewer: pcc.
Herald added subscribers: Sanitizers, dexonsmith, delcypher, mehdi_amini, mgorny, dberris.

Executes both LTO and ThinLTO CFI tests an additional time using the new
pass manager. I only bothered to add with gold and not lld as testing
with one linker should be sufficient. I didn't add for APPLE or WIN32
since I don't have a way to test those.

Depends on https://reviews.llvm.org/D49429.


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D49432

Files:
  test/cfi/CMakeLists.txt
  test/cfi/lit.site.cfg.in
  test/lit.common.cfg
  test/lit.common.configured.in


Index: test/lit.common.configured.in
===================================================================
--- test/lit.common.configured.in
+++ test/lit.common.configured.in
@@ -34,6 +34,7 @@
 set_default("use_lld", False)
 set_default("use_thinlto", False)
 set_default("use_lto", config.use_thinlto)
+set_default("use_newpm", False)
 set_default("android", @ANDROID_PYBOOL@)
 config.available_features.add('target-is-%s' % config.target_arch)
 
Index: test/lit.common.cfg
===================================================================
--- test/lit.common.cfg
+++ test/lit.common.cfg
@@ -317,6 +317,9 @@
   else:
     config.lto_flags += ["-flto"]
 
+if config.use_newpm:
+  config.lto_flags += ["-fexperimental-new-pass-manager"]
+
 # Ask llvm-config about assertion mode.
 try:
   llvm_config_cmd = subprocess.Popen(
Index: test/cfi/lit.site.cfg.in
===================================================================
--- test/cfi/lit.site.cfg.in
+++ test/cfi/lit.site.cfg.in
@@ -7,6 +7,7 @@
 config.use_lld = @CFI_TEST_USE_LLD@
 config.use_lto = True # CFI *requires* LTO.
 config.use_thinlto = @CFI_TEST_USE_THINLTO@
+config.use_newpm = @CFI_TEST_USE_NEWPM@
 
 lit_config.load_config(config, "@COMPILER_RT_BINARY_DIR@/test/lit.common.configured")
 lit_config.load_config(config, "@CMAKE_CURRENT_SOURCE_DIR@/lit.cfg")
Index: test/cfi/CMakeLists.txt
===================================================================
--- test/cfi/CMakeLists.txt
+++ test/cfi/CMakeLists.txt
@@ -1,17 +1,21 @@
 set(CFI_TESTSUITES)
 
-macro (add_cfi_test_suites lld thinlto)
+macro (add_cfi_test_suites lld thinlto newpm)
   set(suffix)
   if (${lld})
     set(suffix ${suffix}-lld)
   endif()
   if (${thinlto})
     set(suffix ${suffix}-thinlto)
   endif()
+  if (${newpm})
+    set(suffix ${suffix}-newpm)
+  endif()
   set(suffix ${suffix}-${CFI_TEST_TARGET_ARCH})
 
   set(CFI_TEST_USE_LLD ${lld})
   set(CFI_TEST_USE_THINLTO ${thinlto})
+  set(CFI_TEST_USE_NEWPM ${newpm})
 
   set(CFI_LIT_TEST_MODE Standalone)
   set(CFI_TEST_CONFIG_SUFFIX -standalone${suffix})
@@ -40,16 +44,18 @@
   get_test_cc_for_arch(${arch} CFI_TEST_TARGET_CC CFI_TEST_TARGET_CFLAGS)
   if (APPLE)
     # FIXME: enable ThinLTO tests after fixing http://llvm.org/pr32741
-    add_cfi_test_suites(False False)
+    add_cfi_test_suites(False False False)
   elseif(WIN32)
-    add_cfi_test_suites(True False)
-    add_cfi_test_suites(True True)
+    add_cfi_test_suites(True False False)
+    add_cfi_test_suites(True True False)
   else()
-    add_cfi_test_suites(False False)
-    add_cfi_test_suites(False True)
+    add_cfi_test_suites(False False False)
+    add_cfi_test_suites(False True False)
+    add_cfi_test_suites(False False True)
+    add_cfi_test_suites(False True True)
     if (COMPILER_RT_HAS_LLD AND NOT arch STREQUAL "i386")
-      add_cfi_test_suites(True False)
-      add_cfi_test_suites(True True)
+	    add_cfi_test_suites(True False False)
+	    add_cfi_test_suites(True True False)
     endif()
   endif()
 endforeach()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49432.155907.patch
Type: text/x-patch
Size: 3013 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180717/9318a9e4/attachment.bin>


More information about the llvm-commits mailing list