git clone llvm ......cd llvm/toolsgit clone clang .....cd ../../mkdir buildcd buildcmake ../llvmninja check-clang./bin/llvm-lit -v ./tools/clang/test/Sema/asm.c
_______________________________________________
LLVM Developers mailing list
llvm...@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Hi Amara,
yes, that sounds reasonable.
I looked into my old build_llvm-toolchain.sh script and adapted it to
build only the necessary stuff (see below).
First, I thought I can reduce build-time by...
sdi@iniza:~/src/llvm-toolchain/build$ ninja check-llvm-tools-llvm-lit
[1808/1809] Running lit suite
/home/sdi/src/llvm-toolchain/llvm/test/tools/llvm-lit
Testing Time: 0.11s
Expected Failures : 1
The test runs with some warnings...
sdi@iniza:~/src/llvm-toolchain/build$ ./bin/llvm-lit -v
./tools/clang/test/Sema/asm.c
llvm-lit: /home/sdi/src/llvm-toolchain/llvm/utils/lit/lit/llvm/config.py:334:
note: using clang: /usr/bin/clang
llvm-lit: /home/sdi/src/llvm-toolchain/llvm/utils/lit/lit/llvm/subst.py:126:
note: Did not find c-index-test in
/home/sdi/src/llvm-toolchain/build/./bin:/home/sdi/src/llvm-toolchain/build/./bin
llvm-lit: /home/sdi/src/llvm-toolchain/llvm/utils/lit/lit/llvm/subst.py:126:
note: Did not find clang-check in
/home/sdi/src/llvm-toolchain/build/./bin:/home/sdi/src/llvm-toolchain/build/./bin
llvm-lit: /home/sdi/src/llvm-toolchain/llvm/utils/lit/lit/llvm/subst.py:126:
note: Did not find clang-diff in
/home/sdi/src/llvm-toolchain/build/./bin:/home/sdi/src/llvm-toolchain/build/./bin
llvm-lit: /home/sdi/src/llvm-toolchain/llvm/utils/lit/lit/llvm/subst.py:126:
note: Did not find clang-format in
/home/sdi/src/llvm-toolchain/build/./bin:/home/sdi/src/llvm-toolchain/build/./bin
-- Testing: 1 tests, 1 threads --
PASS: Clang :: Sema/asm.c (1 of 1)
Testing Time: 0.11s
Expected Passes : 1
... but it looks like stuff is missing, so I did...
sdi@iniza:~/src/llvm-toolchain/build$ ninja check-clang
[1012/1013] Running the Clang regression tests
llvm-lit: /home/sdi/src/llvm-toolchain/llvm/utils/lit/lit/llvm/config.py:334:
note: using clang: /home/sdi/src/llvm-toolchain/build/bin/clang
Testing Time: 200.66s
Expected Passes : 12028
Expected Failures : 18
Unsupported Tests : 256
sdi@iniza:~/src/llvm-toolchain/build$ ./bin/llvm-lit -v
./tools/clang/test/Sema/asm.c
llvm-lit: /home/sdi/src/llvm-toolchain/llvm/utils/lit/lit/llvm/config.py:334:
note: using clang: /home/sdi/src/llvm-toolchain/build/bin/clang
-- Testing: 1 tests, 1 threads --
PASS: Clang :: Sema/asm.c (1 of 1)
Testing Time: 0.10s
Expected Passes : 1
This now looks good to me.
How can I force to use a different clang than
"/home/sdi/src/llvm-toolchain/build/bin/clang"?
I have no symlink to /usr/bin/clang.
Thanks.
Regards,
- Sedat -
P.S.: New build-script
[build_clang-with-ninja.sh ]
#!/bin/sh
export LANG=C
export LC_ALL=C
cd build
CMAKE="cmake"
CMAKE_OPTS="-G Ninja -DCMAKE_C_COMPILER=clang-7
-DCMAKE_CXX_COMPILER=clang++-7 -DLLVM_PARALLEL_COMPILE_JOBS=2
-DLLVM_PARALLEL_LINK_JOBS=1 -DCMAKE_BUILD_TYPE=RELEASE
-DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_TARGETS_TO_BUILD=X86"
$CMAKE ../llvm $CMAKE_OPTS
ninja check-clang
- EOF -
sdi@iniza:~/src/llvm-toolchain/build$ ./bin/llvm-lit -v
./tools/clang/test/Sema/asm.c
llvm-lit: /home/sdi/src/llvm-toolchain/llvm/utils/lit/lit/llvm/config.py:334:
note: using clang: /home/sdi/src/llvm-toolchain/build/bin/clang
-- Testing: 1 tests, 1 threads --
PASS: Clang :: Sema/asm.c (1 of 1)
Testing Time: 0.10s
Expected Passes : 1
This now looks good to me.
How can I force to use a different clang than
"/home/sdi/src/llvm-toolchain/build/bin/clang"?
I have no symlink to /usr/bin/clang.
When compiling a Linux-kernel I hit a problem in the
KVM/paravirtualization area and "clobbering RCX" on Debian/testing
AMD64.
The question came up, is this is a compiler bug or not.
Details see [1].
Thus, I was looking for a reproducible testcase.
I have seen that clang ships some tests.
So, I was curious to run a single one.
Not sure if clang/test/Sema/asm.c is suitable here to see "clobbering
RCX" on Debian/x86-64.
On my host I have installed a clang-7 package from <apt.llvm.org>.
I wanted to test against that version.
Does this help you?
- Sedat -
[1] https://lkml.org/lkml/2018/4/24/1227
On Mon, May 7, 2018 at 5:19 PM, Brian Cain <brian...@gmail.com> wrote:
>
>
...
> Can you give a little more context? What is your ultimate goal for this
> activity? Why would you want to run the test in this fashion and what
> meaning would you attribute to the test passing or failing?
>
When compiling a Linux-kernel I hit a problem in the
KVM/paravirtualization area and "clobbering RCX" on Debian/testing
AMD64.
The question came up, is this is a compiler bug or not.
Details see [1].
Thus, I was looking for a reproducible testcase.
I have seen that clang ships some tests.
So, I was curious to run a single one.
Not sure if clang/test/Sema/asm.c is suitable here to see "clobbering
RCX" on Debian/x86-64.
On my host I have installed a clang-7 package from <apt.llvm.org>.
I wanted to test against that version.
Does this help you?
- Sedat -
[1] https://lkml.org/lkml/2018/4/24/1227
> On May 6, 2018, at 5:10 AM, Sedat Dilek via llvm-dev <llvm...@lists.llvm.org> wrote:
>
> What am I missing?
> What do I need to run a single clang testcase?
I might be missing some context here, but to address a very similar problem I have introduced an environment variable LIT_FILTER.
So if you want to run the test blah.test, you could run
$ env LIT_FILTER=blah.test ninja check-clang
I have found that much easier than trying to invoke clang directly.
George
>
> Thanks in advance.
>
> Regards,
> - Sedat -
>
> [1] https://github.com/llvm-mirror/clang/raw/master/test/Sema/asm.c
> [2] https://llvm.org/docs/CommandGuide/lit.html
> [3] https://llvm.org/docs/TestingGuide.html
> [4] https://llvm.org/docs/TestSuiteMakefileGuide.html
> [5] http://clang.llvm.org/hacking.html
> [6] http://clang.llvm.org/hacking.html#testingCommands
> <TestingConfig.py><lit.cfg.py><lit.site.cfg.py.in>_______________________________________________