Sedat Dilek via llvm-dev
2018-May-07 15:46 UTC
[llvm-dev] [clang] Running a single testcase
On Mon, May 7, 2018 at 5:19 PM, Brian Cain <brian.cain at gmail.com> wrote:> > > On Mon, May 7, 2018 at 10:13 AM, Sedat Dilek <sedat.dilek at gmail.com> wrote: >> >> ... > > >> >> sdi at 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. >> > > 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
Brian Cain via llvm-dev
2018-May-07 15:56 UTC
[llvm-dev] [clang] Running a single testcase
On Mon, May 7, 2018 at 10:46 AM, Sedat Dilek <sedat.dilek at gmail.com> wrote:> On Mon, May 7, 2018 at 5:19 PM, Brian Cain <brian.cain at 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. > >Yes, I agree that it might not be the right test.> 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 >I see, yes, this is clearer now. IIUC, this test is testing clang's behavior regarding inline assembly and probably won't verify things like which registers are saved and restored. I think you might get resolution on this issue faster if you reduce native_save_fl() and its caller to a simple example that shows RCX not being saved. Bonus points if you can identify any conditions that change this behavior -- or versions of clang that behave differently. Then share your test and ask on llvm-dev and/or cfe-dev whether or not this behavior is expected. -- -Brian -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180507/6b74dbd7/attachment.html>
Sedat Dilek via llvm-dev
2018-May-07 19:25 UTC
[llvm-dev] [clang] Running a single testcase
On Mon, May 7, 2018 at 5:56 PM, Brian Cain <brian.cain at gmail.com> wrote:> > On Mon, May 7, 2018 at 10:46 AM, Sedat Dilek <sedat.dilek at gmail.com> wrote: >> >> On Mon, May 7, 2018 at 5:19 PM, Brian Cain <brian.cain at 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. >> > > Yes, I agree that it might not be the right test. > >> >> 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 > > > I see, yes, this is clearer now. > > IIUC, this test is testing clang's behavior regarding inline assembly and > probably won't verify things like which registers are saved and restored. > > I think you might get resolution on this issue faster if you reduce > native_save_fl() and its caller to a simple example that shows RCX not being > saved. Bonus points if you can identify any conditions that change this > behavior -- or versions of clang that behave differently. Then share your > test and ask on llvm-dev and/or cfe-dev whether or not this behavior is > expected. >Matthias answered in [1]. [1] https://lkml.org/lkml/2018/5/7/534