|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v2 1/4] tools/tests/x86_emulator: avoid duplicate symbol error with clang
On 03.03.2026 16:55, Edwin Torok wrote: >> On 3 Mar 2026, at 15:36, Jan Beulich <jbeulich@xxxxxxxx> wrote: >> On 03.03.2026 16:09, Edwin Torok wrote: >>>> On 3 Mar 2026, at 13:59, Jan Beulich <jbeulich@xxxxxxxx> wrote: >>>> On 27.02.2026 11:58, Edwin Török wrote: >>>>> --- a/tools/tests/x86_emulator/test_x86_emulator.c >>>>> +++ b/tools/tests/x86_emulator/test_x86_emulator.c >>>>> @@ -1882,8 +1882,13 @@ int main(int argc, char **argv) >>>>> #define decl_insn(which) extern const unsigned char which[], \ >>>>> which##_end[] asm ( ".L" #which "_end" ) >>>>> #define put_insn(which, insn) ".pushsection .test\n" \ >>>>> - #which ": " insn "\n" \ >>>>> + ".ifndef "#which"\n" \ >>>>> + #which ": \n" \ >>>>> + ".endif\n" \ >>>>> + insn "\n" \ >>>>> + ".ifndef .L"#which"_end\n" \ >>>>> ".L" #which "_end:\n" \ >>>>> + ".endif\n" \ >>>>> ".popsection" >>>> >>>> Nice idea, but why multiple .ifndef, and why emitting the insn even if the >>>> labels are already there (and hence won't be emitted a 2nd time)? >>> >>> I think we still need to execute the instructions, so they can be compared >>> against the emulator. >> >> Of course, but they cannot be executed without having a label. We use the >> label to point the emulated IP there, and then we use the end label to >> check that after emulation the emulated IP has advanced as expected. > > Oh that means that we won’t actually be testing anything useful in > iterations>=1 > (the test passes, but it runs the same test as it did on iteration 0). May I ask for a little less bold statements? Of course the 2nd iteration isn't identical to the 1st. The insn encoding is the same, but the operands (the mask in particular, i.e. the value %k3 holds) aren't. Jan
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |