This is an archive of the discontinued LLVM Phabricator instance.

[lldb] [test/Register] Attempt to fix x86-fp-read.test on Darwin
ClosedPublic

Authored by mgorny on Oct 4 2020, 2:23 AM.

Details

Summary

Darwin seems to use stmmN instead of stN. Use a regex to accept both.

Also try to actually clear st(7).

Diff Detail

Event Timeline

mgorny requested review of this revision.Oct 4 2020, 2:23 AM
mgorny created this revision.

@JDevlieghere would you be able to test if this makes the test pass on Darwin?

I suspect that the mm-xmm test is affected by the same problem but the test is not as trivially fixable there.

@JDevlieghere would you be able to test if this makes the test pass on Darwin?

I suspect that the mm-xmm test is affected by the same problem but the test is not as trivially fixable there.

Thank you. It does fix the register name, but it still fails because the output for stmm7 is different. I'm not sure if that's expected?

Expected: st{{(mm)?}}7 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
Actual:   stmm7        = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xff 0xff}

Full output:

/Users/jonas/llvm/llvm-project/lldb/test/Shell/Register/x86-fp-read.test:23:14: error: CHECK-DAG: expected string not found in input
# CHECK-DAG: st{{(mm)?}}7 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
             ^
<stdin>:16:1: note: scanning from here
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BREAKPOINT (code=EXC_I386_BPT, subcode=0x0)
^
<stdin>:117:2: note: possible intended match here
 stmm2 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
 ^

Input file: <stdin>
Check file: /Users/jonas/llvm/llvm-project/lldb/test/Shell/Register/x86-fp-read.test

-dump-input=help explains the following input dump.

Input was:
<<<<<<
          .
          .
          .
         11: Current executable set to '/Users/jonas/llvm/build-ra/tools/lldb/test/Register/Output/x86-fp-read.test.tmp' (x86_64).
         12: (lldb) command source -s 0 '/Users/jonas/llvm/llvm-project/lldb/test/Shell/Register/x86-fp-read.test'
         13: Executing commands in '/Users/jonas/llvm/llvm-project/lldb/test/Shell/Register/x86-fp-read.test'.
         14: (lldb) process launch
         15: Process 62241 stopped
         16: * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BREAKPOINT (code=EXC_I386_BPT, subcode=0x0)
dag:23'0     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
         17:  frame #0: 0x0000000100003ee1 x86-fp-read.test.tmp`main at x86-fp-read.cpp:25:3
dag:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         18:  22 // used as single-precision float
dag:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         19:  23 uint32_t zero = 0;
dag:23'0     ~~~~~~~~~~~~~~~~~~~~~~
         20:  24
dag:23'0     ~~~~
         21: -> 25 asm volatile(
dag:23'0     ~~~~~~~~~~~~~~~~~~~
          .
          .
          .
        112:  foseg = 0x7ffe
dag:23'0     ~~~~~~~~~~~~~~~
        113:  mxcsr = 0x00001f80
dag:23'0     ~~~~~~~~~~~~~~~~~~~
        114:  mxcsrmask = 0x0000ffff
dag:23'0     ~~~~~~~~~~~~~~~~~~~~~~~
        115:  stmm0 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x80 0x00 0x40}
dag:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        116:  stmm1 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x3f 0x00 0x00}
dag:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        117:  stmm2 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00}
dag:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dag:23'1      ?                                                           possible intended match
        118:  stmm3 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x80}
dag:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        119:  stmm4 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x80 0xff 0x7f}
dag:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        120:  stmm5 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x80 0xff 0xff}
dag:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        121:  stmm6 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xc0 0xff 0xff}
dag:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        122:  stmm7 = {0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xff 0xff}
dag:23'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          .
          .
          .
>>>>>>

Can we rename the register names in the darwin plugin?

mgorny updated this revision to Diff 296091.Oct 4 2020, 7:58 PM
mgorny edited the summary of this revision. (Show Details)

Please try this one. Apparently the registers aren't cleared like on other systems.

JDevlieghere accepted this revision.Oct 4 2020, 10:22 PM

That works. Thank you!

This revision is now accepted and ready to land.Oct 4 2020, 10:22 PM

Thanks. I won't be at a computer for the next 8 hours, so feel free to push it for me.

Herald added a project: Restricted Project. · View Herald TranscriptOct 4 2020, 11:05 PM

Thanks. I won't be at a computer for the next 8 hours, so feel free to push it for me.

Done. Thanks a lot for following up on this so quickly!

No problem. If you could send me logs for other tests xfailing on Darwin (particularly mm-related), I'd also be happy to take a look.

BTW, what's the reason for darwin using the name stmm? It would be nice if the register names were consistent across a single architecture. We could keep the "stmm" variants as the "alternate" names on darwin for a while, to avoid breaking any scripts or so...