summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Dean <david_dean@apple.com>2013-07-11 23:37:50 +0000
committerDavid Dean <david_dean@apple.com>2013-07-11 23:37:50 +0000
commit9b9c78a9299a27802d431d92c36d4d55c37ae93f (patch)
treeaf878b4aca82b9bde8f9520c8e2b0626b160d508
parentf3ed6561898cffad14c3b6d775c96349db32e81f (diff)
downloadbcm5719-llvm-9b9c78a9299a27802d431d92c36d4d55c37ae93f.tar.gz
bcm5719-llvm-9b9c78a9299a27802d431d92c36d4d55c37ae93f.zip
Add the ability to use guarded malloc when running clang's lit tests.
llvm-svn: 186135
-rw-r--r--clang/test/lit.cfg20
1 files changed, 20 insertions, 0 deletions
diff --git a/clang/test/lit.cfg b/clang/test/lit.cfg
index bf8528b3f68..7bc6321a7f8 100644
--- a/clang/test/lit.cfg
+++ b/clang/test/lit.cfg
@@ -317,3 +317,23 @@ if (config.llvm_use_sanitizer == "Memory" or
# Check if we should run long running tests.
if lit.params.get("run_long_tests", None) == "true":
config.available_features.add("long_tests")
+
+# Check if we should use gmalloc.
+use_gmalloc_str = lit.params.get('use_gmalloc', None)
+if use_gmalloc_str is not None:
+ if use_gmalloc_str.lower() in ('1', 'true'):
+ use_gmalloc = True
+ elif use_gmalloc_str.lower() in ('', '0', 'false'):
+ use_gmalloc = False
+ else:
+ lit.fatal('user parameter use_gmalloc should be 0 or 1')
+else:
+ # Default to not using gmalloc
+ use_gmalloc = False
+
+# Allow use of an explicit path for gmalloc library.
+# Will default to '/usr/lib/libgmalloc.dylib' if not set.
+gmalloc_path_str = lit.params.get('gmalloc_path', '/usr/lib/libgmalloc.dylib')
+
+if use_gmalloc:
+ config.environment.update({'DYLD_INSERT_LIBRARIES' : gmalloc_path_str})
OpenPOWER on IntegriCloud