[PATCH] Add test suite for the Control Flow Integrity feature.

Alexey Samsonov vonosmas at gmail.com
Thu Feb 19 17:58:08 PST 2015


================
Comment at: test/cfi/CMakeLists.txt:11
@@ +10,3 @@
+    clang
+    LLVMgold
+    not
----------------
Would this work if LLVM_BINUTILS_INCDIR is unavailable?

================
Comment at: test/cfi/lit.cfg:8
@@ +7,3 @@
+config.suffixes = ['.cpp']
+config.test_format = lit.formats.ShTest()
+config.test_source_root = config.compiler_rt_src_root + '/test/cfi'
----------------
This should be set in test/lit.common.cfg

================
Comment at: test/cfi/lit.cfg:9
@@ +8,3 @@
+config.test_format = lit.formats.ShTest()
+config.test_source_root = config.compiler_rt_src_root + '/test/cfi'
+config.test_exec_root = config.compiler_rt_obj_root + '/test/cfi'
----------------
  os.path.dirname(__file__)
?

================
Comment at: test/cfi/lit.cfg:10
@@ +9,3 @@
+config.test_source_root = config.compiler_rt_src_root + '/test/cfi'
+config.test_exec_root = config.compiler_rt_obj_root + '/test/cfi'
+config.excludes = ['Inputs']
----------------
You probably don't need test_exec_root here.

================
Comment at: test/cfi/lit.cfg:11
@@ +10,3 @@
+config.test_exec_root = config.compiler_rt_obj_root + '/test/cfi'
+config.excludes = ['Inputs']
+
----------------
There is no such directory at the moment

================
Comment at: test/cfi/lit.cfg:29
@@ +28,3 @@
+
+config.substitutions.append((r"%clangxx ", config.llvm_obj_root + '/bin/clang++ '))
+
----------------
We have config.clang for that

================
Comment at: test/cfi/lit.cfg:32
@@ +31,3 @@
+if sys.platform == 'darwin' and is_darwin_lto_supported():
+  config.substitutions.append((r"%clangxx_cfi ", 'env DYLD_LIBRARY_PATH=' + config.llvm_shlib_dir + ' ' + config.llvm_obj_root + '/bin/clang++ -fsanitize=cfi '))
+elif sys.platform.startswith('linux') and is_linux_lto_supported():
----------------
ditto

================
Comment at: test/cfi/lit.cfg:38
@@ +37,3 @@
+
+config.substitutions.append((r"\bFileCheck\b", config.llvm_obj_root + '/bin/FileCheck'))
+config.substitutions.append((r"\bnot\b", config.llvm_obj_root + '/bin/not'))
----------------
This should be handled by lit.common.cfg as well: we add llvm_tools_dir to PATH

http://reviews.llvm.org/D7738

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list