@@ -242,6 +242,7 @@ def test_llvm_fastcomp(self):
242
242
output = self .check_working (EMCC , 'did not see a source tree above or next to the LLVM root directory' )
243
243
244
244
VERSION_WARNING = 'Emscripten, llvm and clang repo versions do not match, this is dangerous'
245
+ BUILD_VERSION_WARNING = 'Emscripten, llvm and clang build versions do not match, this is dangerous'
245
246
246
247
# add version number
247
248
open (path_from_root ('tests' , 'fake' , 'emscripten-version.txt' ), 'w' ).write ('waka' )
@@ -263,6 +264,23 @@ def test_llvm_fastcomp(self):
263
264
try_delete (SANITY_FILE )
264
265
output = self .check_working (EMCC , VERSION_WARNING )
265
266
267
+ # restore clang version to ok, and fake the *build* versions
268
+ open (path_from_root ('tests' , 'fake' , 'tools' , 'clang' , 'emscripten-version.txt' ), 'w' ).write (EMSCRIPTEN_VERSION )
269
+ output = self .check_working (EMCC )
270
+ assert VERSION_WARNING not in output
271
+ fake = '#!/bin/sh\n echo "clang version %s (blah blah) (emscripten waka : waka)"\n echo "..."\n ' % '.' .join (map (str , EXPECTED_LLVM_VERSION ))
272
+ open (path_from_root ('tests' , 'fake' , 'bin' , 'clang' ), 'w' ).write (fake )
273
+ open (path_from_root ('tests' , 'fake' , 'bin' , 'clang++' ), 'w' ).write (fake )
274
+ os .chmod (path_from_root ('tests' , 'fake' , 'bin' , 'clang' ), stat .S_IREAD | stat .S_IWRITE | stat .S_IEXEC )
275
+ os .chmod (path_from_root ('tests' , 'fake' , 'bin' , 'clang++' ), stat .S_IREAD | stat .S_IWRITE | stat .S_IEXEC )
276
+ try_delete (SANITY_FILE )
277
+ output = self .check_working (EMCC , BUILD_VERSION_WARNING )
278
+ assert VERSION_WARNING not in output
279
+ # break clang repo version again, see it hides the build warning
280
+ open (path_from_root ('tests' , 'fake' , 'tools' , 'clang' , 'emscripten-version.txt' ), 'w' ).write ('waka' )
281
+ output = self .check_working (EMCC , VERSION_WARNING )
282
+ assert BUILD_VERSION_WARNING not in output
283
+
266
284
restore ()
267
285
268
286
self .check_working ([EMCC , 'tests/hello_world.cpp' , '-s' , 'ASM_JS=0' ], '''Compiler settings are incompatible with fastcomp. You can fall back to the older compiler core, although that is not recommended''' )
0 commit comments