Re: [testsuite/alpha] Add test for step over fbne instruction

Joel Brobecker
2005-05-26T03:44:24Z

> Hmm, now that I think about it, one potential problem with this form
> is that we're not correctly testing for branch taken. The scenerio
> is that we expect taken, set the bp on the ret, the branch *isn't*
> taken, but we fall through to the ret anyway.

I think we do test both possibilities. That's because I verify that
we landed on the correct instruction after the stepi:

# Step test, followed by the check that we landed on the expected
# instruction (the testcase should be written in such a way that
# the branch is taken on the first call to this function.

gdb_test "stepi" \
"0x\[0-9a-fA-F\]+.*" \
"stepi on fb$function (first call)"

gdb_test "x /i \$pc" \
"0x\[0-9a-fA-F\]+ <.*>:\[ \t\]+ret\[ \t\]+.*" \
"Check stepi over fb$function stopped on ret"

(I think this is what Daniel was suggesting).

When the branch is not taken, we do the following test:

gdb_test "x /i \$pc" \
"0x\[0-9a-fA-F\]+ <.*>:\[ \t\]+fneg\[ \t\]+.*" \
"Check stepi over fb$function stopped on fneg instruction"

--
Joel