diff mbox

[kvm-unit-tests] powerpc: don't fail if QEMU does not support alignment exception

Message ID 1461072994-13567-1-git-send-email-lvivier@redhat.com
State Superseded
Headers show

Commit Message

Laurent Vivier April 19, 2016, 1:36 p.m. UTC
As for lswi, lswx is supposed to cause an alignment exception in
little endian mode, but QEMU does not support it. So in case we do
not get an exception, this is an expected failure and we run the other
tests.

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
 powerpc/emulator.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

Comments

Laurent Vivier April 20, 2016, 6:52 a.m. UTC | #1
On 19/04/2016 15:36, Laurent Vivier wrote:
> As for lswi, lswx is supposed to cause an alignment exception in
> little endian mode, but QEMU does not support it. So in case we do
> not get an exception, this is an expected failure and we run the other
> tests.
> 
> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
> ---
>  powerpc/emulator.c | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/powerpc/emulator.c b/powerpc/emulator.c
> index 4dc341f..9720723 100644
> --- a/powerpc/emulator.c
> +++ b/powerpc/emulator.c
> @@ -245,8 +245,16 @@ static void test_lswx(void)
>  		      "xer", "r11", "r12", "memory");
>  
>  #if  __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
> -	report("alignment", alignment);
> -	return;
> +	/*
> +	 * lswx is supposed to cause an alignment exception in little endian
> +	 * mode, but QEMU does not support it. So in case we do not get an
> +	 * exception, this is an expected failure and we run the other tests
> +	 */
> +	report_xfail("alignment", !alignment, alignment);
> +	if (alignment) {
> +		report_prefix_pop();
> +		return;
> +	}
>  #else
>  	report("partial", regs[0] == 0x01020300 && regs[1] == (uint64_t)-1);
>  #endif


If fact, this is not correct: the report("partial",...) should be out
the #if..#endif body.

Laurent

--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/powerpc/emulator.c b/powerpc/emulator.c
index 4dc341f..9720723 100644
--- a/powerpc/emulator.c
+++ b/powerpc/emulator.c
@@ -245,8 +245,16 @@  static void test_lswx(void)
 		      "xer", "r11", "r12", "memory");
 
 #if  __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
-	report("alignment", alignment);
-	return;
+	/*
+	 * lswx is supposed to cause an alignment exception in little endian
+	 * mode, but QEMU does not support it. So in case we do not get an
+	 * exception, this is an expected failure and we run the other tests
+	 */
+	report_xfail("alignment", !alignment, alignment);
+	if (alignment) {
+		report_prefix_pop();
+		return;
+	}
 #else
 	report("partial", regs[0] == 0x01020300 && regs[1] == (uint64_t)-1);
 #endif