On Thumb-2 the use of CBZ blocks conditional execution, so change the
test to compare with a non-zero value.
gcc/testsuite/ChangeLog:
PR target/113915
* gcc.target/arm/builtin-bswap.x: Fix test to avoid emitting CBZ.
---
diff --git a/gcc/testsuite/gcc.target/arm/builtin-bswap.x
b/gcc/testsuite/gcc.target/arm/builtin-bswap.x
index
c96dbe6329c4dc648fd0bcc972ad494c7d6dc6e5..dc8f910e0007a67ae5cb5100c98101c7b199b5ca
100644
--- a/gcc/testsuite/gcc.target/arm/builtin-bswap.x
+++ b/gcc/testsuite/gcc.target/arm/builtin-bswap.x
@@ -10,7 +10,7 @@ extern short foos16 (short);
short swaps16_cond (short x, int y)
{
short z = x;
- if (y)
+ if (y != 2)
z = __builtin_bswap16 (x);
return foos16 (z);
}
@@ -27,7 +27,7 @@ extern unsigned short foou16 (unsigned short);
unsigned short swapu16_cond (unsigned short x, int y)
{
unsigned short z = x;
- if (y)
+ if (y != 2)
z = __builtin_bswap16 (x);
return foou16 (z);
}
@@ -43,7 +43,7 @@ extern int foos32 (int);
int swaps32_cond (int x, int y)
{
int z = x;
- if (y)
+ if (y != 2)
z = __builtin_bswap32 (x);
return foos32 (z);
}
@@ -60,7 +60,7 @@ extern unsigned int foou32 (unsigned int);
unsigned int swapsu2 (unsigned int x, int y)
{
int z = x;
- if (y)
+ if (y != 2)
z = __builtin_bswap32 (x);
return foou32 (z);
}