[cfe-dev] Clang unit test failure / Windows

Robinson, Paul Paul_Robinson at playstation.sony.com
Thu May 7 08:54:23 PDT 2015

The "make clang-test" should have given you a report listing the filenames of the tests that failed.
In the same directory where you find the clang that you just built, there should also be a program named llvm-lit.
If you run that llvm-lit with an argument that is the filename of one of the tests that failed, it should run just that test. With the –v option you will also get more details about why it failed.
(The name you pass to llvm-lit needs to be a proper path relative to your current directory, i.e. if "dir path\to\test" works, then "my-build-dir\llvm-lit path\to\test" should also work.)

From: cfe-dev-bounces at cs.uiuc.edu [mailto:cfe-dev-bounces at cs.uiuc.edu] On Behalf Of barbara
Sent: Thursday, May 07, 2015 8:35 AM
To: Yaron Keren
Cc: cfe-dev at cs.uiuc.edu Developers
Subject: Re: [cfe-dev] Clang unit test failure / Windows

Good to know there should not be any errors running the clang-tests.  I am worried that since I do not have VS installed clang is depending on some specific MS header or dll.

Sadly, I am not a clang expert and there are so many test failing that I am not sure which one to run. All I could find was "make clang-test".  If someone can give me just a hint of how to run a specific test maybe I can post the result?


I see no unexpected failures. With that many tests failing, it's very likely all fail for the same reason, so please try running any of the failing tests with -v argument and looking into why it fails.

2015-05-07 8:29 GMT+03:00 barbara <barbara at copperspice.com<mailto:barbara at copperspice.com>>:
I tried building again from scratch and had to restart make three times. This time I did not alter either of the two makefiles. I am bewildered why there would be issues with the generated makefiles. This seems likes an issue.

Clang built, but again there are 268 clang-test failures.  I checked and msys is the first entry in my path. I am very confused and sadly since so many tests fail I have no idea where to start looking.  I am guessing you have zero "unexpected failures"?

Is there anything else you or someone can suggest? I know this should work so there has to be some set up, cmake, or make problem I am missing.


I am running the clang and LLVM tests. There is also a buildbot running them after every revision.
That MSYS should work. My experience was that you need to run make twice but not edit any file.
My guess is that you may have a non-msys grep or other utility on the PATH before the msys bin dir so it runs instead.
Try to put the msys/bin as the first directory in the PATH and restart the command window.
You can try running one of the failing tests with -v argument and looking into why it fails.

The bug tracker is at


if you can provide a patch (fix) for the build problem please do.

2015-05-05 23:31 GMT+03:00 barbara <barbara at copperspice.com<mailto:barbara at copperspice.com>>:

I am using MSYS which I downloaded from here:

I do not believe this is MSYS2. Is there a difference and if so, could this be my entire issues?

Have you built clang and run the "clang-tests" on Windows?

Is there anyone in clang development that would be interested in the erroneous make files and the Windows problems? I would be fine submitting bug reports if I knew this might be worked on.  If someone can advise me which bug tracker to use I will gladly post something.



On 5/5/2015 9:54 AM, Yaron Keren wrote:
I have seen the export problem. As you say it resolved itself after restarting the make.
You need mingw gcc 4.8 at least. mingw-w64 and all tools versions sounds OK.
compiler-rt not required.

Are you using MSYS2 for the shell functionality?

2015-05-05 20:42 GMT+03:00 barbara <barbara at copperspice.com<mailto:barbara at copperspice.com>>:

Thanks for your response. Unfortunately this did not resolve the issue.

I am extremely confused and unable to find the correct combination to build libclang.dll and libclang.dll.a for for Windows 32-bit and Windows 64-bit.  There are multiple sets of directions and sadly they do not agree with each other.

I have tried the -G "Unix MakeFiles",   -G "MSYS Makefiles" ,  and -G "Mingw Makefiles"  so far.  All three produce the dll and .a files.

a)    However, the build requires hand changes to two makefiles due to backslash problems.  I am unable to find out if this is a know bug or not.

b)    The build crashes around 98% saying it is unable to find the libclang-exports. If I restart the build it completes successfully. This feels like a dependency order problem.

c)    After building, no matter which cmake setup I use, the "make clang-test" fails with just over 260 Unexpected Failures. Is there any known problem with these tests on Windows?

I need a version of clang which is not compiled with MSVC.  I have tried gcc 4.7.2 and gcc 4.8.1 (MinGW-W64).  I am using Python 2.7.9. CMake version 3.2.2 and GNU Make 3.82.90.

On some sets of the instructions there is an indication I need to install compiler-rt, which I have not done.  This was not required for the very simple build on Debian which worked flawlessly.  Is this required?

I was told clang is being supported on Windows so I strongly believe some combination of what I am doing is not correct and I am out of ideas. I am grateful for any suggestions, ideas, or information about how to build clang and have this work.


On 5/4/2015 7:16 PM, Yaron Keren wrote:

1 Use  -G "Unix Makefiles"
2 Do not use MSYS 2, lots of the tests fail.


2015-05-05 5:50 GMT+03:00 barbara <barbara at copperspice.com<mailto:barbara at copperspice.com>>:
I downloaded clang 3.6 and built on Windows Vista using MinGW 4.8.1 and CMake 3.2.2

1    ran: cmake -G "MSYS Makefiles" ../llvm

2    There are two generated  make files which have backslash problems around line 54. These were simple to edit by hand however I believe this should not be required.

(a)  tools/lto/CMakeFiles/LTO_exports.dir/build.make
(b) tools/clang/tools/libclang/CMakeFiles/libclang_exports.dir/build.make

3    clang builds, however it must be restarted a few times.

4    After the build was done I ran clang-test and it failed with 269 unexpected failures.

5    Linking libclang with our application appears to work. At run time, calling "clang_parseTranslationUnit2()" returns an extremely large number for the error code.

I am happy to try any suggestions.


cfe-dev mailing list
cfe-dev at cs.uiuc.edu<mailto:cfe-dev at cs.uiuc.edu>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150507/b42aa9ed/attachment.html>

More information about the cfe-dev mailing list