| Index: tests/toolchain/nacl.scons
|
| diff --git a/tests/toolchain/nacl.scons b/tests/toolchain/nacl.scons
|
| index c5b370f082fbfae9c5efbdcb6f7e5b692c84a916..376bbd4bc21a3e8b34f0b2424feb35a18a786039 100644
|
| --- a/tests/toolchain/nacl.scons
|
| +++ b/tests/toolchain/nacl.scons
|
| @@ -26,12 +26,20 @@ if env.Bit('bitcode'):
|
| env.Append(CCFLAGS=['-allow-asm'])
|
|
|
| # Test C++11 code with both supported C++ standard libraries.
|
| -cpp11_libs = ['libstdc++', 'libc++']
|
| +cpp11_libs = ['libc++']
|
| +if env.Bit('bitcode'):
|
| + # PNaCl still supports libstdc++ but nacl-clang does not.
|
| + cpp11_libs.append('libstdc++')
|
| cpp11_envs = {}
|
| for lib in cpp11_libs:
|
| cpp11_envs[lib] = env.Clone()
|
| cpp11_envs[lib].Append(CCFLAGS=['-std=c++11', '-stdlib=' + lib])
|
| cpp11_envs[lib].Append(LINKFLAGS=['-stdlib=' + lib])
|
| + if lib == 'libstdc++':
|
| + # c++ is added to NONIRT_LIBS for clang to ensure that its dependence on
|
| + # pthreads can be satisfied by pthread_private instead of pthread. Filter it
|
| + # out here to ensure that we use libstdc++.
|
| + cpp11_envs[lib].FilterOut(NONIRT_LIBS=['c++'])
|
|
|
| # All the libraries were already included via -l switches in LINKFLAGS.
|
| # But we use them again in LIBS so scons knows about the dependencies.
|
| @@ -80,7 +88,7 @@ AddIntrinsicTest(env, 'synchronization_sync.c', '0',
|
| not env.Bit('bitcode')) or
|
| env.IsRunningUnderValgrind()))
|
| AddIntrinsicTest(env, 'synchronization_volatile.c', '0')
|
| -if env.Bit('bitcode'):
|
| +if env.Bit('bitcode') or env.Bit('nacl_clang'):
|
| # The following tests were only made to work on LLVM for
|
| # PNaCl. Command-line flags and libraries need to be updated for GCC
|
| # support.
|
| @@ -103,7 +111,7 @@ if env.Bit('bitcode'):
|
|
|
| # This test redirects C function calls to llvm instrinsic functions,
|
| # so they only work w/ PNaCl.
|
| -if env.Bit('bitcode'):
|
| +if env.Bit('bitcode') or env.Bit('nacl_clang'):
|
| AddIntrinsicTest(env, 'llvm_bitmanip_intrinsics.c', '0',
|
| golden_file=env.File('llvm_bitmanip_intrinsics.stdout'))
|
| AddIntrinsicTest(env, 'llvm_math_intrinsics.c', '0',
|
| @@ -242,6 +250,7 @@ def MakeEnv(env, use_opts, use_frames):
|
| EH_ENVIRONMENTS_TO_TRY = []
|
|
|
| base_eh_env = env.Clone()
|
| +
|
| supports_cxx11 = env.Bit('bitcode') or env.Bit('target_arm')
|
| base_eh_env.Append(CPPDEFINES=[['SUPPORTS_CXX11', str(int(supports_cxx11))]])
|
| if supports_cxx11:
|
| @@ -255,6 +264,11 @@ if env.Bit('bitcode') and env['TOOLCHAIN_FEATURE_VERSION'] >= 1:
|
| sjlj_eh_env.Append(LINKFLAGS=['--pnacl-exceptions=sjlj',
|
| '-stdlib=%s' % lib])
|
| sjlj_eh_env.Append(CCFLAGS=['-stdlib=%s' % lib])
|
| + # c++ is added to NONIRT_LIBS for clang to ensure that its dependence on
|
| + # pthreads can be satisfied by pthread_private instead of pthread. Filter it
|
| + # out here to ensure that we use libstdc++.
|
| + if lib == 'libstdc++':
|
| + sjlj_eh_env.FilterOut(NONIRT_LIBS=['c++'])
|
| EH_ENVIRONMENTS_TO_TRY.append(('sjlj_%s' % lib, sjlj_eh_env))
|
|
|
| if env.Bit('bitcode'):
|
|
|