aboutsummaryrefslogtreecommitdiff
path: root/test/cfi
diff options
context:
space:
mode:
authorPirama Arumuga Nainar <pirama@google.com>2015-07-01 12:26:56 -0700
committerStephen Hines <srhines@google.com>2015-08-13 13:33:03 -0700
commitcdce50bda3603770cc4ef80cbb613c78b8e47a17 (patch)
tree671adfff40ebd375143df646ff9030936fb4f4ae /test/cfi
parent779923ae7782a8a7f62b0bc2b2282c136a5a34b9 (diff)
downloadcompiler-rt-cdce50bda3603770cc4ef80cbb613c78b8e47a17.tar.gz
Update aosp/master compiler-rt for rebase to r239765
Change-Id: I722dcde07e4f76a8a35ca701d89be5f311840e74
Diffstat (limited to 'test/cfi')
-rw-r--r--test/cfi/bad-cast.cpp1
-rw-r--r--test/cfi/lit.cfg25
2 files changed, 2 insertions, 24 deletions
diff --git a/test/cfi/bad-cast.cpp b/test/cfi/bad-cast.cpp
index 39d8a351b..712262d13 100644
--- a/test/cfi/bad-cast.cpp
+++ b/test/cfi/bad-cast.cpp
@@ -61,7 +61,6 @@
// Tests that the CFI enforcement detects bad casts.
#include <stdio.h>
-#include <utility>
#include "utils.h"
struct A {
diff --git a/test/cfi/lit.cfg b/test/cfi/lit.cfg
index 204d332a2..2343ff190 100644
--- a/test/cfi/lit.cfg
+++ b/test/cfi/lit.cfg
@@ -1,36 +1,15 @@
import lit.formats
import os
-import subprocess
-import sys
config.name = 'cfi'
config.suffixes = ['.cpp']
config.test_source_root = os.path.dirname(__file__)
-def is_darwin_lto_supported():
- return os.path.exists(os.path.join(config.llvm_shlib_dir, 'libLTO.dylib'))
-
-def is_linux_lto_supported():
- if not os.path.exists(os.path.join(config.llvm_shlib_dir, 'LLVMgold.so')):
- return False
-
- ld_cmd = subprocess.Popen([config.gold_executable, '--help'], stdout = subprocess.PIPE)
- ld_out = ld_cmd.stdout.read().decode()
- ld_cmd.wait()
-
- if not '-plugin' in ld_out:
- return False
-
- return True
-
clangxx = ' '.join([config.clang] + config.cxx_mode_flags)
config.substitutions.append((r"%clangxx ", clangxx + ' '))
-
-if sys.platform == 'darwin' and is_darwin_lto_supported():
- config.substitutions.append((r"%clangxx_cfi ", 'env DYLD_LIBRARY_PATH=' + config.llvm_shlib_dir + ' ' + clangxx + ' -fsanitize=cfi '))
-elif sys.platform.startswith('linux') and is_linux_lto_supported():
- config.substitutions.append((r"%clangxx_cfi ", clangxx + ' -fuse-ld=gold -fsanitize=cfi '))
+if config.lto_supported:
+ config.substitutions.append((r"%clangxx_cfi ", ' '.join(config.lto_launch + [clangxx] + config.lto_flags + ['-fsanitize=cfi '])))
else:
config.unsupported = True