[llvm-commits] [patch] Fix some tests when --disable-threads is used

Dimitry Andric dimitry at andric.com
Thu Mar 3 07:15:21 PST 2011


If you configure llvm with --disable-threads, the following tests will
always fail:

     LLVM-Unit :: VMCore/Release+Asserts/VMCoreTests/ValueMapTest/0.LocksMutex
     LLVM-Unit :: VMCore/Release+Asserts/VMCoreTests/ValueMapTest/1.LocksMutex
     LLVM-Unit :: VMCore/Release+Asserts/VMCoreTests/ValueMapTest/2.LocksMutex

This is because the tests attempt to acquire a mutex, and expect it to
fail, but all mutex functions simply return true when --disable-threads
is used.

Fix this by adding some #if guards around the tests.  While here, change
"#if ENABLE_THREADS" to "#if defined(ENABLE_THREADS) || ENABLE_THREADS
== 1", which works better when ENABLE_THREADS is not defined at all.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: fix-valuemaptest-disable-threads.diff
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110303/6ac2618a/attachment.ksh>


More information about the llvm-commits mailing list