Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / native_client / tests / simd / nacl.scons
index 4b0436c..364f19b 100644 (file)
@@ -23,6 +23,7 @@ def AddTest(env, src, exit_status='0', golden_file=None, test_suffix='',
       node, ['toolchain_tests', 'small_tests'], 'run_' + name + '_test',
       is_broken=is_broken)
 
+c_flags = ['-std=gnu99']
 cxx_flags = (['-Wc++11-narrowing', '-std=gnu++11']
              if env.Bit('bitcode') else ['-std=gnu++0x'])
 
@@ -37,13 +38,29 @@ elif env.Bit('target_arm'):
   native_flags = ['--target=armv7a-unknown-nacl-gnueabi','-mfloat-abi=hard']
 elif env.Bit('target_mips32'):
   native_flags = []
-native_env.Append(CCFLAGS=native_flags + cxx_flags)
+native_env.Append(CFLAGS=c_flags)
+native_env.Append(CXXFLAGS=cxx_flags)
+native_env.Append(CCFLAGS=native_flags)
+# C++ code can't use vector literals because of the following warning:
+#   compound literals are a C99-specific feature
+# Remove pedantic to work around this issue.
+native_env.FilterOut(CCFLAGS=['-pedantic'])
 
 ref_env = env.Clone()
 ref_flags = ['-DVREFIMPL']
-ref_env.Append(CCFLAGS=ref_flags + cxx_flags)
+ref_env.Append(CFLAGS=c_flags)
+ref_env.Append(CXXFLAGS=cxx_flags)
+ref_env.Append(CCFLAGS=ref_flags)
 
 # TODO(jfb): The native environment currently doesn't compile.
 if env.Bit('bitcode'):
   AddTest(native_env, 'simd.cc', test_suffix='_native')
 AddTest(ref_env, 'simd.cc', test_suffix='_ref')
+
+# GCC 4.4 doesn't support all features of the vector extensions in C.
+# TODO(jfb) Re-enable testing when we migrate to a newer GCC.
+if env.Bit('bitcode') and env['TOOLCHAIN_FEATURE_VERSION'] >= 5:
+  AddTest(native_env, 'vector_extension.c',
+          golden_file=native_env.File('vector_extension.stdout'))
+  AddTest(native_env, 'vector_shuffle.cc',
+          golden_file=native_env.File('vector_shuffle.stdout'))