llvm.org GIT mirror llvm / b10b158
Don't try to run MCJIT/OrcJIT EH tests when C++ library is statically linked These tests assumes availability of external symbols provided by the C++ library, but those won't be available in case when the C++ library is statically linked because lli itself doesn't need these. This uses llvm-readobj -needed-libs to check if C++ library is linked as shared library and exposes that information as a feature to lit. Differential Revision: https://reviews.llvm.org/D41272 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321981 91177308-0d34-0410-b5e6-96231b3b80d8 Petr Hosek 2 years ago
9 changed file(s) with 38 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 ; REQUIRES: cxx-shared-library
1 ; RUN: %lli -relocation-model=pic -code-model=large %s
12 ; XFAIL: cygwin, win32, mingw, mips-, mipsel-, i686, i386, aarch64, arm
23 declare i8* @__cxa_allocate_exception(i64)
0 ; REQUIRES: cxx-shared-library
1 ; RUN: %lli %s
12 ; XFAIL: arm, cygwin, win32, mingw
23 declare i8* @__cxa_allocate_exception(i64)
0 ; REQUIRES: cxx-shared-library
1 ; RUN: %lli -extra-module=%p/Inputs/multi-module-eh-b.ll %s
12 ; XFAIL: arm, cygwin, win32, mingw
23 declare i8* @__cxa_allocate_exception(i64)
0 ; REQUIRES: cxx-shared-library
1 ; RUN: %lli -remote-mcjit -mcjit-remote-process=lli-child-target%exeext %s
12 ; XFAIL: arm, cygwin, win32, mingw
23 ; UNSUPPORTED: powerpc64-unknown-linux-gnu
0 ; REQUIRES: cxx-shared-library
1 ; RUN: %lli -jit-kind=orc-mcjit -relocation-model=pic -code-model=large %s
12 ; XFAIL: cygwin, win32, mingw, mips-, mipsel-, i686, i386, aarch64, arm
23 declare i8* @__cxa_allocate_exception(i64)
0 ; REQUIRES: cxx-shared-library
1 ; RUN: %lli -jit-kind=orc-mcjit %s
12 ; XFAIL: arm, cygwin, win32, mingw
23 declare i8* @__cxa_allocate_exception(i64)
0 ; REQUIRES: cxx-shared-library
1 ; RUN: %lli -jit-kind=orc-mcjit -extra-module=%p/Inputs/multi-module-eh-b.ll %s
12 ; XFAIL: arm, cygwin, win32, mingw
23 declare i8* @__cxa_allocate_exception(i64)
0 ; REQUIRES: cxx-shared-library
1 ; RUN: %lli -remote-mcjit -mcjit-remote-process=lli-child-target%exeext %s
12 ; XFAIL: arm, cygwin, win32, mingw
23 ; UNSUPPORTED: powerpc64-unknown-linux-gnu
193193 if not config.build_shared_libs and not config.link_llvm_dylib:
194194 config.available_features.add('static-libs')
195195
196 def have_cxx_shared_library():
197 readobj_exe = lit.util.which('llvm-readobj', config.llvm_tools_dir)
198 if not readobj_exe:
199 print('llvm-readobj not found')
200 return False
201
202 try:
203 readobj_cmd = subprocess.Popen(
204 [readobj_exe, '-needed-libs', readobj_exe], stdout=subprocess.PIPE)
205 except OSError:
206 print('could not exec llvm-readobj')
207 return False
208
209 readobj_out = readobj_cmd.stdout.read().decode('ascii')
210 readobj_cmd.wait()
211
212 regex = re.compile(r'(libc\+\+|libstdc\+\+|msvcp).*\.(so|dylib|dll)')
213 needed_libs = False
214 for line in readobj_out.splitlines():
215 if 'NeededLibraries [' in line:
216 needed_libs = True
217 if ']' in line:
218 needed_libs = False
219 if needed_libs and regex.search(line.lower()):
220 return True
221 return False
222
223 if have_cxx_shared_library():
224 config.available_features.add('cxx-shared-library')
225
196226 # Direct object generation
197227 if not 'hexagon' in config.target_triple:
198228 config.available_features.add('object-emission')